Foundations
Registers & Memory
Understanding registers, memory layout, and the fetch-execute cycle.
Registers
Registers are small, fast storage locations inside the CPU. The LC-3 has:
Registers are much faster than memory. Most instructions work directly with registers.
Memory Layout
LC-3 memory is organized as 65,536 (2^16) locations, each holding a 16-bit value:
| Address Range | Purpose |
| x0000–x00FF | Trap vector table |
| x0100–x01FF | Interrupt vector table |
| x0200–x2FFF | Operating system |
| x3000–xFDFF | User program space |
| xFE00–xFFFF | Device registers (I/O) |
x3000 — that's why .ORIG x3000 is the standard.
The Fetch-Execute Cycle
Every instruction goes through these phases:
memory[PC], then PC = PC + 1The PC is incremented during FETCH, before the instruction executes. This matters for PC-relative addressing — offsets are relative to the already-incremented PC.
Quiz
When a PC-relative instruction at address x3005 is executing, what value does the PC hold?