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

11-Instruction set categories - Addressing modes-25-01-2025 (1)

The document provides an overview of various addressing modes used in computer architecture, including implied, immediate, direct, indirect, and register addressing modes. Each mode is described with examples and their respective advantages and disadvantages. Additionally, it includes problems and assignments related to effective addresses and operand locations for different addressing modes.

Uploaded by

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

11-Instruction set categories - Addressing modes-25-01-2025 (1)

The document provides an overview of various addressing modes used in computer architecture, including implied, immediate, direct, indirect, and register addressing modes. Each mode is described with examples and their respective advantages and disadvantages. Additionally, it includes problems and assignments related to effective addresses and operand locations for different addressing modes.

Uploaded by

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

Module 3

Addressing Modes
Addressing Mode

• The Way the operands are specified in the


instruction

• The operation to be performed is indicated


by the opcode.

• Operands can be in registers, memory or


embedded in the instruction
Addressing Mode -Classification

 Implied Addressing Mode


 Immediate Addressing Mode
 Direct Addressing Mode
 Indirect Addressing Mode
 Register Direct Addressing Mode
 Register Indirect Addressing Mode
 Displacement or Based or Indexed
Addressing Mode
 Relative Addressing Mode
 Auto Increment and Auto Decrement
Addressing Mode
Implied Addressing Mode

• Operand is implied / specified


implicitly in the instruction
• Ex:
• Complementing Accumulator
– Set or Clearing the flag bits (CLC,
STC etc.)
• 0 – address instructions in a stack
organized computer are implied
mode instructions.
• Effective Address (EA) = AC or
Immediate Addressing mode
• Operand embedded in the instruction

• Used during program initialization

Example:- MOVE #100H, R1


• Here the data 100h is moved to R1.
 MVI A, 01
• – MVI stands for Move Immediate.
This basically implies move 01 to A.
Direct Addressing mode

• Address field contains the effective address.

• Effective address ( used to fetch operand


from or a branch to)

• Effective address is a part of the instruction.

• Actual address of the operand


Indirect Addressing Mode
Diagram
Indirect Addressing mode
• The address field of the instruction gives
the address where the effective address
of the operand stored in the memory.
• EA = (A)
• Ex: Move CX, [4200H]
• Advantage: Large address space, may be
nested, multilevel or cascaded
• Disadvantage: Multiple memory accesses
to find the operand, hence slower
Register Addressing Diagram
Register

• Operand is in the register specified


in the address part of the instruction
• EA = R
• Ex: Mov AX, BX
• Special case of direct addressing
Register Indirect
• Address part of the instruction
specifies the register which gives
the address of the operand in
memory
• Special case of indirect addressing
• EA = (R)
• Ex: Mov BX, [DX]
• Advantage: Large address space
• Disadvantage: Extra memory
reference
Auto Increment and Auto
Decrement Addressing Modes

• Extension to Register indirect


addressing mode.
• Useful while transferring large
chunks of contiguous data.
Displacement Addressing Mode
 EA = A + (R)
 Address field holds two values
 A = Base value
 R = register that holds displacement
 Or vice-versa
Relative addressing mode

• It is often used in branch (conditional and


unconditional) instructions, locality of reference
and cache usage.

• Effective address =Address part of the


instruction +PC value

• Advantage: Flexibility
• Disadvantage: Complexity
Base register Addressing mode
• Used to facilitate the relocation of
programs in memory.

• Uses Base register.

• EA = Address part of the instruction +base


value.

• Advantage: Flexibility
• Disadvantage: Complexity
Indexed Addressing mode
• Used in performing iterative operations

• Address field holds the starting address of


the array.

• Index register hold the actual index of the


data in the array

• EA = starting address(address part of an


inst) + index value
Basic Addressing Modes
Differences
Problems
• Find the effective address and the content of AC for
the given data.

V.Saritha, SCSE, VIT University


Addressing Mode Effective Content of AC
Address
Direct Address 500 AC ← (500) 800
Immediate operand 201 AC ← 500 500
Indirect address 800 AC ← ((500)) 300
Relative address 702 AC ← (PC + 500) 325
Indexed address 600 AC ← (XR + 500) 900
Register - AC ← R1 400
Register Indirect 400 AC ← (R1) 700
Autoincrement 400 AC ← (R1)+ 700
Autodecrement 399 AC ← -(R1) 450
Assignment Questions

1. An instruction is stored at location 300 with its address field


at location 301. The address field has the value 400. A processor
register R1 contains the number 200. Evaluate the effective
address if the addressing mode of the instruction is (a) direct; (b)
immediate (c) relative (d) register indirect; (e) index with R1 as the
index register.

2. Let the address stored in the program counter be designated


by the symbol X1. The instruction stored in X1 has the address part
(operand reference) X2. The operand needed to execute the
instruction is stored in the memory word with address X3. An index
register contains the value X4. What is the relationship between
these various quantities if the addressing mode of the instruction is
• (a) direct (b) indirect (c) PC relative (d) indexed?
3. Let the address stored in the program counter be
designated by the symbol X1. The instruction stored in
X1 has the address part (operand reference) X2. The
operand needed to execute the instruction is stored in
the memory word with address X3. An index register
contains the value X4. What is the relationship between
these various quantities if the addressing mode of the
instruction is (a) direct (b) indirect (c) PC relative (d)
indexed?
4. An address field in an instruction contains
decimal value 14. where is the corresponding
operand located for:
– Immediate addressing?
– Direct addressing?
– Indirect addressing?
– Register addressing?
– Register indirect addressing?
References
• W. Stallings, Computer
organization and architecture,
Prentice-Hall,2000
• M. M. Mano, Computer System
Architecture, Prentice-Hall

You might also like