Breaking News
recent

Register organisation

REGISTER ORGANISATION

Register: Register is the memory space which stores data. It is also known as programmer`s model of 8086. The registers which are in programmer`s model and accessible to programmer. The below figure shows the register organization of 8086 which are 16 bit registers.




a) General purpose:
                           The 8086 has four 16 bit general purpose registers AX, BX, CX and DX. Each 16 bit general purpose register split into two 8 bit registers. The two 8 bit registers are named as L and H which refers lower and higher byte.
                      For example AX is the register which is the combination of higher byte AH and lowers byte AL.
The general purpose register are used for holding data variables and intermediate results temporarily.



AX = 16 bit accumulator
BX = offset storage for generating physical address in case of certain addressing modes.
CX = default counter in case of string and loop instructions.
DX = general purpose registers.


b) Segment Registers:
                           In segment registers the memory about 1Megabyte be divided into segments with a maximum size of 64 kilobytes each. Thus any locations within the segments can be accessed using 16 bits.
                              The 8086 allows four segments at a time. These segments are selected by using bus interference unit (BIU) of 8086.
CS = Code Segment
DS = Data Segment
SS = Stack Segment
ES = Extra segment


         The value in CS identifies the starting address of 64 kilobyte segment known as Code Segment. By starting address the lowest addressed byte may be active. This starting address is also known as Base address.
                The BIU always inserts zero for the lower 4 bits in the contents of segments register to generate 20 bit base address. For example, if code segment register contains 492AH, the code segment will start at address 492A0H

Functions of segment register:

1. The CS register holds the upper 16 bits fetching to the instruction byte.
2. The SS register is used for upper 16 bits for programming stack.
3. ES and DS register are used to hold the upper 16 bits of starting address of two memory segments which are used for data.

c) Pointers and Index Registers:
               Pointer is a variable which holds the address of another variable. All segment registers are 16 bit wide. But for convenient requirement is about 20- bit address. To get 20 bit physical address one (or) more pointer (or) Index registers are associated with each segment register.


*Pointer address belongs to CS, SS, and DS
*Index registers belongs to General purpose registers and offset storage in case of indexed addressing mode.

d) Flag Registers:
                    A Flag is a flip-flop which indicates some condition and execution of a construction (or) controls certain operations of the EU. The flag register contain of active flags.


 Carry flags: In the case of Arithmetical operation such as addition this flag is set to carry out the most significant bit (MSB) and also 
serves as a borrow flag for subtraction.

Parity flag: In case of lower byte of word operation contain an even number this flag set to result as 1, otherwise 0.

Auxiliary flag: This flag is used for BCD operations and is not available for the programmer. The function of this flag is to set (or) carry the lower nibble to higher nibble (bit).

Zero flag: This flag sets if the operation results of ALU is zero and resets when it is non zero. It is also set zero if an increment or decrement operation of that register.

Sign flag: Sign Flag indicates the result is positive or negative. After the execution of ALU operation if result is 1 the sign bit is negative, otherwise positive.

Overflow flag: This flag is set if result is out of range.
For addition, this flag set the carry into MSB and no out carry.
For subtraction, this flag sets when the MSB needs borrow and no borrow from MSB and vice-versa.
Trip flag: Trip flag is used for single stepping through a program. Single step means observing the register contents which are use at the time of program running. After the execution of instructions programmer can easily trace and correct errors in the program.

Interrupt flag: This flag is used to allow or prohibit the interruption of a program. The interrupts are recognized by the 8086, otherwise these interrupts are ignored.

Direction flag: It is used with string instructions, if DF = 0, the string processing from beginning with the first element having lower address, otherwise processed form higher to lower.

The below video shows the microprocessors Architecture and modes of operation

Unknown

Unknown

No comments:

Post a Comment

Powered by Blogger.