Introduction: 8086 Microprocessor is an upgraded form of


8086 Microprocessor is an upgraded form of the 8085
Microprocessor. This 16-bit microprocessor provides a storage capacity of 1MB
and comprises 20 address lines and 16 data lines.

It can operate in two
modes; Maximum and Minimum modes respectively. Maximum mode is apt when the
system has multiple processors and Minimum mode is for a single processor

Microprocessor is divide into two:


Execution Unit                                                                                               Bus
Interface Unit




The EU passes
instructions to the BIU on where to fetch data from, how to decode and further
execute those instructions. It controls all operations with the help of the
instruction decoder and the ALU (Arithmetic and Logic Unit). It is connected to
the system only through the BIU.

The ALU performs
arithmetic and logical operations like addition, subtraction, OR, Not, etc.

1 Flag Register: A
16-bit register that relies on the accumulator result for its status. It
contains 9 flags further divided into Conditional and Control flags.

Conditional flags:

1.      Carry
flag: Set to 1 when there is an overflow in arithmetic operations.

2.      Auxiliary
flag: Set to 1 when a carry/borrow is generated in the lower nibble and passed
on to the higher nibble.

3.      Parity
flag: Set to 1 when the lower order 8-bit result contains even number of 1’s.
Set to 0 when there are odd number of 1’s.

4.      Zero
flag: Set to 1 when an arithmetic or logical operation result is zero.

5.      Sign
flag: Set to 1 when an operation results in a negative.

6.      Overflow
flag: Set to 1 when system capacity is exceeded.

Control flags:

1.      Direction
flag: Set to 1 when it is required access the higher memory address in string

2.      Interrupt
flag: Set to 1 when interrupt conditions needs enabling which means that the
interruption of a program has to be allowed.

3.      Trap
flag: Set to 1 when the program is to be run in single step mode which means
one instruction is executed at a time to help in debugging.

2 General Purpose
Register: AH, AL, BH, BL, CH, CL, DH and DL are the 8 general purpose
registers. They can either be used individually (8-bit) or in pairs (16-bit).

AH and AL = AX

BH and BL = BX

CH and CL = CX

DH and DL = DX

AX register: Accumulator register;
stores operands for arithmetic operations

BX register: Base register; stores the
initial base address of memory within data segment

CX register: Counter register; stores
loop counter in loop instructions

DX register: stores I/O port address for
I/O instructions

3 Stack Pointer
Register: It stored the starting address of the segment top the memory location
in 16-bit form of where the most recent word was stored on the stack.



The BIU is connected to
the EU via the Internal Bus. It controls data and address transfers for the EU
like passing addresses, fetching instructions, decoding and writing data from
and to the memory.

1 Instruction Queue:
The BIU receives 6 bytes of instructions at a time and passes them to the
instruction queue. As the EU keeps executing the instructions 2 bytes at a time
and is ready for the next set, it simply fetches the next set from this
instruction queue.

2 Pipelining: The
process of the BIU passing the next set of instructions to the EU while the
previous instruction set is being executed is known as pipelining.

3 Segment
Register:  CS, DS, SS and ES are four
segment buses housed in the BIU. The processor uses the stored addresses of
instructions and data present in the memory to access memory locations.

CS: Code segment; gives address of
memory location of the executable program

DS: Data segment; gives the offset address
of the data to be used in the program

SS: Stack segment; provides memory to
deal with data and addressing during program execution

ES: Extra segment; stores extra
destination data for strings

4 Instruction Pointer:
It is present in the Segment register. It stores address of the next
instruction set to be executed.