0% found this document useful (0 votes)
3 views24 pages

Addressing Modes

The document outlines various addressing modes used in computer architecture, including Implied, Stack, Immediate, Direct, Indirect, Register Direct, Register Indirect, Relative, and Indexed Addressing Modes. It provides detailed explanations and examples of how effective addresses are calculated using these modes, particularly focusing on Relative and Indexed Addressing Modes. Additionally, it presents example problems demonstrating the effective address and operand values for different addressing modes.

Uploaded by

animatedguy06
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views24 pages

Addressing Modes

The document outlines various addressing modes used in computer architecture, including Implied, Stack, Immediate, Direct, Indirect, Register Direct, Register Indirect, Relative, and Indexed Addressing Modes. It provides detailed explanations and examples of how effective addresses are calculated using these modes, particularly focusing on Relative and Indexed Addressing Modes. Additionally, it presents example problems demonstrating the effective address and operand values for different addressing modes.

Uploaded by

animatedguy06
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Addressing Modes

• Different ways of specifying the location of an operand in


an instruction are called as addressing modes:
Implied AddrEssing Mode
Stack Addressing Mode
Immediate Addressing Mode
Direct Addressing Mode
INDirect Addressing Mode
INDirect Addressing Mode
Register direct addressing mode
Register indirect addressing mode
Relative Addressing Mode
• In relative addressing mode, contents of Program Counter PC is
added to address part of instruction to obtain effective address.

• The address part of the instruction is called as offset and it can +ve
or –ve.

• When the offset is added to the PC the resultant number is the


memory location where the operand will be placed.
Relative Addressing Mode

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

Effective address of operand = PC + 01 + offset


Effective address of operand = 2801 + 01 + 04
Effective address of operand = 2806h
Relative Addressing Mode

2807 22 2807 22 Actual Operand


2806 FF 2806 FF
Offset = 03h
2805 6D 2805 6D
2804 59 2804 59
PC 2803 2803 08 2803 08
2802 2E 2802 2E
2801 F3 2801 F3
2800 9F 2800 9F

Effective address of operand = PC + 01 + offset


Effective address of operand = 2803 + 01 + 03
Effective address of operand = 2807h
Indexed Addressing Mode
• In index addressing mode, contents of Index register is added to
address part of instruction to obtain effective address.

• The address part of instruction holds the beginning/base address and is


called as base.

• The index register hold the index value, which is +ve.

• Base remains same, the index changes.

• 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

IX 0000 IX 0001 IX 0002 IX 0003


2800h + 0000h = 2800h 2800h + 0001h = 2801h 2800h + 0002h = 2802h 2800h + 0003h = 2803h
Indexed Addressing Mode
Base = 2802h
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

IX 0000 IX 0001 IX 0002 IX 0003


2802h + 0000h = 2802h 2802h + 0001h = 2803h 2802h + 0002h = 2804h 2802h + 0003h = 2805h
Example problem
Address Memory
PC 200 200 Load to AC Mode PC = Program Counter
201 Address = 500
R1 = Register
R1 400 XR = Index Register
202 Next Instruction
AC = Accumulator
XR 100
399 450 • Memory is having first instruction to load AC
AC 400 700 • Mode will specify the addressing mode to get operand.
• Address field of instruction is 500.

500 800

600 900 Find out the effective address of operand and


operand value by considering different
702 325 addressing modes.

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

Effective Address = 800


500 800
Operand = 300

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

Effective Address = 600


500 800
Operand = 900

600 900
AC 900

702 325

800 300

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy