In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to access the memory when using bp addressing, I believe that most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
If bp addressing is used when accessing memory, the default segment register is "SS", that is, the stack segment. SS stack segment usually refers to a memory area that works in stack mode; in the architecture of program memory allocation using segment memory management, stack segment is used to store local variables and function return addresses.
The segment register is set because of the segmented management of memory. The computer needs to segment memory to be allocated to different programs (similar to hard disk paging). When describing memory segmentation, you need the following information: 1. The size of the segment; 2. The starting address of the segment; 3. Administrative attributes of the section (write prohibited / execution prohibited / system specific, etc.). This information needs to be stored in 8 bytes (64 bits), but the segment register has only 16 bits, so the segment number (segment selector) can only be stored in the segment register, and then mapped to GDT (global (segment) descriptor table) in memory to read the segment information.
8086CPU has 20 address lines and the maximum addressable memory space is 1MB. The 8086 register has only 16 bits, and the instruction pointer (IP) and indexing registers (SI, DI) are also 16-bit. It is impossible to address the 1MB space with a 16-bit address. So it is necessary to segment the memory, that is, the 1MB space is divided into 2 ^ 4, that is, 16 segments, each no more than 64KB (2 ^ 16, 16-bit data lines can be addressed). Four 16-bit segment registers are set in 8086 to manage four kinds of segments: CS is the code segment, DS is the data segment, SS is the stack segment, and ES is the additional segment. After segmenting the memory, each segment has a segment base address, and the segment register stores the high 16 bits of the segment base address. The 16-bit address can be moved four bits to the left (followed by four zeros) to form a 20-bit segment base address.
The segment register CS points to the memory segment where the program is stored, and IP is used to store the offset of the next instruction to be executed in that section, and the next instruction to be executed can be obtained in the memory segment by combining them.
The segment register SS points to the memory segment used for the stack, and SP is used to point to the top of the stack, which can be combined to access the top unit of the stack. In addition, when the pointer register BP is used for the offset, the default segment register is also SS, and the entire stack can be accessed with BP, not just the top of the stack.
The segment register DS points to the data segment and the ES points to the additional segment. When accessing the operands, one of the two and an offset can be combined to get the physical address of the memory unit. The offset can be one of the specific values, the symbolic address and the value of the pointer register, etc., which will be determined by the addressing mode of the instruction.
In general, the default segment register is DS, with one exception: when performing a string operation, the segment register of its destination address is specified as ES. Of course, in general instructions, we can also change the segment register of operands by changing the "segment substitution" field in the prefix.
"optional segment registers" are segment addresses that can be used to force the values of these segment registers as their Operand addresses.
The above is all the contents of the article "how to use bp addressing when accessing memory". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.