CITS2002 Systems Programming  
prev
next CITS2002 CITS2002 schedule  

Register types

Registers are generally of two types:
User-accessible registers -
are accessible to programs, and may usually be read from and written to under program control. Programs written in an assembly language, either by a human programmer or generated by a compiler for a high-level language, are able to read and write these registers using specific instructions understood by the processor which usually accept the names of the registers as operands.

The user-accessible registers are further of two types:

  • Data registers hold values before the execution of certain instructions, and hold the results after executing certain instructions.

  • Address registers hold the addresses (not contents) of memory locations used in the execution of a program, e.g.

    • the memory address register (MAR) holds the address of memory to be read or written;
    • the memory buffer register (MBR) holds the memory's data just read, or just about to be written;
    • index registers hold an integer offset from which of memory references are made; and
    • a stack pointer (SP) holds the address of a dedicated portion of memory holding temporary data and other memory addresses.

Control and status registers -
hold data that the processor itself maintains in order to execute programs, e.g. the instruction register(IR) holds the current instruction being executed, and the program counter (PC) holds the memory address of the next instruction to be executed.

Special registers reflect the status of the processor. The processor status word (PSW) reflects whether or not the processor may be interrupted by I/O devices and whether privileged instructions may be executed, and it uses condition bits to reflect the status of recently executed operations.

In order evaluate results, and to determine if branching should occur, the PSW may record -

  • whether an arithmetic operation overflowed,
  • whether an arithmetic operation performed a carry,
  • whether a division by zero was attempted,
  • whether the last comparison instruction succeeded or failed.

 


CITS2002 Systems Programming, Lecture 6, p4, 7th August 2024.