Intermediate Topic 24 of 51 Computer Architecture & Logic
Addressing Modes
Ways instructions specify operand locations.
How it works
Addressing modes define how an instruction specifies where its operands are. Common modes include immediate, where the value is encoded in the instruction, register, direct, register indirect, base plus offset or displacement, indexed, and PC-relative. Richer modes let a single instruction access array elements or struct fields, but make decoding and address calculation more complex.
Step-by-step walkthrough
- Immediate puts the value inside the instruction.
- Register mode names a register that holds the operand.
- Direct mode gives the memory address itself.
- Indirect mode reads an address from a register or memory first.
- Indexed mode adds an offset to a base, ideal for arrays.
Where it is used
Accessing array elements with base plus index, calling functions with PC-relative jumps, loading constants, implementing pointers and writing position-independent code all rely on addressing modes. RISC architectures offer few; x86 offers many.
Common pitfall
Confusing the value in a register with the memory at that address is the classic mistake, as in the difference between loading a pointer and dereferencing it. Offset sizes limit reach, so far jumps need extra steps. Scaling and sign extension rules differ between architectures.
Where it fits in the course
Addressing Modes is topic 24 of 51 in Computer Architecture & Logic, rated Intermediate. It follows Assembly Language. The next topic is Memory Hierarchy.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Computer Architecture & Logic quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Computer Architecture & Logic quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Addressing Modes?
Where do people use Addressing Modes?
What is the most common mistake with Addressing Modes?
What should I learn before this topic?
How can I practice it?
Is Addressing Modes hard to learn?
How long does it take to learn Addressing Modes?
Which topics are related to Addressing Modes?
What should I study after Addressing Modes?
Related topics
- Assembly Language (Computer Architecture & Logic)
- Memory Hierarchy (Computer Architecture & Logic)
- RISC vs CISC (Computer Architecture & Logic)
- Cache Memory (Computer Architecture & Logic)
- Open Addressing (Data Structures)
- Block Cipher Modes (Security & Cryptography)