Types of Addressing Modes
Types of Addressing Modes
Examples-
Example-
ADD
This instruction simply pops out two symbols contained
at the top of the stack.
The addition of those two operands is performed.
The result so obtained after addition is pushed again at
the top of the stack.
Examples-
Example-
Example-
Example-
NOTE-
It is interesting to note-
This addressing mode is similar to direct addressing
mode.
The only difference is address field of the instruction
refers to a CPU register instead of main memory.
NOTE-
It is interesting to note-
This addressing mode is similar to indirect addressing
mode.
The only difference is address field of the instruction
refers to a CPU register.
Effective Address
Effective Address
Effective Address
= Content of Register
Example-
Assume operand size = 2 bytes.
Here,
After fetching the operand 6B, the instruction register
RAUTO will be automatically incremented by 2.
Then, updated value of RAUTO will be 3300 + 2 = 3302.
At memory address 3302, the next operand will be
found.
NOTE-
In auto-increment addressing mode,
First, the operand value is fetched.
Then, the instruction register RAUTO value is
incremented by step size ‘d’.
Example-
Assume operand size = 2 bytes.
Here,
First, the instruction register RAUTO will be decremented
by 2.
Then, updated value of RAUTO will be 3302 – 2 = 3300.
At memory address 3300, the operand will be found.
NOTE-
In auto-decrement addressing mode,
First, the instruction register RAUTO value is
decremented by step size ‘d’.
Then, the operand value is fetched.
Addressing Modes
Last Updated : 14 Feb, 2023
or BP.
o Index: Content of index register SI
or DI.
According to different ways of specifying an
operand by 8086 microprocessor, different
addressing modes are used by 8086.
Addressing modes used by 8086
microprocessor are discussed below:
Implied mode:: In implied addressing the
Example: MOV AL, 35H (move the data 35H into AL register)
R1 = R1 +M[R2]
R2 = R2 + d
R2 = R2-d
R1 = R1 + M[R2]
Auto decrement mode is same as auto
increment mode. Both can also be used to
implement a stack as push and pop . Auto
increment and Auto decrement modes are
useful for implementing “Last-In-First-Out”
data structures.
Direct addressing/ Absolute
Note:
1. PC relative and based register
both addressing modes are suitable
for program relocation at runtime.
2. Based register addressing mode is
best suitable to write position
independent codes.
Advantages of Addressing Modes
6. To give programmers to facilities such
as Pointers, counters for loop controls,
indexing of data and program relocation.
7. To reduce the number bits in the
addressing field of the Instruction.