Microprocessor vs Microcontroller
The way in whic operands are specified in an assembly language instruction is called its addressing mode.
Following are the addressing modes in 8086:
- Register Addressing
- Immediate Addressing
- Direct Addressing
- Register Indirect Addressing
- Register Relative Addressing
- Based Indexed mode
- Relative Base Addressing Mode
In this mode, both source and destination are registers.
MOV AL, AH
MOV SI, BX
In this mode, data is in instruction itself.
MOV AL, 59H ;59H will be copied to AL.
MOV AX, 2569H
In this mode, either the source or the destination will be a memory address.
MOV [3458H], AL ;move the byte to location 3458H
MOV AX, [2569H]
Register Indirect Addressing
In this mode, the address of the data is in a register.
MOV [SI], AL ;move the content of AL to location pointed by SI
MOV AL, [BX]
Register Relative Addressing
In this mode, a displacement is added to get an effective address.
MOV CL, 10[BX]
move the content of the address specified by adding the content of BX and 10.
It can be written in different forms
MOV CL, [BX+10]
MOV CL, [BX]+10
MOV CL, [BX]
Based Indexed Mode
In this mode, an index register and a base register together carry the effective address.
MOV AL, [BX][SI]
move the content of the address pointed by [BX] and [SI] into AL
Relative Based Indexed Mode
In this mode, an index register, a base register and a displacement together carry the effective address.
MOV DL, 5[BX][DI]