Common Registers

Instruction Register

  • Holds the actual Instruction that is currently being executed by the CPU

Program Counter

Memory Address Register

Stack Pointer


Used to access a memory location relative to the current top of the stack.

; Decrement the stack pointer by 8 (allocate 8 bytes on the stack)
sub $sp, 8 
; Move the value at the memory location (sp + 4) into the eax register
mov 4($sp), %eax 

Frame Pointer

  • Maintains a reference point within the current Stack Frame
  • At the beginning of a function (prologue), the Frame Pointer is typically set to the current value of the Stack Pointer, establishing the base of the current stack frame
  • Throughout the function: The FP remains relatively unchanged, offering a stable reference point

Control & Status Registers (CSRs)

  • There are multiple such registers in the CPU, the main purpose is storing information about the current state of the processor or device
  • CSRs are typically used to control various aspects of the processor’s operation, such as interrupt handling, memory management, and power management etc

MIPS Registers


Register Width

Register File

  • A collection of Register that CPU can use to quickly store and retrieve Data

Memory Mapped Register

  • Register that can be accessed via a Main Memory location
  • This means that the register can be accessed using the same Instruction and addressing modes as memory.
  • Often used to control hardware devices, such as IO Device (Like the UART in XV6) and memory controllers