Chapter 1.2_Addressing Modes_slides
Chapter 1.2_Addressing Modes_slides
Addressing modes help us to understand the types of operands and the way they are
accessed while executing an instruction.
Types of addressing mode in 8086
1. Immediate addressing mode
2. Direct addressing mode
3. Register addressing mode
4. Register Indirect addressing mode
5. Indexed addressing mode
6. Register relative addressing mode
7. Base plus index addressing mode
8. Base relative plus index addressing mode
Immediate addressing mode
• In this type of mode, immediate data is part of instruction and appears in the form of
successive byte or bytes:
Immediate addressing mode
• In this type of mode, immediate data is part of instruction and appears in the form of
successive byte or bytes:
• Examples
• MOV AL,50H ; Move data 50H to AL
• MOV BX,23A0H ; Move data 23A0H to BX
Register addressing mode
• In this type of addressing mode, the data is stored in the register and it can be a
8-bit or 16-bit register. All the registers, except IP, may be used in this mode.
10 AB BX
MOV AL,BLH BH BL
MOV AX,BXH FF 33 AX
AH AL
Register addressing mode
• Ex:
• MOV CL, DL Contents of DL moves to CL
• MOV AX, CX Contents of CX moves to AX
Direct addressing mode
• In this mode, the 16 bit offset address of the data within the segment is directly
given in the instruction.
• Now, data is stored in some memory location.
• The [ ] is the address. Memory
22 5000
33 5001
MOV AX,[5000H] 5002
AX
Direct addressing mode
• Ex:
• MOV CL, [2000H]; CL== contents of address 2000H in Data Segment.
• Assume DS=5000H; then Phy. Addr 50000 +2000=52000H
• Then, CL will get contents of 52000H; OR CL [52000H]
50 00 BX
Register Indirect addressing mode
• Here, any of 2 base registers (BP for SS or BX for DS) or any two index
registers (SI or DI) tare used to provide the offset address for the data byre.
• In this addressing mode, offset of the operand is stored in one of the index registers.
DS is the default segment for index register SI and DI.
Memory
22 5000
AX
33 5001
MOV AX,[SI] 5002
50 00 SI
Register relative addressing mode
• In this mode, 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 (either DS or ES) segment.
Memory
44 5051
AX
33 5052
50 00 + 51H = 5051H
Final
Index
BX Offset Address
Register relative addressing mode
• Here the operand address is calculated using one of the base register and a
displacement (8/16 bit).
• MOV CL, [BX+4]
• moves a byte from address pointed by BX+4 in DS to CL.
• Phy. Addrs: DS*10H + BX+4
• MOV 12H[BP], CL
• moves a byte from CL to a location in stack segment pointed by BP+12H
• Phy Addrs SS*10H + BP+12H
Base plus index addressing mode
• In this mode the effective address is formed by adding content of a base register
(any one of BX or BP) to the content of an index register (SI or DI). Default segment
register DS.
12 3000
AX
MOV AX, [BX] [SI] 34 3001
3002
10 00 + 20 00 = 3000H
Final
BX SI Index
Address
Base plus index addressing mode
• EX:
• MOV CL, [BX+SI]; CL from DS : content of the address formed by adding
BX+SI
• Here, if we want to access a sub-array as pointed by SI, keep changing (
increment/decrement) SI DS
BX
SI
Base plus index addressing mode
• EX:
• MOV CL, [BP+SI]; CL from SS : content of the address formed by adding
BP+SI
• Here, if we want to access a sub-array as pointed by SI, keep changing (
increment/decrement) SI SS
BP
• Similarly, MOV CL, [BP+DI]; also from SS.
SI
Base relative plus index addressing mode
• In the effective address is formed by adding an 8 or 16-bit displacement with sum of
contents of any one of the base registers (BX or BP) and any one of the index
registers, in a default segment.
12 3050
MOV AX,50H[BX][SI] AX
34 3051
3052
50H + 10 00 20 00 = 3050H
Final
BX SI Index
Address
Base relative plus index addressing mode
• Here address of the operand is calculated by Base register (of default
segment) + Index + offset from that address get the content.