VOOZH about

URL: https://www.geeksforgeeks.org/computer-organization-architecture/difference-between-direct-and-indirect-addressing-modes/

โ‡ฑ Direct and Indirect Addressing Modes - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Direct and Indirect Addressing Modes

Last Updated : 23 Oct, 2025

In computer programming, addressing modes help the CPU find data in memory. Two common types are direct addressing and indirect addressing.

  • Direct addressing gives the exact location of the data, making it quick and easy to access.
  • Indirect addressing, on the other hand, uses a pointer to find the data, offering more flexibility but requiring an extra step.

Direct Addressing Mode

In direct addressing mode, the instruction contains the exact memory address of the operand. The CPU directly accesses this address to retrieve or store data without any extra lookup.

  • The address field gives the effective address directly.
  • It is fast and simple since no intermediate memory access is needed.
๐Ÿ‘ direct_addressing_mode_lda_2050h_

Example: Add the content of R1 and 1001 and store back to R1.

Add R1, (1001)

Here 1001 is the address where the operand is stored. 

Indirect Addressing Mode

In indirect addressing mode, the instruction gives an address that points to another location containing the actual operandโ€™s address. The CPU first accesses the pointer and then the real data, making it more flexible but slower than direct addressing.

  • The address field holds a pointer to the effective address.
  • It requires two memory accesses and allows easier data management.
๐Ÿ‘ indirect_addressing_mode_mov_a_2050h_

Example: Load the content of the memory location stored at memory location 1500 to register R1.

LOAD R1, @1500

Here, effective address is stored at memory location 1500. 

Difference Between Direct and Indirect Addressing Modes

Following is a comparison between both addressing modes:

Direct AddressingIndirect Addressing
Contains the effective address directly.Contains the address of a location holding the effective address.
One memory access.Two memory accesses.
Faster.Slower.
No subtypes.Memory Indirect and Register Indirect.
No extra calculation.Extra calculation required.
Smaller address space.Larger address space.
No additional overhead.More overhead.
Simple and fast.Flexible and allows larger addressing.
Limited address space.Slower due to extra steps.
Accessing static data and variables.Pointers and passing arrays.
Less flexible (fixed addressing).More flexible (dynamic addressing).
Less code, simple.More code, more complex.
Comment

Explore