Addressing Mode
Addressing Mode
MODES
• Microprocessor executes the instructions stored in memory (RAM).
• It executes one instruction at a time.
• Each of the instruction contains operations and operands.
• Operation specifies the type of action to be performed.
• For example: ADD, SUB, MOV, INC, LOAD, STORE
• Operands are the data on which the operation is to be performed.
B
ADDRESSING
MODES
• Operand can be place either in one of the processor register or in
memory.
Add Immediate
ADI 3Eh A ← A + 3Eh Here 3Eh is the immediate operand
2. REGISTER
ADDRESSING MODE
• The operand is specified with in one of the processor register.
• Instruction specifies the register in which the operand is stored.
Move
MOV C , A C←A Here A is the operand specified in register
Add
ADD B A← A+B Here B is the operand specified in register
3. REGISTER INDIRECT
ADDRESSING MODE
• The instruction specifies the register in which the memory
address of operand is placed.
• It do not specify the operand itself but its location with in the
memory where operand is placed.
Move
MOV A , M A ← [[H][L]]
Before
After
2807 A A9 2807
2806 2806
H
A 28 2805 A9 H 28 2805 A9
2804 2804
L 05 2803
L 05 2803
2802 2802
2801 2801
A ← [2805] A ← A9
2800 2800
4. DIRECT ADDRESSING
MODE
• The instruction specifies the direct address of the operand.
• The memory address is specified where the actual operand is.
Load Accumulator
LDA 2805h A ← [2805]
It loads the data from memory location 2805 to A.
Store Accumulator
STA 2803h [2803] ← A
It stores the data from A to memory location 2803.
5. INDIRECT
ADDRESSING MODE
• The instruction specifies the indirect address where the effective
address of the operand is placed.
• The memory address is specified where the actual address of
operand is placed.
Move
MOV A, 2802h A ← [[2802]]
It moves the data from memory location specified by the location 2802 to A.
6. IMPLIED ADDRESSING
MODE
• It is also called inherent addressing mode.
• The operand is implied by the instruction.
• The operand is hidden/fixed inside the instruction.
• The address part of the instruction is called as offset and it can +ve
or –ve.
2807 22 2807 22
2806 FF 2806 FF Actual Operand
Offset = 04h 2805 6D 2805 6D
2804 59 2804 59
PC 2801 2803 08 2803 08
2802 2E 2802 2E
2801 F3 2801 F3
2800 9F 2800 9F
• When the base is added to the index register the resultant number is
the memory location where the operand will be placed.
8. INDEXED ADDRESSING
MODE
Base = 2800h
Effective address of operand = Base + IX
2807 22 2807 22 2807 22 2807 22
2806 FF 2806 FF 2806 FF 2806 FF
2805 6D 2805 6D 2805 6D 2805 6D
2804 59 2804 59 2804 59 2804 59
2803 08 2803 08 2803 08 2803 08
2802 2E 2802 2E 2802 2E 2802 2E
2801 F3 2801 F3 2801 F3 2801 F3
2800 9F 2800 9F 2800 9F 2800 9F
• It is similar to the indexed addressing mode except the register now is called as base
instead of index.
• When the offset is added to the base register the resultant number is the memory
location where the operand will be placed.
9. BASE REGISTER
ADDRESSING MODE
Offset= 0001h
Effective address of operand = Base Register + offset
2807 22 2807 22 2807 22 2807 22
2806 FF 2806 FF 2806 FF 2806 FF
2805 6D 2805 6D 2805 6D 2805 6D
2804 59 2804 59 2804 59 2804 59
2803 08 2803 08 2803 08 2803 08
2802 2E 2802 2E 2802 2E 2802 2E
2801 F3 2801 F3 2801 F3 2801 F3
2800 9F 2800 9F 2800 9F 2800 9F
2800h + 0001h = 2801h 2801h + 0001h = 2802h 2802h + 0001h = 2803h 2803h + 0001h = 2804h
10. AUTOINCREMENT OR AUTODECREMENT
ADDRESSING MODE
• It is similar to register indirect addressing mode.
At start: HL 2802