Execution Unit [EU]:
The execution unit of Internal Architecture of 8086 tells the BIU from where to fetch instructions
or data, decodes instructions and executes instructions. It contains
Control Circuitry
Instruction Decoder
Arithmetic Logic Unit (ALU)
Flag Register
General Purpose Registers
Pointers and Index Registers
Registers
All processors have internal registers. An internal register is actually an on- chip RAM. Some
are program visible , while others are not directly visible to the programmers. The more the
number of programs visible registers , the better it is for the programmer. This is because
internal registers are used as temporary storage for operands, and if the operand is already in
register, it takes less time for execution of the associated instruction. Such registers are called
general- purpose or scratchpad registers.
However, registers constitute on-chip RAM , which is costly. Also more the number of
registers, more are the number of bits required to identify and address a particular register. This
can cause an increase the length of opcodes in modes involving registers. thus, the number of
registers a processor can have is a trade –off between a number of conflicting factors.
Register set of 8086
The 8086 has data registers , address registers , segment registers and also a flag register.
Scratchpad Registers
They are called so because they are used for temporary storage, the 8086 has four 16-bit general-
purpose registers labeled as AX,BX,CX and DX. Each of these registers can also be used as two
separate and exclusive 8-bit registers also, i.e., AX has two parts AH and AL, where H and L
stands for the high and low portions, respectively. When used as 8-bit registers , AH and AL are
separate ,but they can be concatenated to form the 16-bit register AX. Similar is the case for the
registers BX,CX and DX. Each register while being general-purpose , has specialized uses as
well.
The EU has. 8 general purpose registers labeled ATI, AL, BH, BL, CH, CL, DH, and DL.
These registers can be used individually for temporary storage of 8 bit data. The AL register is
also called accumulator. Certain pairs of these general purpose registers can be used together to
store 16-bit data, such as AX, BX, CX and DX.
, AX – This is the accumulator. It is of 16 bits and is divided into two 8-bit registers AH and AL
to also perform 8-bit instructions. It is generally used for arithmetical and logical
instructions but in 8086 microprocessor it is not mandatory to have accumulator as the
destination operand.
BX – This is the base register. It is of 16 bits and is divided into two 8-bit registers BH and BL to
also perform 8-bit instructions. It is used to store the value of the offset.
CX – This is the counter register. It is of 16 bits and is divided into two 8-bit registers CH and
CL to also perform 8-bit instructions. It is used in looping and rotation.
DX – This is the data register. It is of 16 bits and is divided into two 8-bit registers DH and DL
to also perform 8-bit instructions. It is used in multiplication an input/output port
addressing.
Pointers and Index Registers:
All segment registers are 16-bit. But it is necessary to put 20-bit address (physical
address) on the address bus. To get 20-bit physical address one more register is associated with
each segment register the way IP is associated with CS.
These additional registers belong to the pointer and index group. The pointer and index
group consists of instruction pointer (IP), stack pointer (SP), BP (base pointer), source index (SI)
and destination index (DI) registers.
Stack Pointer (SP) :
The stack pointer (SP) register contains the 16-bit offset from the start of the segment to
the top of stack. For stack operation, physical address is produced by adding the contents of stack
pointer register to the segment base address in SS. To do this the contents of the stack segment
register are shifted four bits left and the contents of SP are added to the shifted result.
Base Pointer, Source Index and Destination Index (BP, SI and DI)
These three 16-bit registers can be used as general purpose registers. However, their .
main use is to hold the 16-bit offset of the data word in one of the segments.
Base pointer :
We can use the BP register instead of SP for accessing the stack using the based
addressing. mode. In this case, the 20-bit physical stack address. is calculated from BP and SS.
Addressing modes are discussed in later section.
Source Index :
Source index (SI) can be used to hold the offset of a data word in the data segment. In
this case, the 20-bit physical data address is calculated from SI and
Destination Index :
The ES register .points to the extra segment in which data is stored. String instructions
always use ES and DI to determined the 20-bit physical address for the destination.
The execution unit of Internal Architecture of 8086 tells the BIU from where to fetch instructions
or data, decodes instructions and executes instructions. It contains
Control Circuitry
Instruction Decoder
Arithmetic Logic Unit (ALU)
Flag Register
General Purpose Registers
Pointers and Index Registers
Registers
All processors have internal registers. An internal register is actually an on- chip RAM. Some
are program visible , while others are not directly visible to the programmers. The more the
number of programs visible registers , the better it is for the programmer. This is because
internal registers are used as temporary storage for operands, and if the operand is already in
register, it takes less time for execution of the associated instruction. Such registers are called
general- purpose or scratchpad registers.
However, registers constitute on-chip RAM , which is costly. Also more the number of
registers, more are the number of bits required to identify and address a particular register. This
can cause an increase the length of opcodes in modes involving registers. thus, the number of
registers a processor can have is a trade –off between a number of conflicting factors.
Register set of 8086
The 8086 has data registers , address registers , segment registers and also a flag register.
Scratchpad Registers
They are called so because they are used for temporary storage, the 8086 has four 16-bit general-
purpose registers labeled as AX,BX,CX and DX. Each of these registers can also be used as two
separate and exclusive 8-bit registers also, i.e., AX has two parts AH and AL, where H and L
stands for the high and low portions, respectively. When used as 8-bit registers , AH and AL are
separate ,but they can be concatenated to form the 16-bit register AX. Similar is the case for the
registers BX,CX and DX. Each register while being general-purpose , has specialized uses as
well.
The EU has. 8 general purpose registers labeled ATI, AL, BH, BL, CH, CL, DH, and DL.
These registers can be used individually for temporary storage of 8 bit data. The AL register is
also called accumulator. Certain pairs of these general purpose registers can be used together to
store 16-bit data, such as AX, BX, CX and DX.
, AX – This is the accumulator. It is of 16 bits and is divided into two 8-bit registers AH and AL
to also perform 8-bit instructions. It is generally used for arithmetical and logical
instructions but in 8086 microprocessor it is not mandatory to have accumulator as the
destination operand.
BX – This is the base register. It is of 16 bits and is divided into two 8-bit registers BH and BL to
also perform 8-bit instructions. It is used to store the value of the offset.
CX – This is the counter register. It is of 16 bits and is divided into two 8-bit registers CH and
CL to also perform 8-bit instructions. It is used in looping and rotation.
DX – This is the data register. It is of 16 bits and is divided into two 8-bit registers DH and DL
to also perform 8-bit instructions. It is used in multiplication an input/output port
addressing.
Pointers and Index Registers:
All segment registers are 16-bit. But it is necessary to put 20-bit address (physical
address) on the address bus. To get 20-bit physical address one more register is associated with
each segment register the way IP is associated with CS.
These additional registers belong to the pointer and index group. The pointer and index
group consists of instruction pointer (IP), stack pointer (SP), BP (base pointer), source index (SI)
and destination index (DI) registers.
Stack Pointer (SP) :
The stack pointer (SP) register contains the 16-bit offset from the start of the segment to
the top of stack. For stack operation, physical address is produced by adding the contents of stack
pointer register to the segment base address in SS. To do this the contents of the stack segment
register are shifted four bits left and the contents of SP are added to the shifted result.
Base Pointer, Source Index and Destination Index (BP, SI and DI)
These three 16-bit registers can be used as general purpose registers. However, their .
main use is to hold the 16-bit offset of the data word in one of the segments.
Base pointer :
We can use the BP register instead of SP for accessing the stack using the based
addressing. mode. In this case, the 20-bit physical stack address. is calculated from BP and SS.
Addressing modes are discussed in later section.
Source Index :
Source index (SI) can be used to hold the offset of a data word in the data segment. In
this case, the 20-bit physical data address is calculated from SI and
Destination Index :
The ES register .points to the extra segment in which data is stored. String instructions
always use ES and DI to determined the 20-bit physical address for the destination.