A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Addressing Modes and Instruction Format

College Depth 91 in the knowledge graph ☐ I know this ☆ Set as goal
14topics build on this
350prerequisites beneath it
See this on the map →
Instruction Set Architecture (ISA)→→CPU PipeliningMicroinstruction Format and Control Signals
addressing modes instruction format

Core Idea

Addressing modes specify how to locate an instruction's operands: immediate (literal value), register (from register), direct (from memory at given address), indirect (from memory at address in a register), and indexed (address modified by an index). Instruction format encodes opcode and addressing mode in fixed or variable-length fields.

Explainer

From your study of instruction set architecture, you know that every machine instruction specifies an operation and its operands. But *how* the operands are specified varies enormously, and the choice has deep consequences for code density, performance, and flexibility. Addressing modes are the different ways an instruction can say "here is where to find the data." Understanding them is understanding the bridge between high-level data access patterns (variables, arrays, pointers, structures) and the hardware's actual capabilities.

The simplest modes are immediate and register. In immediate mode, the operand value is embedded directly in the instruction itself — `ADD R1, #5` means "add the literal value 5 to register R1." This is fast because no memory access is needed, but the value must be small enough to fit in the instruction's operand field. Register mode is equally fast — `ADD R1, R2` fetches the operand from a CPU register, which takes essentially zero extra time. These two modes handle constants and local variables that the compiler has placed in registers.

When data lives in memory, the modes become more interesting. Direct (or absolute) addressing gives a fixed memory address: `LOAD R1, [0x4000]` fetches from address 0x4000. This works for global variables at known locations. Register indirect addressing uses a register as a pointer: `LOAD R1, [R2]` means "go to the address stored in R2 and fetch the value there." This is how pointer dereferencing works at the hardware level. Indexed addressing adds an offset: `LOAD R1, [R2 + 8]` accesses a memory location at a fixed displacement from a base address, which is exactly what you need for accessing structure fields or array elements. Some architectures support scaled indexed mode — `LOAD R1, [R2 + R3*4]` — where the index register is multiplied by the element size, directly supporting array indexing without extra multiply instructions.

The instruction format determines how all of this information — opcode, addressing mode, register numbers, immediate values, offsets — is packed into binary. In a fixed-length format (like ARM's 32-bit instructions), every instruction occupies the same number of bits, which simplifies instruction fetch and pipeline design but limits how much information each instruction can carry. In a variable-length format (like x86), instructions range from 1 to 15 bytes, allowing more addressing modes and larger immediate values at the cost of more complex decoding logic. This tradeoff between decode simplicity and code expressiveness is one of the fundamental design decisions in processor architecture, and it directly affects the pipeline organization you will study next.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Addressing Modes and Instruction Format

Longest path: 92 steps · 350 total prerequisite topics

Prerequisites (1)

Leads To (2)