Indirect Addressing Mode: Effective Address Calculation
Indirect address mode is a form of addressing mode in which the instruction first obtains an address (a pointer) and then uses that pointer to locate the actual operand in memory.
A useful way to reason about this is to distinguish two steps:
- Compute a pointer address (often just the contents of a register or a computed memory location).
- Dereference that pointer by performing a second memory access to obtain the effective address of the data.
In notation often used in computer architecture texts, the indirect addressing effective address can be described as:
- If the pointer is stored in memory at address , then .
- If the pointer is stored in a register , then .
The core intuition: the register or intermediate memory location does not directly point to the data; it points to another location that ultimately contains the data or its address. (This yields an extra memory reference relative to direct addressing.)
To visualize the dereference, consider this generic indirect flow:
Key terms you’ll see: effective address (EA), dereference, pointer, memory reference.
Indirect Addressing Mode Explained (Pointer/Dereference Intuition)
Effective Address (EA) formulas for common indirect forms
Indirect addressing appears in multiple syntactic/ISA flavors, but the effective-address principle is consistent: is obtained by one dereference of a pointer value.
Below are the most common patterns used in architecture and assembly-logic explanations:
1) Register Indirect
- Pointer comes from a register:
- Here, holds a pointer (an address), and indirect addressing dereferences it once to get the final data location.
2) Memory Indirect
- Pointer comes from a memory location:
- Here, is an address where a pointer is stored; you dereference that memory cell to retrieve another address, and then (conceptually) that retrieved address is used as the effective address.
3) Indirect with displacement / indexed variants
Some instruction sets combine indirect concepts with an added displacement or index before dereferencing:
- Pointer address first: (or other base/index expression)
- Then:
So even when there’s an arithmetic step, indirect addressing still has the same hallmark:
The instruction performs (at least) one extra memory access to follow the pointer.
Mental model
Think “operand = pointer”. Indirect addressing uses the operand as a pointer (address), then dereferences it to reach the true data location.
Common confusion: what’s stored where?
In indirect mode, the register (or first memory cell) usually stores an address, not the data itself. The data lives at the address contained in that pointer.
Calculating Effective Address (EA) in Indirect Addressing
- 1Step 1
Determine whether the pointer is taken from a register (e.g., ) or from a memory address (e.g., ).
- 2Step 2
If the ISA uses base/index/displacement, compute the intermediate address (example pattern: ).
- 3Step 3
Read memory to obtain the pointer value and set using the indirect rule (common patterns: if pointer in register then ; if pointer in memory then ).
- 4Step 4
Finally, read or write the actual data at address .
Worked example: Register indirect
Assume:
- Register
- Memory contents:
- Then indirect addressing implies:
- Pointer value is
- Effective address is
- The operand is located at
This can be summarized as:
Worked example: Memory indirect
Assume:
- Intermediate address
- Pointer stored at that memory address:
- Then: and the operand is found at .
Why it matters (performance implications)
Because indirect addressing typically requires an extra memory reference (dereference), it can increase latency relative to modes that access data directly. In a simple pipeline/memory model, this can add a dependency chain:
- EA depends on the pointer load
- operand depends on EA So the CPU may need to wait for the first memory read before it can complete the second. This is closely related to the concept of memory access latency, data dependency, and pointer chasing.
Indirect Addressing Lifecycle (Conceptual)
Read the operand form
1. Operand InterpretationDetermine whether the operand denotes a register-held pointer or a memory-held pointer."
Form the pointer location (if base/index/displacement exists)
2. Compute Intermediate AddressCompute intermediate address such that the pointer is stored at (or taken from )."
Fetch the pointer value
3. DereferencePerform dereference: read (or dereference register value) to obtain ."
Use EA to access operand
4. Data AccessRead/write the operand at the final effective address ."
Summary table: indirect vs direct (EA rule focus)
| Mode | Where the pointer/data comes from | Typical EA rule |
|---|---|---|
| Direct addressing | Operand points directly to data | (or depending on syntax) |
| Indirect addressing | Operand provides a pointer to a location containing the real address | (or ) |
| Indirect (memory-held pointer) | Pointer stored in memory at intermediate address | (conceptual chaining) |
Key FAQs
Knowledge Check
In register indirect addressing, which expression most accurately represents the effective address (EA)?