3 MP
3 MP
3 MP
8086 Microprocessor.
8086 Microprocessor
8086 Features
• The 8086 has two parts, the Bus Interface Unit (BIU) and the
Execution Unit (EU).
• The BIU fetches instructions, reads and writes data, and computes the
20-bit address.
• The EU decodes and executes the instructions using the 16-bit ALU.
The BIU fetches instructions using the CS and IP, written CS:IP, to contract
the 20-bit address. Data is fetched using a segment register (usually the DS)
and an effective address (EA) computed by the EU depending on the
addressing mode.
The EU contains the following 16-bit registers:
AX - the Accumulator
BX - the Base Register
CX - the Count Register
DX - the Data Register
SP - the Stack Pointer \ defaults to stack segment
BP - the Base Pointer /
SI - the Source Index Register
DI - the Destination Register
The AX, BX, CX, and DX registers can be considers as two 8-bit registers, a
High byte and a Low byte. This allows byte operations and compatibility with
the previous generation of 8-bit processors, the 8080 and 8085. 8085 source
code could be translated in 8086 code and assembled. The 8-bit registers are:
AX --> AH,AL
BX --> BH,BL
CX --> CH,CL
DX --> DH,DL
ES Extra Segment
BIU registers CS Code Segment
SS Stack Segment
DS Data Segment
IP Instruction Pointer
EU registers AX AH AL Accumulator
BX BH BL Base Register
CX CH CL Count Register
DX DH DL Data Register
SP Stack Pointer
BP Base Pointer
SI Source Index Register
DI Destination Index Register
FLAGS
8086/88
8086/88internal
internalregisters
registers16
16bits
bits(2
(2bytes
byteseach)
each)
Adder
________________________
1 5 5 A 5 H
• Status flags: Flags
Flags
– They are set according to some results of arithmetic operation. You do
not need to alter the value yourself.
• Control flags:
– Used to control some operations of the MPU.
Carry flag
Overflow
Direction Parity flag
Bit no. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
• CF (carry) Contains carry from leftmost bit following arithmetic, also
contains last bit from a shift or rotate operation.
• OF (overflow) Indicates overflow of the leftmost bit during arithmetic.
• DF (direction) Indicates left or right for moving or comparing string data. DF =0
autoinc… DF=1 auto decrem.
• IF (interrupt) Indicates whether external interrupts are being processed or ignored.
• TF (trap) Permits operation of the processor in single step mode.
• AF (auxiliary carry) Contains carry out of bit 3 into bit 4 for specialized arithmetic.