Sunday, April 30

register organisation of 8086

Register organisation of 8086
The data group consists of the accumulator and the BX, CX, and DX registers. Note that each can be accessed as a byte or a word. Thus BX refers to the 16-bit base register but BH refers only to the higher 8 bits of this register. The data registers are normally used for storing temporary results that will be acted on by subsequent instructions.
The pointer and index group are all 16-bit registers (you cannot access the low or high bytes alone). These registers are used as memory pointers. Sometimes a pointer reg will be interpreted as pointing to a memory byte and at other times a memory word. As you will see, the 8086 always stores words with the high-order byte in the high-order word address.
Register IP could be considered in the previous group, but this register has only one function -to point to the next instruction to be fetched to the BIU. Register IP is physically part of the BIU and not under direct control of the programmer as are the other pointer registers.
Six of the flags are status indicators, reflecting properties of the result of the last arithmetic or logical instructions. The 8086 has several instructions that can be used to transfer program control to a new memory location based on the state of the flags.
Three of the flags can be set or reset directly by the programmer and are used to control the operation of the processor. These are TF, IF, and DF.
The final group of registers is called the segment group. These registers are used by the BIU to determine the memory address output by the CPU when it is reading or writing from the memory unit.


Segment Registers
Within the 1MB of memory space, the 8086 defines four 64 K memory blocks: The code segment, stack segment, data segment, extra segment. Each of these blocks of memory is used differently by the processor.
·         The code segment holds the program instruction codes.
·         The data segment holds the data of the program.
·         The extra segment is an extra data segment (often used for shared data).
·         The stack segment is used to store interrupt and subroutine return addresses.
There are four segment registers CS, DS, ES and SS and each of them defines the starting address of the corresponding segment. Each segment register is 16 bits wide while the address bus is 20 bits wide. The BIU takes care of this by appending four 0s to the low order bits of the segment register.
As an example, if the CS register contains 1234H, and the IP register contains 5678H, then the next instruction is fetched from physical address 179B8H, which is 1234H times 10H.
ie 12340+5678= 179B8H


GOTO :



No comments:

Post a Comment