Assembly-Guidebook

Addressing Modes of 8086

Register Addressing

In register addressing the instruction will specify the name of the register which holds the data to be operated by the instruction.

MOV CL, DH  ; (CL) <- (DH)
;The content of 8-bit register DH is moved to another 8-bit register CL
MOV BX, DX  ; (BX) <- (DX)

Immediate Addressing

In immediate addressing mode an 8-bit or 16-bit data is specified as part of the instruction.

MOV DL, 08h  ; (DL) <- 08h
MOV AX, 1234h; (AX) <- 1234h

Direct Addressing

In direct addressing an unsigned 16-bit displacement of signed 8-bit displacement will be specified in the instruction. The displacement is the effective address(EA) or offset. The 20 bit physical address of memory is calculated by multiplying the content of DS register by 10H and adding to effective address. In case of 8-bit displacement, the effective address is obtained by sign extending the 8-bit displacement to 16-bit.

MOV DX, [08h]
; Effective address (or offset address), EA = 08h
; Base Address, BA = (DS)*16(base 10)
; Memory Address, MA = BA+EA
; (DX) <- (MA)

The segment base address (BA) is computed by multiplying the content of DS by 16(base 10) The memory address (MA) is computed by adding the effective address (EA) to the segment base address (BA)

Register Indirect Addressing

In register indirect adddressing the name of the register which holds the effective address(EA)will be specified in the instruction This addressing mode allows data to be addressed at any memory location through an offset address held in any of the following registers: BP, BX, DI & SI.

MOV CX, [BX]

This instruction moves a word from the address pointed by BX and BX + 1 in data segment into CL and CH respectively.

CL ← DS: [BX] and CH ← DS: [BX + 1]

Based Addressing Mode

In this addressing mode, the offset address of the operand is given by the sum of contents of the BX/BP registers and 8-bit/16-bit displacement.

MOV DX, [BX+04]
ADD CL, [BX+08]

Indexed Addressing Mode

In this addressing mode, the operands offset address is found by adding the contents of SI or DI register and 8-bit/16-bit displacements.

MOV AX, [AX+DI] 

See Some Programs