In the context of computer architecture, addressing modes refer to the different ways in which the
operand (data) of an instruction can be specified or accessed. Morris Mano's book, Computer System
Architecture, discusses several addressing modes used in computer systems. Below are 10 addressing
modes with examples based on Mano's descriptions:
1. Immediate Addressing Mode
Definition: The operand is specified directly in the instruction itself.
Example:
MOV A, #5
In this example, the operand is the constant 5, which is immediately available to the instruction.
The value 5 is loaded directly into register A.
2. Register Addressing Mode
Definition: The operand is located in a register, and the register is specified in the instruction.
Example:
MOV A, B
Here, the operand is in register B, and its value is moved to register A.
3. Direct Addressing Mode
Definition: The address of the operand is specified directly in the instruction.
Example:
MOV A, 1000H
In this example, 1000H is the address of the operand. The value at memory location 1000H is
moved to register A.
4. Indirect Addressing Mode
Definition: The instruction specifies a register or memory location that holds the address of the
operand.
Example:
MOV A, @R0
Here, the operand is at the memory location stored in register R0. The value in memory at the
address contained in R0 is loaded into register A.
5. Register Indirect Addressing Mode
Definition: The operand's address is stored in a register, and the instruction uses that register to
access the operand.
Example:
MOV A, (R0)
The operand is at the address specified by register R0. The value in memory at that address is
moved to register A.
6. Indexed Addressing Mode
Definition: The operand's address is determined by adding an index value to a base address,
which is typically stored in a register.
Example:
MOV A, 1000H(R1)
In this case, the operand is located at the address formed by adding the value in register R1 to
the base address 1000H. The value at this computed address is moved to register A.
7. Base Register Addressing Mode
Definition: The operand's address is determined by adding a displacement (constant) to the base
address held in a register.
Example:
MOV A, 5000H(R3)
Here, R3 contains the base address, and 5000H is the displacement. The final address is
computed by adding 5000H to the contents of R3.
8. Relative Addressing Mode
Definition: The operand's address is calculated by adding a constant value (displacement) to the
Program Counter (PC).
Example:
JMP 100H
In this case, the instruction tells the processor to jump to an address that is 100H bytes away
from the current program counter (PC). The jump is relative to the current position.
9. Stack Addressing Mode
Definition: The operand is at the top of the stack, and the stack pointer (SP) is used to access it.
Example:
POP A
This instruction pops the value from the top of the stack (where the stack pointer is pointing)
into register A. After this operation, the stack pointer is updated.
10. Accumulator Addressing Mode
Definition: The operand is implicitly the accumulator (A), and it is used as both the source and
destination for operations.
Example:
ADD B
In this example, the value in register B is added to the accumulator (A), and the result is stored
back in the accumulator.