Introduction to CPU                                                                                                                                      Print this page
<< Previous |  First Last |  Next >>       

Processor Status Word

All CPU designs include a register or set of registers, often known as the processor status word (PSW), that contains status information. The PSW typically contains condition codes plus other status information. Common fields or flags include the following:

  • Sign: Contains the sign bit of the result of the last arithmatic operation.
  • Zero: Set when the result is zero.
  • Carry: Set if an operation resulted in a carry (addition) into or borrow (subtraction) out of a high order bit.
  • Equal: Set if a logical campare result is equal.
  • Overflow: Used to indicate arithmatic overflow.
  • Interrupt enable/disable: Used to enable or disable interrupts.
  • Supervisor: Indicate whether the CPU is executing in supervisor or user mode.
    Certain privileged instructions can be executed only in supervisor mode, and certain areas of memory can be accessed only in supervisor mode.

Apart from these, a number of other registers related to status and control might be found in a particular CPU design. In addition to the PSW, there may be a pointer to a block of memory containing additional status information (e.g. process control blocks).

<< Previous |  First |  Last |  Next >>