Chapter 3.2 Addresing Modes of i8086
Chapter 3.2 Addresing Modes of i8086
2
Addressing modes and Instruction format in i8086
Addressing modes
Instruction format with addressing modes
Physical address calculation with addressing modes
• In register indirect addressing, the offset address held in any of the following registers.
• The offset address can be either in BX, BP/SP, SI/DI
• The default segment is either DS/ES or SS.
• By default, the Data Segment (in register indirect addressing mode) uses BX, DI, or SI to
address memory.
• If BP addresses memory, the Stack Segment is used by default.
• Pointer registers or an index registers can also be used in this mode to specify the EA.
• The pointer register can be BP/SP or sometimes even base register (BX).
• Index register can be either source index (SI) register or destination index (DI) register.
Example MOV AX, [BX]
• In the above example, the source operand is in register indirect mode.
• Here the data is present in a memory location in DS whose offset address is in BX.
• The Physical address of the data is given as 10H*DS+BX
• In this mode, the effective address(EA) is calculated by adding the displacement and the contents of SI
or DI
Eg; MOV BH, START [SI]
• Moves the 8-bit contents of 20 bit address computed from the displacement (START, SI) and DS into
BH. The displacement (here it is START) is provided by the programmer using the assembler directive
EQU. Indexed addressing mode can be used to access a single table/array. The displacement can be the
starting address of the table/array.
• Then the contents of SI or DI can then be used as an index from the starting address to access a
particular element in the table.
• Consider the following code, with DS=1000H, where START specifies the displacement
START EQU 500H
MOV SI , 05H
MOV AL , START[SI]
MOV SI , 10H
MOV START[SI],AL
• can transfer the contents of array element in 05H into the array element in10H.
• Case :- with CLD instruction. [DF = 0] (automatically increments the contents of SI and DI)
Suppose, DS = 4000H , ES = 2000H
SI = 0500H , DI = 0300H
DS + SI (source) --------- [40500H] = 38H
ES + DI (destination)---- [20300H] = 45H
• Then after the execution of MOVS BYTE, the location [20300H]=38H & SI= 0501H, DI=0301H (auto
incremented), the contents of other registers and memory locations are unchanged