Addressing modes in 8086 microprocessor - GeeksforGeeks

23 Feb, 2022
Prerequisite – Addressing modes, Addressing modes in 8085 microprocessorThe way of specifying data to be operated by an instruction is known as addressing modes. This specifies that the given data is an immediate data or an address. It also specifies whether the given operand is register or register pair.
Types of addressing modes:
Register mode – In this type of addressing mode both the operands are registers.Example:MOV AX, BX
XOR AX, DX
ADD AL, BLImmediate mode – In this type of addressing mode the source operand is a 8 bit or 16 bit data. Destination operand can never be immediate data.Example:MOV AX, 2000
MOV CL, 0A
ADD AL, 45
AND AX, 0000Note that to initialize the value of segment register an register is required.MOV AX, 2000
MOV CS, AX Displacement or direct mode – In this type of addressing mode the effective address is directly given in the instruction as displacement.Example:MOV AX, [DISP]
MOV AX, [0500]Register indirect mode – In this addressing mode the effective address is in SI, DI or BX.Example: Physical Address = Segment Address + Effective AddressMOV AX, [DI]
ADD AL, [BX]
MOV AX, [SI] Based indexed mode – In this the effective address is sum of base register and index register.Base register: BX, BP
Index register: SI, DI The physical memory address is calculated according to the base register.Example:MOV AL, [BP+SI]
MOV AX, [BX+DI]Indexed mode – In this type of addressing mode the effective address is sum of index register and displacement.Example:MOV AX, [SI+2000]
MOV AL, [DI+3000]Based mode – In this the effective address is the sum of base register and displacement.Example:MOV AL, [BP+ 0100]Based indexed displacement mode – In this type of addressing mode the effective address is the sum of index register, base register and displacement.Example:MOV AL, [SI+BP+2000] String mode – This addressing mode is related to string instructions. In this the value of SI and DI are auto incremented and decremented depending upon the value of directional flag.Example:MOVS B
MOVS W Input/Output mode – This addressing mode is related with input output operations.Example:IN A, 45
OUT A, 50 Relative mode –In this the effective address is calculated with reference to instruction pointer.Example:JNZ 8 bit address
IP=IP+8 bit address 
Register mode – In this type of addressing mode both the operands are registers.Example:MOV AX, BX
XOR AX, DX
ADD AL, BL
MOV AX, BX
XOR AX, DX
ADD AL, BL
Immediate mode – In this type of addressing mode the source operand is a 8 bit or 16 bit data. Destination operand can never be immediate data.Example:MOV AX, 2000
MOV CL, 0A
ADD AL, 45
AND AX, 0000Note that to initialize the value of segment register an register is required.MOV AX, 2000
MOV CS, AX 
MOV AX, 2000
MOV CL, 0A
ADD AL, 45
AND AX, 0000
Note that to initialize the value of segment register an register is required.
MOV AX, 2000
MOV CS, AX 
Displacement or direct mode – In this type of addressing mode the effective address is directly given in the instruction as displacement.Example:MOV AX, [DISP]
MOV AX, [0500]
MOV AX, [DISP]
MOV AX, [0500]
Register indirect mode – In this addressing mode the effective address is in SI, DI or BX.Example: Physical Address = Segment Address + Effective AddressMOV AX, [DI]
ADD AL, [BX]
MOV AX, [SI] 
MOV AX, [DI]
ADD AL, [BX]
MOV AX, [SI] 
Based indexed mode – In this the effective address is sum of base register and index register.Base register: BX, BP
Index register: SI, DI The physical memory address is calculated according to the base register.Example:MOV AL, [BP+SI]
MOV AX, [BX+DI]
Base register: BX, BP
Index register: SI, DI 
The physical memory address is calculated according to the base register.Example:
MOV AL, [BP+SI]
MOV AX, [BX+DI]
Indexed mode – In this type of addressing mode the effective address is sum of index register and displacement.Example:MOV AX, [SI+2000]
MOV AL, [DI+3000]
MOV AX, [SI+2000]
MOV AL, [DI+3000]
Based mode – In this the effective address is the sum of base register and displacement.Example:MOV AL, [BP+ 0100]
MOV AL, [BP+ 0100]
Based indexed displacement mode – In this type of addressing mode the effective address is the sum of index register, base register and displacement.Example:MOV AL, [SI+BP+2000] 
MOV AL, [SI+BP+2000] 
String mode – This addressing mode is related to string instructions. In this the value of SI and DI are auto incremented and decremented depending upon the value of directional flag.Example:MOVS B
MOVS W 
MOVS B
MOVS W 
Input/Output mode – This addressing mode is related with input output operations.Example:IN A, 45
OUT A, 50 
IN A, 45
OUT A, 50 
Relative mode –In this the effective address is calculated with reference to instruction pointer.Example:JNZ 8 bit address
IP=IP+8 bit address 
JNZ 8 bit address
IP=IP+8 bit address 
prashantbarge22
microprocessor
system-programming
Computer Organization & Architecture
microprocessor
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Logical and Physical Address in Operating System
Computer Organization and Architecture | Pipelining | Set 1 (Execution, Stages and Throughput)
Memory Hierarchy Design and its Characteristics
Computer Organization | Von Neumann architecture
Computer Organization | RISC and CISC
Interrupts
Difference between Von Neumann and Harvard Architecture
Architecture of 8085 microprocessor
Computer Organization and Architecture | Pipelining | Set 2 (Dependencies and Data Hazard)
Computer Organization | Booth's Algorithm