0% found this document useful (0 votes)
4 views

Chapter 1.2_Addressing Modes_slides

The document discusses the importance of addressing modes in understanding how operands are accessed during instruction execution, specifically in the context of the 8086 microprocessor. It outlines various addressing modes including immediate, direct, register, register indirect, indexed, register relative, base plus index, and base relative plus index modes, providing examples for each. Each mode has its unique method of accessing data, which is crucial for efficient programming and memory management.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter 1.2_Addressing Modes_slides

The document discusses the importance of addressing modes in understanding how operands are accessed during instruction execution, specifically in the context of the 8086 microprocessor. It outlines various addressing modes including immediate, direct, register, register indirect, indexed, register relative, base plus index, and base relative plus index modes, providing examples for each. Each mode has its unique method of accessing data, which is crucial for efficient programming and memory management.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Why study addressing modes?

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]

• MOV CX, [2000H] ; CL & CH gets content of 2000H and 2001H,


respectively. (ofcourse in the DS) and it follows little Endian.

• MOV [2001H], CL; contents of CL will be stored in mem. Location 2001H


Register Indirect addressing mode
• The address of the memory location which contains data or operand is determined in a
indirect way, using the offset register.
• Highly useful when we transfer data from a range of continuous addresses.
Memory
22 5000
AX
33 5001

MOV AX,[BX] 5002

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.

• MOV CL, [BX]; moves a byte from address pointed by BX in DS into CL


register.
• Phy. Addrs== DS*10H + BX

• MOV [BP], CL; moves content of CL to a location pointed by BP in SS.


• Phy. Addrs== SS*10H + BP
Indexed addressing mode

• 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

MOV AX, [BX+51H] 5053

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.

• MOV CL, [BX+DI+20]; Moves a byte from the address BX+DI+20 in DS


• Phy. Addrs= DS*10 + BX + SI+ 20H

• MOV [BP+SI+2000], CL  content from SS pointed by BP+ SI+ 2000H

You might also like