The effect of CS is analogous to that of the other segment registers. This allows 20 bits of memory to be addressed, despite registers being only 16 bits wide (and it also creates two distinct ways to encode most of the addresses). The instruction that will be executed next is that at memory address equal to: 16 * CS + IP The 8086 was using 20 bits of addresses, so you could access 1M of memory. You could consider cs:ip together as one 32 bit register which is then capable of addressing 2^32 bytes.ie 4G which is what you get on a processor which uses 32 bit addresses. So to expand the address space you have a second register which addresses 64k blocks. Since the Instruction Pointer (IP) is 16 bit it means you can only have 64k instructions (2^16), which wasn't much even in the 80s. Hence CS:IP is used to point to the location (i.e to calculate the physical address)of the code in the memory. The IP(Instruction pointer) contains the offset within the code segment of the memory. The CS( code segment register) is used to address the code segment of the memory i.e a location in the memory where the code is stored. The physical address is calculated from 2 parts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |