Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Understanding addressing modes is fundamental to mastering computer architecture because they reveal how the CPU actually locates and retrieves data during instruction execution. You're being tested on the trade-offs between speed, flexibility, and memory efficiency—concepts that appear throughout processor design, from instruction encoding to cache optimization. When an exam asks about performance implications or why certain code patterns exist, addressing modes are often the underlying answer.
Don't just memorize the syntax of each mode. Instead, focus on when and why each mode is optimal: What problem does it solve? What's the cost in clock cycles or instruction size? The best exam answers connect addressing modes to broader concepts like instruction cycle efficiency, data structure implementation, and position-independent code. Master the trade-offs, and you'll handle any FRQ that asks you to analyze or compare instruction formats.
These modes prioritize execution speed by keeping operands in the fastest storage locations—either embedded in the instruction itself or stored in registers. The key principle: fewer memory accesses mean faster execution.
MOV R1, #5)Compare: Immediate vs. Register Addressing—both avoid memory access for speed, but immediate embeds a fixed value in the instruction while register addressing references a variable value that can change at runtime. If an FRQ asks about loading constants vs. performing arithmetic on variables, this distinction is key.
These modes access main memory by specifying addresses directly or through a single level of indirection. The trade-off: simpler addressing logic but slower execution due to memory access latency.
Compare: Direct vs. Indirect Addressing—direct is faster (one memory access) but inflexible, while indirect adds a memory fetch but supports dynamic data structures. When asked about implementing pointers or linked lists, indirect addressing is your answer.
These modes calculate the effective address by combining a base value with an offset or index. The underlying mechanism: , enabling efficient access to structured data.
LOAD R1, 100(R2))LOAD R1, (R2 + R3))Compare: Base Register vs. Indexed Addressing—both compute addresses, but base register uses a constant offset (good for struct fields) while indexed uses a variable index (good for array iteration). FRQs often ask which mode suits arrays vs. records—know the difference.
These modes support branching, function calls, and local variable management. They're essential for implementing high-level constructs like loops, conditionals, and recursion.
JMP LABEL calculates the target relative to the current instructionCompare: Relative vs. Stack Addressing—relative addressing handles horizontal control flow (jumps and branches) while stack addressing handles vertical control flow (function call/return hierarchy). Both enable modular, position-independent code but serve different structural purposes.
| Concept | Best Examples |
|---|---|
| Fastest execution (no memory access) | Immediate, Register |
| Fixed memory locations | Direct Addressing |
| Dynamic/pointer-based access | Indirect Addressing |
| Struct/record field access | Base Register Addressing |
| Array traversal and iteration | Indexed Addressing |
| Position-independent branching | Relative Addressing |
| Function calls and recursion | Stack Addressing |
| Computed effective address | Base Register, Indexed, Relative |
Which two addressing modes avoid memory access entirely, and why does this matter for execution speed?
You're implementing a linked list traversal. Which addressing mode is essential, and what's the performance cost compared to direct addressing?
Compare base register addressing and indexed addressing: if you're accessing the third field of a struct vs. the third element of an array, which mode fits each scenario?
Why does relative addressing enable position-independent code, and what instruction type most commonly uses it?
An FRQ asks you to explain how a function call stores its return address and local variables. Which addressing mode and data structure are involved, and what memory access pattern do they use?