Show understanding of the purpose and role of registers, including the difference between general‑purpose and special‑purpose registers, and how they are used in the fetch‑decode‑execute cycle, addressing modes, instruction‑set design and CPU performance.
| Type | Typical purpose | Common examples |
|---|---|---|
| General‑purpose registers (GPRs) | Store operands, intermediate results, addresses or pointers; freely usable by assembly‑level programmers. | Accumulator (ACC), Base (BR), Counter (CTR), Data (DR), Index (IX), R0‑R31 (MIPS), \$t0‑\$t9 (MIPS) |
| Special‑purpose registers (SPRs) | Dedicated to control, status or memory‑interface functions; usually updated implicitly by the CPU. | Program Counter (PC), Instruction Register (IR), Memory Address Register (MAR), Memory Data Register (MDR), Status/Flags Register (SR/FLAGS) |
GPRs are grouped in a register file. The number of registers and the width of each register (8‑, 16‑, 32‑ or 64‑bit) are architectural decisions that affect:
| Register | Typical use | Example architecture |
|---|---|---|
| Accumulator (ACC) | Holds the result of arithmetic/logic operations. | 8085, ARM (R0 often used as accumulator) |
| Base register (BR) | Provides a base address for indexed or segmented addressing. | IBM System/360, x86 (EBX) |
| Counter register (CTR) | Controls loop‑iteration counts or repeat operations. | Motorola 68000 (X), ARM (R12 as IP) |
| Data register (DR) | Temporarily stores data transferred to/from memory. | Intel x86 (EDX) |
| Index register (IX) | Used for array indexing and pointer arithmetic. | Z80 (IX/IY), MIPS (\$t0‑\$t9) |
These registers belong to the CPU’s control logic. They are rarely addressed directly by user programmes, but they are essential for correct sequencing of instructions.
| Register | Function | Typical symbol |
|---|---|---|
| Program Counter (PC) | Holds the address of the next instruction to be fetched. | PC |
| Instruction Register (IR) | Contains the instruction that has just been fetched and is being decoded. | IR |
| Memory Address Register (MAR) | Holds the address of the memory location being accessed (read or write). | MAR |
| Memory Data Register (MDR) | Temporarily stores data read from memory or data to be written to memory. | MDR |
| Status/Flags Register (SR/FLAGS) | Contains condition flags (Zero, Carry, Overflow, Sign, etc.) set by the most recent ALU operation. | SR, FLAGS |
RTN expresses the movement of data between registers (or between a register and memory) in a concise symbolic form. It is used throughout the syllabus when describing the F‑E cycle.
PC → MAR // place address of next instruction on the address busMemory[MAR] → MDR → IR // fetch instruction from memoryPC ← PC + 1 // point to following instructionIR[op] → ALU // decode operationR₁, R₂ → ALU → ACC // execute arithmetic/logic using GPRsACC → MDR → Memory[MAR] // store result (if required)ALU → SR // update condition flagsPC → MARMemory[MAR] → MDR → IRPC ← PC + 1IR and determines which GPR(s) and/or SPR(s) are required.MDR for a memory write.Registers are used in several addressing modes. The table shows each mode, a short RTN example and a brief explanation.
| Mode | RTN example | Explanation |
|---|---|---|
| Immediate | ACC ← #CONST | The constant value is part of the instruction itself. |
| Direct | MAR ← ADDRESS; Memory[MAR] → MDR → ACC | The address field of the instruction gives the memory location. |
| Indirect | MAR ← ADDRESS; Memory[MAR] → MAR; Memory[MAR] → MDR → ACC | The instruction points to a memory cell that contains the actual operand address. |
| Indexed | MAR ← BASE + IX; Memory[MAR] → MDR → ACC | A base address (often in a base register) is added to an index register to form the effective address. |
| Register direct | ACC ← R₁ | The operand is taken directly from a GPR. |
When an interrupt occurs the CPU must preserve the current execution state so that it can resume later.
PC (and often SR) are automatically pushed onto a stack or saved in dedicated interrupt registers.PC is loaded with the address of the interrupt‑service routine (ISR) taken from an interrupt vector table.PC (and SR if required) are restored, allowing normal execution to continue.| Aspect | General‑purpose registers | Special‑purpose registers |
|---|---|---|
| Purpose | General data manipulation; directly addressed by most instructions. | Control, status, and memory‑interface functions; usually updated implicitly. |
| Number & naming | Variable count (e.g., 8, 16, 32, 64); often numbered R0, R1… or given functional names. | Fixed, well‑defined names (PC, IR, MAR, MDR, SR/FLAGS, etc.). |
| Visibility to programmer | Explicitly usable in assembly language (e.g., ADD R2, R3). | Manipulated only by the CPU during the F‑E cycle or by privileged system code. |
| Effect on ISA & performance | Influences the number of operand fields, instruction‑word size and the amount of data that can be processed per cycle. | Determines program flow control, memory interfacing and condition‑flag reporting, which affect pipeline design and hazard handling. |
IR ← Memory[PC] // fetch
PC ← PC + 1 // point to next instruction
ACC ← ACC op R₁ // perform operation using a GPR
SR ← update_flags(ACC) // set condition flags
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.