Addressing Modes
Addressing Modes
• 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.
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
500 800
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 1. Immediate Addressing Mode
201 Address = 500
R1 400 • As instruction contains immediate number 500.
202 Next Instruction
• It is stored as address 201.
XR 100
399 450
AC 400 700 Effective Address = 201
Operand = 500
500 800
AC 500
600 900
702 325
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 2. Register Addressing Mode
201 Address = 500
R1 400 • Register R1 contains 400.
202 Next Instruction
• As operand is in register so no any memory location.
XR 100
399 450
AC 400 700 Effective Address = Nil
Operand = 400
500 800
AC 400
600 900
702 325
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 3. Register Indirect Addressing Mode
201 Address = 500
R1 400 • Register R1 contains 400.
202 Next Instruction
• So effective address of operand is 400.
XR 100 • The data stored at 400 is 700.
399 450
AC 400 700
Effective Address = 400
500 800
Operand = 700
AC 700
600 900
702 325
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 4. Direct Addressing Mode
201 Address = 500
R1 400 • Instruction contains the address 500.
202 Next Instruction
• So effective address of operand is 500.
XR 100 • The data stored at 500 is 800.
399 450
AC 400 700
Effective Address = 500
500 800
Operand = 800
AC 800
600 900
702 325
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 5. Indirect Addressing Mode
201 Address = 500
R1 400 • Instruction contains the address 500.
202 Next Instruction
• Address at 500 is 800.
XR 100 • So effective address of operand is 800.
399 450 • The data stored at 800 is 300.
AC 400 700
600 900
AC 300
702 325
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 6. Relative Addressing Mode
201 Address = 500
R1 400 • PC = 200.
202 Next Instruction
• Offset = 500.
XR 100 • Instruction is of 2 bytes.
399 450 • So effective address = PC + 2 + offset = 200 + 500 +2 =
AC 400 700 702 .
• The data stored at 702 is 325.
500 800
Effective Address = 702
600 900 Operand = 325
702 325
AC 325
800 300
Example problem
Address Memory
PC 200 200 Load to AC Mode 7. Index Addressing Mode
201 Address = 500
R1 400 • XR = 100.
202 Next Instruction
• Base = 500.
XR 100 • So effective address = Base + XR = 500 + 100 = 600 .
399 450 • The data stored at 600 is 900.
AC 400 700
600 900
AC 900
702 325
800 300