Beruflich Dokumente
Kultur Dokumente
1
12/3/2018
2
12/3/2018
Register Organization
All registers within 8086 are 8 bit registers
Decoder: translates instructions fetched from they can be used separately or can be used in groups of 2
memory into a series of actions, which the for storing 16 bit data or address.
EU carries out. I. General-Purpose Registers
ALU: a 16-bit unit which can add, subtract, AND, Within EU there are eight general-purpose registers, AH,
OR, XOR, increment, decrement, complement, or AL(Accumulator), BH, BL, CH, CL, DH and DL.
shift binary numbers. These registers are used individually for temporary storage
of 8-bit data or in pairs of two to store 16-bit data words.
These are AH and AL(together called AX register), BH and
BL (called BX register), CH and CL (CX), and DH and DL
(DX).
Using internal registers enables EU to access data much
more quickly since data is already within the EU.
3
12/3/2018
II. Flag Register C-Carry Flag: This flag is set, when there is a
They are nine 8 bit registers carry out of MSB in case of addition or a borrow
in case of subtraction.
Used to hold the status of the microprocessor before or
after execution of an operation. AC-Auxiliary Carry Flag: This is set, if there is a
carry from the lowest nibble, i.e. bit three, during
so, certain instructions check these flags to before addition or borrow for the lowest nibble, i.e. bit
executing an instruction. three, during subtraction.
S-Sign Flag: This flag is set, when the result of any D-Direction Flag: This is used by string
computation is negative. For signed computations, the manipulation instructions. If this flag bit is '0’ the
sign flag equals the MSB of the result. string is processed beginning from the lowest
Z-Zero Flag: This flag is set, if the result of the address to the highest address, i.e. auto
computation or comparison performed by the previous incrementing mode. Otherwise, the string is
instruction/instructions is zero. processed from the highest address towards the
P-Parity Flag: This flag is set to 1, if the lower byte of lowest address, i.e. auto-decrementing mode.
the result contains even number of 1s.
Four segment registers in the BIU are used to hold the upper
16 bits of the starting addresses of the four memory
segments the 8086 is working currently.
These are (CS), the stack segment (SS), the extra segment
(ES) and the data segment (DS) registers.
4
12/3/2018
5
12/3/2018
V. Stack segment register and stack pointer register VI. Pointer and index registers
A stack is a section of memory set aside to store The EU contains a 16-bit base pointer (BP), a 16-bit
addresses and data while a subprogram is executing. source index (SI) and a 16- bit destination Index
The 8086 allow you to set aside an entire 64-Kbyte (DI) registers.
segment as a stack. These are used to hold the 16-bit offset of a data
The upper 16 bits of the base address of this segment word in Data segment or Extra segment
are kept in the stack segment register.
These registers, of course, can be used as temporary
The stack pointer (SP) register in the execution unit
holds the 16-bit offset from the base of the segment to storage of data like general purpose registers.
the particular memory slot where a word was most
recently stored on the stack.
The memory location where a word was most recently
stored is called the top of stack.
6
12/3/2018
7
12/3/2018