![](http://datasheet.mmic.net.cn/30000/MB90662APFM_datasheet_2367560/MB90662APFM_32.png)
2.1 CPU
27
s Processor Status Register (PS)
The PS register comprises bits that perform CPU operating controls and bits that indicate CPU status.
As shown in Figure 2.1.12, the upper byte of the PS register is composed of the register bank pointer
(RP) which indicates the top address of the register bank, and the interrupt level mask register (ILM),
and the lower byte consists of the condition code register (CCR) which contains flags set to ‘1’ or ‘0’ to
indicate results of instruction execution and interrupt generation.
Fig. 2.1.12 PS Register Structure
(1) Condition Code Register (CCR)
Figure 2.1.13 shows the configuration of the condition code register.
Fig. 2.1.13 Condition Code Register Configuration
I: Interrupt enable flag:
Set to ‘1’ to enable all interrupt requests other than software interrupts.
When the flag is ‘0’, interrupts are masked. This flag is cleared at reset.
S: Stack flag
Set to ‘0’ to enable the USP register as the pointer used for stack operations.
When the flag is ‘1,’ the SSP register is enabled. Following an interrupt or
reset, the value is set to ‘1.’
T: Sticky bit flag
Set to ‘1’ when one or more “1”s are contained in data shifted out from the
carry field during execution of logical right-shift or arithmetic right-shift
instructions. The value is ‘0’ at all other times. When the shift value is zero
places, the bit is also set to ‘0.’
N: Negative flag
Set to ‘1’ if the MSB of the results of arithmetic calculation is ‘1’ and
cleared to ‘0’ if the result is zero.
Z: Zero flag
Set to ‘1’ when the results of arithmetic calculation are all zeros, and cleared
to ‘0’ at all other times.
V: Overflow flag
Set to ‘1’ when execution of an arithmetic calculation results in a coded
value indicating an overflow, and cleared to ‘0’ at all other times.
C: Carry flag
Set to ‘1’ when an arithmetic calculation requires the MSB to be carried up
or down one or more places, and cleared to ‘0’ at all other times.
PS
ILM
RP
CCR
15
13 12
8 7
0
Initial value
x: Indeterminate
0 0 0
0 0 0 0 0
- 0 1 x x x x x
–
I
S
T
N
Z
V
C
7
6
5
4
3
2
1
0
:CCR
Initial value
x: Indeterminate
-
0
1
x