1. Gyanastra
  2. Computer Organisation and Architecture
  3. Addressing Modes
  4. Addressing Mode Field and Interpreting the Operand
Free lesson, no account needed 4 min read 7 practice questions after it
Asked in past papers4 times
  • GATE CSE20231994
  • UGC NET20172013

Computer Organisation and Architecture · Addressing Modes

Addressing Mode Field and Interpreting the Operand

Overview

An instruction such as ADD X carries an operand field holding a number X, but that number is ambiguous on its own. The addressing mode field tells the CPU how to interpret X and therefore how to obtain the effective operand.

Key concepts

  • Addressing mode: the field that tells the CPU how to interpret the operand field, i.e. how to obtain the effective operand from X.
  • Mode field: specifies the addressing mode, the rule for interpreting the operand field.
  • Opcode field: specifies the operation; in the example the opcode is ADD.
  • Operand (address) field: the number X whose meaning is fixed by the mode field.
  • Single-address instruction: an instruction with only one operand field (one-address format).
    In an accumulator-based organization the other implicit operand is the accumulator; the accumulator is the implied second operand and destination.
  • The same number X can mean a constant, a register number, a register holding an address, or a memory address — the mode decides which.

How it works

The binary (1s and 0s) form of the instruction is divided into parts:

  1. Mode field — specifies the addressing mode, i.e. the rule for interpreting the operand field.
  2. Opcode field — specifies the operation (ADD in the example).
  3. Operand (address) field — the number X whose meaning is fixed by the mode field.

Interpretation procedure:

  1. Decode the opcode → operation is ADD.
  2. Decode the mode field → decide which of the four interpretations of X applies.
  3. Using that interpretation, fetch/obtain the operand.
  4. Execute the operation (ADD) with the operand.
Figure. The mode field alone decides how X is read, giving four different operand sources. The opcode fixes the operation as ADD, and the accumulator is the implied second operand and destination.

Worked examples

Instruction ADD X, shown in binary and split into fields:

FieldContentsMeaning
Modemode bitshow to interpret X
Opcodecode for ADDoperation = addition
OperandXnumber interpreted according to the mode

The four possible interpretations of the same X, selected by the mode field:

Interpretation of XWhere the operand comes from
X is the operand itselfoperand = X (immediate)
X is a register numberoperand = contents of register X
X is a register number holding an addressoperand = memory[contents of register X]
X is an addressoperand = memory[X]

Revision summary

  • The operand field alone does not say what the operand is; the addressing mode field supplies the interpretation.
  • A binary instruction is partitioned into mode | opcode | operand fields.
  • ADD X with one operand field is a single-address instruction.
  • In an accumulator-based organization the accumulator is the implied second operand and destination.
  • The same X can be a constant, a register number, a register holding an address, or a memory address — only the mode decides which.

Previous-year exam insights

  • Effective address (EA) is the actual address of the operand that the CPU computes from the operand field according to the addressing mode; the operand field value is not necessarily the EA.
    Asked inGATE 2023UGC NET 2013
  • Standard addressing modes to memorise: immediate (operand = value in instruction, no memory access), direct/absolute (EA = address field), indirect (EA = memory[address field]), register (operand = register contents), register indirect (EA = register contents), indexed (EA = index register + address field), base-register (EA = base register + address field), relative/PC-relative (EA = PC + address field), autoincrement/autodecrement (register contents changed after/before use), stack (operand on top of stack).
    Asked inUGC NET 2013
  • Immediate addressing needs no memory reference to fetch the operand (operand is part of the instruction), so it is the fastest for obtaining the operand; direct addressing needs one memory access, indirect needs two or more.
    Asked inUGC NET 2013
  • In indexed addressing the effective address is the sum of the contents of an index register and the address field; this is the standard mode used to access array elements a[i] in a loop, where the index register holds the loop index scaled by element size.
    Asked inGATE 2023
  • In a byte-addressable memory, the address of element a[i] of an array whose base address is B and whose elements are k bytes is B + i*k; consecutive elements differ by k in address.
    Asked inGATE 2023
  • Autoincrement and autodecrement are legitimate addressing modes (register-update modes), so they must not be mistaken for non-modes; 'relative indexed' is not a standard single mode name, whereas immediate operand, register indirect and autoincrement are standard.
    Asked inUGC NET 2013
Pages 1–2 of 2