Sei sulla pagina 1di 27

8086 Microprocessor

MD Singh EIED
Architecture block diagram
BIU and EU
Bus Interface Unit
BIU
EU
Flag Register
D15 D0
Effective Addressing
Addressing Modes
Immediate
Direct
Indirect
Register
Register Indirect
Displacement (Indexed)
Stack
Immediate Addressing Diagram
Operand Opcode
Instruction
Example: MOV AX, 0005H
In the above example, 0005H is the immediate data. The immediate data
may be 8-bit or 16-bit in size


MOV AX, 34H

AL = 34H
AH = 00H
Direct Addressing Diagram
Address A Opcode
Instruction
Memory
Operand
Example: MOV AX, [5000H]

Here, data resides in a memory location in the data
segment, whose effective address may be computed
using 5000H as the offset address and content of DS
as segment address.

The effective address, here, is 10H*DS+5000H.

Register Addressing (1)
Operand is held in register named in address
filed
EA = R
Limited number of registers
Very small address field needed
Shorter instructions
Faster instruction fetch
Register Addressing (2)
No memory access
Very fast execution
Very limited address space

Register Addressing Diagram
Register Address R Opcode
Instruction
Registers
Operand
MOV BX, AX.
Register Indirect Addressing
EA = (R)
Operand is in memory cell pointed to by
contents of register R
One fewer memory access than indirect
addressing
Example: MOV AX, [BX]
Here, data is present in a memory location in
DS whose offset address is in BX. The effective
address of the data is given as 10H*DS+ [BX].

Register Indirect Addressing Diagram
Register Address R Opcode
Instruction
Memory
Operand Pointer to Operand
Registers
MOV AX, [BX]
Displacement Addressing
EA = A + (R)
Address field hold two values
A = base value
R = register that holds displacement
or vice versa

Displacement Addressing Diagram
Register R Opcode
Instruction
Memory
Operand
Pointer to Operand
Registers
Address A
+
Relative Addressing
A version of displacement addressing
R = Program counter, PC
EA = A + (PC)
i.e. get operand from A cells from current
location pointed to by PC
c.f locality of reference & cache usage

Register Relative
Example: MOV AX, 50H [BX]
Effective address is given as 10H*DS+50H+ [BX].

The data is available at an effective address
formed by adding an 8-bit or 16-bit
displacement with the content of any one of
the registers BX, BP, SI and DI in the default
segment (DS or ES) .

Base-Register Addressing
The effective address of data is formed, by
adding content of a base register (any one of
BX or BP) to the content of an index register
(any one of SI or DI).
The default segment register may be ES or DS.
Example: MOV AX, [BX] [SI]
Here, BX is the base register and SI is the index
register. The effective address is computed as
10H*DS+ [BX] + [SI].

Also called Based Indexed
MOV AL, [BX][SI]
MOV AL, [BX][DI]
MOV AL, [BP][SI]
MOV AL, [BP][DI]
Relative Based Indexed
Example: MOV AX, 50H [BX] [SI]
Here, 50H is an immediate displacement, BX is
a base register and SI is an index register. The
effective address of data is computed as
10H*DS+ [BX] + [SI] + 50H.
The effective address is formed by adding an
8-bit or 16-bit displacement with the sum of
contents of any one of the bases registers (BX
or BP) and any one of the index registers, in a
default segment.


MOV AL, DISP[BX][SI]
MOV AL, DISP[BX+DI]
MOV AL, [BP+SI+DISP]
MOV AL, [BP][DI][DISP]
Stack Addressing
Operand is (implicitly) on top of stack
e.g.
ADD Pop top two items from stack
and add

Potrebbero piacerti anche