Architecture of 8086

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Block diagram of 8086

1
Software Model of the 8086 Microprocessors

2
8086 Registers
General Purpose Index
AH AL
BP
AX

SP
BH BL
BX
SI

CH CL
DI
CX

DH DL
DX Segment

CS

Status and Control SS

Flags DS

IP ES

3
General Purpose Registers

AX - the Accumulator
BX - the Base Register
CX - the Count Register
DX - the Data Register

• Normally used for storing temporary results


• Each of the registers is 16 bits wide (AX, BX, CX, DX)
• Can be accessed as either 16 or 8 bits AX, AH, AL
4
General Purpose Registers
• AX
– Accumulator Register
– Preferred register to use in arithmetic, logic and data
transfer instructions because it generates the shortest
Machine Language Code
– Must be used in multiplication and division
operations
– Must also be used in I/O operations

• BX
– Base Register
– Also serves as an address register

5
General Purpose Registers
• CX
– Count register
– Used as a loop counter
– Used in shift and rotate operations

• DX
– Data register
– Used in multiplication and division
– Also used in I/O operations

6
Pointer and Index Registers

• All 16 bits wide, L/H bytes are not accessible

• Used as memory pointers


– Example: MOV AH, [SI]
• Move the byte stored in memory location whose address is contained in
register SI to register AH

• IP is not under direct control of the programmer


7
Flag Register

Overflow Carry
Direction Parity

Interrupt enable Auxiliary Carry


Trap Zero
6 are status flags
Sign
3 are control flag
8
8086 Programmer’s Model
ES Extra Segment
CS Code Segment
BIU registers
(20 bit adder) 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

9
The Stack
• The stack is used for temporary storage of information
such as data or addresses.

• When a CALL is executed, the 8086 automatically PUSHes


the current value of CS and IP onto the stack.

• Other registers can also be pushed

• Before return from the subroutine, POP instructions can


be used to pop values back from the stack into the
corresponding registers.

10
The Stack

11

You might also like