Books to be Referred:
1. Microprocessors and Interfacing 2nd Edition, Douglas V Hall
2. 80X86 Programming K. R. Venugopal
Addressing mode refers to the mechanism by which the operands are specified
for an operation. Depending on the type of operands used, there are 7 addressing
modes available.
1. Immediate Mode:
In this mode, the instruction contains 8-bit or 16-bit immediate data along with
the mnemonic. Data can be moved to 8-bit or 16-bit register, or memory location using
the address or register.
Instruction
Operand (8-
bit or 16-bit)
Ex: MOV AX, 1234 h, AND AL, 3FH, MOV DX, 0ABCDH
MOV [2000h], 25 MOV AL, 3373 (invalid), MOV DS, 1234 (invalid)
Note: a) Any data must start with a decimal digit (0 to 9). Hex digits A to F are treated
as characters. So, Hex nos must be prefixed with a Zero. (Ex: MOV CL, 0A2H)
b) Immediate data cannot be copied into Segment registers.
c) Size of the data (byte or word) must match the size of registers (8-bit or 16-bit)
2. Register Mode:
In this mode, the operands are available in general purpose registers. Instruction
specifies the register name.
Instruction Register
Register Operand
Memory Operands:
3. Direct Mode:
Here, the instruction contains 16-bit offset (Effective address) (EA) of the memory
location.
The Physical Address (PA) is calculated by 8086 using EA and Segment Register; and
then the operand will be fetched from memory. Default register is DS.
PA = EA + (DS * 10H)
Ex: MOV BL, NUM ; MOV [3455H], AL ; MOV CX, ES: 20h, MOV NUM2, CX
4. Indirect Modes
8086 provides many indirect addressing modes (where one operand is in
memory) which are extensively used in programming.
a) Register Indirect Mode:
In this mode, the instruction contains a 16-bit register name which contains the
EA. Using this EA, PA is calculated. Default segment register for memory is DS. Only
BX, SI and DI register can be used to hold the EA.
Instruction Memory (PA)
Register
Register EA of
SI, DI or BX Operand
operand
Ex: MOV AL, BYTE PTR [BX] ; INC WORD PTR [DI], MOV [BX], [SI] (invalid)
MUL BYTE PTR [SI] ; AND CX, WORD PTR [BX], MOV BYTE PTR [BX], 50h
ADD CX, [AX] (invalid)
Addres
s
Ex: MOV AL, BYTE PTR 50 [BX] ; DEC WORD PTR [DI+30]
MOV 100H WORD PTR [BX], 1224H ; MOV CX, -22H [SI]
Index Register
EA = Offset / index
Ex: MOV [BX] [SI], 1234H, SUB AL, BYTE PTR [BX][DI]
Operand
Offset / index
EA
Base address
Ex: MOV 50h [BX] [SI] , 1234H MOV -30H [BP] [SI], DX