1 of 17

Addressing modes

Prepared by

S. Rohini

Assistant professor

Department of CS & IT

CPA College

Bodinayakanur

Cardamom Planters’ Association College

(Re-accredited with ‘B’ Grade by NAAC)

Pankajam Nagar, Bodinayakanur – 625513

Department CS & IT

2 of 17

Addressing Modes

  • An instruction contains an operation field, an address field, and a mode field.
  • The operation field indicates what operation is to be performed, for example, addition, subtraction, multiplication, etc.
  • The mode field indicates how the memory address of the operand, which is to be used in an operation, is determined.
  • To understand the various types of addressing modes, it is important to understand how the computer deals with instruction.
  • The instruction cycle of a computer goes through the following three phases:
    • Fetch the instruction from the memory
    • Decode the instruction
    • Execute the instruction

3 of 17

Types of Addressing Modes

Addressing modes refer to the various ways that an operand can be specified within an instruction.

1. Implied / Implicit Addressing Mode

2. Stack addressing mode

3. Immediate Addressing Mode

4. Direct Addressing Mode

5. Indirect Addressing Mode

6. Register Direct Addressing Mode

7. Register Indirect Addressing Mode

8. Relative Addressing Mode

9. Indexed Addressing Mode

10. Base Register Addressing Mode

11. Auto-Increment Addressing Mode

12. Auto-Decrement Addressing Mode

4 of 17

Implied mode

  • In this mode, the instruction contains an indirect definition of the operand. An example of an implied mode instruction is CMA (complement accumulator). Here, the operand (complement) is implicitly specified in the instruction. 

  • Examples-
    • The instruction “Complement Accumulator” is an implied mode instruction (CMA).
    • In a stack organized computer, Zero Address Instructions are implied mode instructions. (since operands are always implied to be present on the top of the stack)

5 of 17

Stack Addressing Mode

  • In this addressing mode, the operand is contained at the top of the stack.
  • 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.

6 of 17

Immediate Addressing Mode

  • The operand is specified with in the instruction.
  • Instead of address field, an operand field is present that contains the operand.

7 of 17

Direct Addressing Mode

  • In this addressing mode, the address field of the instruction contains the effective address of the operand.
  • Only one reference to memory is required to fetch the operand. It is also called as absolute addressing mode.

8 of 17

Indirect Addressing Mode

  • In this addressing mode, the address field of the instruction specifies the address of memory location that contains the effective address of the operand.
  • Two references to memory are required to fetch the operand.

9 of 17

Register Direct Addressing Mode

  • In this addressing mode, the operand is contained in a register set.
  • The address field of the instruction refers to a CPU register that contains the operand.
  • No reference to memory is required to fetch the operand.
  • Example-
    • ADD R will increment the value stored in the accumulator by the content of register R.
    • AC ← AC + [R]
      • 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.

10 of 17

Register Indirect Addressing Mode

  • In this addressing mode, the address field of the instruction refers to a CPU register that contains the effective address of the operand.
  • Only one reference to memory is required to fetch the operand.
  • Example-
    • ADD R will increment the value stored in the accumulator by the content of memory location specified in register R.
    • AC ← AC + [[R]]
      • This addressing mode is similar to indirect addressing mode.
      • The only difference is address field of the instruction refers to a CPU register.

11 of 17

Relative Addressing Mode

  • In this addressing mode, Effective address of the operand is obtained by adding the content of program counter with the address part of the instruction.
  • Effective Address= Content of Program Counter + Address part of the instruction

  • Program counter (PC) always contains the address of the next instruction to be executed.
  • After fetching the address of the instruction, the value of program counter immediately increases.
  • The value increases irrespective of whether the fetched instruction has completely executed or not

12 of 17

Indexed Addressing Mode

  • In this addressing mode, Effective address of the operand is obtained by adding the content of index register with the address part of the instruction.
  • Effective Address = Content of Index Register + Address part of the instruction

13 of 17

Base Register Addressing Mode

  • In this addressing mode, Effective address of the operand is obtained by adding the content of base register with the address part of the instruction.
  • Effective Address = Content of Base Register + Address part of the instruction

14 of 17

Auto-Increment Addressing Mode

  • This addressing mode is a special case of Register Indirect Addressing Mode where
    • Effective Address of the Operand = Content of Register
  • In this addressing mode, After accessing the operand, the content of the register is automatically incremented by step size ‘d’.
  • Step size ‘d’ depends on the size of operand accessed.
  • Only one reference to memory is required to fetch the operand

15 of 17

  •  

16 of 17

Auto-Decrement Addressing Mode

  • This addressing mode is again a special case of Register Indirect Addressing Mode where
  • Effective Address of the Operand = Content of Register – Step Size
  • In this addressing mode,
    • First, the content of the register is decremented by step size ‘d’.
    • Step size ‘d’ depends on the size of operand accessed.
    • After decrementing, the operand is read.
    • Only one reference to memory is required to fetch the operand.

17 of 17

  •