The Raptor-16 Microprocessor Control Register is used to hold the following information:-
- 7-bit Interrupt Mask
- 3-bit Execution Level
- 4-bit Condition Codes
The layout for this register is shown below:-
||0 to 7
||$00 to $EF
- This field holds the priority level that the current code is being executed at. User code is executed at level 0 and interrupt code is executed at levels 1 through 7.
- This field holds the four condition codes; Unsigned Overflow, Signed Overflow, Negative and Zero.
- This field holds the enable bit for each interrupt level and when set will enable the selected interrupts.
- This field is unused and should be left unset.
Although all fields can be changed in both user and interrupt code the only useful field to change is the interrupt mask. When modifying the Control Register in interrupt code please remember that upon exiting the interrupt code the old Control Register will be restored. If an indefinite change to the Control Register is required from within interrupt code then the Control Register held on the stack must be changed, but remember not to destroy the Execution Level or Condition Codes when doing so!!