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:
- Mode field — specifies the addressing mode, i.e. the rule for interpreting the operand field.
- Opcode field — specifies the operation (
ADDin the example). - Operand (address) field — the number X whose meaning is fixed by the mode field.
Interpretation procedure:
- Decode the opcode → operation is ADD.
- Decode the mode field → decide which of the four interpretations of X applies.
- Using that interpretation, fetch/obtain the operand.
- Execute the operation (ADD) with the operand.
Drawing the diagram…
Worked examples
Instruction ADD X, shown in binary and split into fields:
| Field | Contents | Meaning |
|---|---|---|
| Mode | mode bits | how to interpret X |
| Opcode | code for ADD | operation = addition |
| Operand | X | number interpreted according to the mode |
The four possible interpretations of the same X, selected by the mode field:
| Interpretation of X | Where the operand comes from |
|---|---|
| X is the operand itself | operand = X (immediate) |
| X is a register number | operand = contents of register X |
| X is a register number holding an address | operand = memory[contents of register X] |
| X is an address | operand = 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 Xwith 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