Addressing modes
Addressing modes
and Assembly
Language
7-Addressing Modes
Outline
• Immediate
• Register
• Direct
• Indirect / Register indirect
• Base Address
• Indexed
• Base Indexed
• Implied
Immediate Addressing
• The simplest form of addressing is immediate addressing, in which the operand value is present in
the instruction
• This mode can be used to define and use constants or set initial values of variables. Typically, the
number will be stored in twos complement form; the leftmost bit of the operand field is used as a
sign bit. When the operand is loaded into a data register, the sign bit is extended to the left to the
full data word size.
• In some cases, the immediate binary value is interpreted as an unsigned nonnegative
• integer.
• The advantage of immediate addressing is that no memory reference other than the instruction
fetch is required to obtain the operand, thus saving one memory or cache cycle in the instruction
cycle.
• The disadvantage is that the size of the number is restricted to the size of the address field, which,
in most instruction sets, is small compared with the word length.
• Operand = A
Direct Addressing
Offset=
4321
To calculate physical
address
PA=DS* 10H +Offset PA=DS* 10H +Offset
Memory Indirect Addressing Mode
• In this offset is given in either BX, SI or DI
• Default segment is DS or ES
• MOV AL,[SI]
Example
MOV DL,[SI]
EA=1002
Example
MOV CH,[BX+SI]
EA=5321
Example
MOV CX,[BX+SI+04H]
PA=DS* 10H +[BX+SI+04H]
Implied Addressing Mode
• Operands are implied or not specified in instruction.
• STC Set(ST) Carry(C) makes 0 1
• CLD Clear(CL) Direction(D) makes 1 0