Special function register

A Special Function Register (or Special Purpose Register, or simply Special Register) is a register within a microprocessor, which controls or monitors various aspects of the microprocessor's function. Depending on the processor architecture, this can include, but is not limited to:

  • I/O and peripheral control (such as serial ports or general-purpose IOs)
  • timers
  • stack pointer
  • stack limit (to prevent overflows)
  • program counter
  • subroutine return address
  • processor status (servicing an interrupt, running in protected mode, etc.)
  • condition codes (result of previous comparisons)

Because special registers are closely tied to some special function or status of the processor, they might not be directly writeable by normal instructions (such as adds, moves, etc.). Instead, some special registers in some processor architectures require special instructions to modify them. For example, the program counter is not directly writeable in many processor architectures. Instead, the programmer uses instructions such as return from subroutine, jump, or branch to modify the program counter. For another example, the condition code register might not directly writable, instead being updated only by compare instructions.