An Interactive Journey Through CPU Addressing Modes

Visualize how a CPU finds the data it needs.

Why do we need so many ways to find data?

As we write programs in high-level languages, we use data in many different ways: simple variables, arrays, pointers, linked lists, and struct/objects. The CPU needs the same flexibility to access this data efficiently. Addressing modes provide this flexibility. They are the bridge between how we structure data in code and how the CPU finds it in memory.

The Two Families of Addressing Modes

Non-Computable Modes

These are the most straightforward modes. The CPU can find the operand or its address with no extra addition or subtraction. The location is either implied, inside the instruction itself, or in a register.

Computable Modes

These modes are more powerful and flexible. They require the CPU's Arithmetic Logic Unit (ALU) to perform a calculation to determine the final memory address of the operand. This is essential for working with data structures.

Interactive Addressing Modes

CPU

R1: 0
R2: 0
R3: 0
AC: 0
PC: 0
IR: ---
ALU

Select a Mode

Description will appear here.

High-Level Code Example:

Welcome! Click a mode button to begin.

Memory

Program Flow Simulation

See how instructions combine to form programs.

CPU

R0: 0
R1: 0
R2: 0
Flags: [Z:0]
PC: 0
IR: ---
ALU

High-Level Code:

Select a Program

Select a program to begin.

Memory

Interactive Condition Code Flags

ALU operations change flags that control program branches.

Arithmetic Flag Calculator

Flags:

N Z V C

Overflow (V) Flag Logic

V = Carry-in to MSB ⊕ Carry-out from MSB

(Cn-1)

(Cn)

Overflow Flag:

V