Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

How addressing mode is significant for referring memory ? List and explain different types of addressing modes.

Addressing modes are crucial in computer architecture as they determine how the CPU accesses memory to fetch or store data. They dictate the calculation or mechanism used to compute the effective address, which is the actual location in memory where data is stored or retrieved.

Types of addressing modes :

  1. Immediate Addressing Mode: In this mode, the operand itself contains the data rather than a memory address. It is useful for operations where operands are constants or small immediate values. For example, in the instruction “ADD R1, #5”, the value 5 is directly used as an operand.
  2. Direct Addressing Mode: Also known as absolute addressing, in this mode, the instruction specifies the memory address directly. The CPU accesses the data directly from the specified memory location. For instance, in the instruction “MOV R2, 0x1000”, the data is fetched from memory address 0x1000 and stored in register R2.
  3. Indirect Addressing Mode: In this mode, the operand of the instruction holds a memory address, which in turn contains the actual data. The CPU fetches the operand’s value from the specified memory address and then accesses the data at that address. For example, in the instruction “MOV R3, [R1]”, the value in register R1 is treated as a memory address, and the data at that address is moved to register R3.
  4. Register Addressing Mode: This mode involves specifying one of the CPU’s registers directly as an operand. The data is accessed from or stored into the specified register. For instance, in the instruction “ADD R1, R2”, the contents of registers R1 and R2 are added together.
  5. Indexed Addressing Mode: In this mode, a base address stored in a register is combined with an offset value to form the effective address. It’s commonly used in array operations or accessing elements in data structures. For example, in the instruction “MOV R4, [R3 + 8]”, the value in register R3 is treated as a base address, and 8 is added to it to access a specific memory location.
  6. Relative Addressing Mode: This mode involves specifying an offset or displacement relative to the current instruction pointer or program counter. It’s often used in branch instructions for implementing conditional jumps or loops. For example, in the instruction “JMP 5”, the program counter is incremented by 5 to jump to the specified address.

Leave a Comment