8086 microprocessor has two units; Execution Unit (EU) and Bus Interface Unit (BIU). They are dependent and get worked by each other. Below is a short description of these two units.
Execution Unit (EU)
Execution unit receives program instruction codes and data from the BIU, executes them and stores the results in the general registers. It can also store the data in a memory location or send them to an I/O device by passing the data back to the BIU. This unit, EU, has no connection with the system Buses. It receives and outputs all its data through BIU.
1. ALU (Arithmetic and Logic Unit)
The EU unit contains a circuit board called the Arithmetic and Logic Unit. The ALU can perform arithmetic, such as addition, subtraction, multiplication, division and logic operations such as OR, AND, NOT operations.
2. Registers
A register is like a memory location where the exception is that these are denoted by name rather than numbers. It has 4 data registers, AX, BX, CX, DX and 2 pointer registers SP, BP and 2 index registers SI, DI and 1 temporary register and 1 status register FLAGS.
AX, BX, CX and DX registers have 2 8-bit registers to access the high and low byte data registers. The high byte of AX is called AH and the low byte is AL. Similarly, the high and low bytes of BX, CX, DX are BH and BL, CH and Cl, DH and DL respectively. All the data, pointer, index and status registers are of 16 bits. Else these, the temporary register holds the operands for the ALU and the individual bits of the FLAGS register reflect the result of a computation.
Bus Interface Unit
As the EU has no connection with the system Busses, this job is done by BIU. BIU and EU are connected with an internal bus. BIU connects EU with the memory or I/O circuits. It is responsible for transmitting data, addresses and control signal on the busses.
1. Registers
BIU has 4 segment busses, CS, DS, SS, ES. These all 4 segment registers hold the addresses of instructions and data in memory. These values are used by the processor to access memory locations. It also contains 1 pointer register IP. IP contains the address of the next instruction to executed by the EU.
2. Instruction Queue
BIU also contain an instruction queue. When the EU executes instructions, the BIU gets up to 6 bytes of the next instruction and stores them in the instruction queue and this process is called instruction prefetch. This is a process to speed up the processor. Also when the EU needs to be connected with memory or peripherals, BIU suspends instruction prefetch and performs the needed operations.
Purpose of using Instruction Queue:
BIU contains an instruction queue. When the EU executes instructions, the BIU gets up to 6 bytes of the next instruction and stores them in the instruction queue and this process is called instruction prefetch. This is a process to speed up the processor. A subtle advantage of instruction queue is that, as next several instructions are usually in the queue, the BIU can access memory at a somewhat “leisurely” pace. This means that slow-memory parts can be used without affecting overall system performance.
Registers
Data Registers
AX = Accumulator Register
BX = Base Register
DX = Data Register
CX = Count Register
Index Registers
SI = Source Index
DI = Destination Index
Segment Registers
DS = Data Segment
SS = Stack Segment
ES = Extra Segment
CS = Code Segment
Pointer Registers
IP = Instruction Pointer
BP = Base Pointer
SP = Stack Pointer
Segment Register
CS (Code Segment)
Code segment (CS) is a 16-bit register containing an address of 64 KB segment with processor instructions. The processor uses CS segment for all accesses to instructions referenced by instruction pointer (IP) register. CS register cannot be changed directly. The CS register is automatically updated during far jump, far call and far return instructions.
Stack segment (SS)
It is a 16-bit register containing an address of 64KB segment with program stack. By default, the processor assumes that all data referenced by the stack pointer (SP) and base pointer (BP) registers are located in the stack segment. SS register can be changed directly using POP instruction.
Data segment (DS)
It is a 16-bit register containing an address of 64KB segment with program data. By default, the processor assumes that all data referenced by general registers (AX, BX, CX, DX) and the index register (SI, DI) is located in the data segment. DS register can be changed directly using POP and LDS instructions.
Extra segment (ES)
It is a 16-bit register containing an address of 64KB segment, usually with program data. By default, the processor assumes that the DI register references the ES segment in string manipulation instructions. ES register can be changed directly using POP and LES instructions. It is possible to change default segments used by general and index registers by prefixing instructions with a CS, SS, DS or ES prefix.
IP (Instruction Pointer)
To access instructions the 8086 uses the registers CS and IP. The CS register contains the segment number of the next instruction and the IP contains the offset. IP is updated each time an instruction is executed so that it will point to the next instruction. Unlike other registers the IP can’t be directly manipulated by an instruction, that is, an instruction may not contain IP as its operand.
General Registers
All general registers of the 8086 microprocessor can be used for arithmetic and logic operations. The general registers are:
AX (Accumulator)
This is accumulator register. It gets used in arithmetic, logic and data transfer instructions. In manipulation and division, one of the numbers involved must be in AX or AL.
BX (Base Register)
This is base register. BX register is an address register. It usually contains a data pointer used for based, based indexed or register indirect addressing.
CX (Count Register)
This is Count Register. This serves as a loop counter. Program loop constructions are facilitated by it. Count register can also be used as a counter in string manipulation and shift/rotate instruction.
DX (Data Register)
This is data register. Data register can be used as a port number in I/O operations. It is also used in multiplication and division.
SP (Stack Pointer)
This is stack pointer register pointing to program stack. It is used in conjunction with SS for accessing the stack segment.
BP (Base Pointer)
This is base pointer register pointing to data in stack segment. Unlike SP, we can use BP to access data in the other segments.
SI (Source Index)
This is source index register which is used to point to memory locations in the data segment addressed by DS. By incrementing the contents of SI one can easily access consecutive memory locations.
DI (Destination Index)
This is destination index register performs the same function as SI. There is a class of instructions called string operations that use DI to access the memory locations addressed by ES.