109
CPU System Functions
Chapter 3
Preliminary User’s Manual U17566EE1V2UM00
(3)
PSW - Program status word
The 32-bit program status word is a collection of flags that indicates the status
of the program (result of instruction execution) and the status of the CPU.
If the bits in the register are modified by the LDSR instruction, the PSW will
take on the new value immediately after the LDSR instruction has been
executed.
Initial Value
0000 0020
H
. The program status is initialized by any reset.
31
8
7
6
5
4
3
2
1
0
fixed to 0
NP
EP
ID
SAT
CY
OV
S
Z
R
R
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Table 3-5
PSW register contents
Bit position
Flag
Function
7
NP
Indicates that non-maskable interrupt (NMI) servicing is in progress.
This flag is set when NMI request is acknowledged, and multiple interrupt
servicing is disabled.
0: NMI servicing is not in progress.
1: NMI servicing is in progress.
6
EP
Indicates that exception processing is in progress.
This flag is set when an exception occurs. Even when this bit is set, interrupt
requests can be acknowledged.
0: Exception processing is not in progress.
1: Exception processing is in progress.
5
ID
Indicates whether a maskable interrupt request can be acknowledged.
0: Interrupts enabled.
1: Interrupts disabled.
Note:
Setting this flag will disable interrupt requests even while the LDSR
instruction is being executed.
4
SAT
a
For saturated operation processing instructions only:
Indicates that the operation result is saturated due to overflow.
0: Not saturated.
1: Saturated.
Note: 1.
This is a cumulative flag: The bit is not automatically cleared if
subsequent instructions lead to not saturated results.
To clear this bit, use the LDSR instruction to set PSW.SAT = 0.
2.
In a general arithmetic operation this bit is neglected. It is neither
set nor cleared.
3
CY
Carry/borrow flag.
Indicates whether a carry or borrow occurred as a result of the operation.
0: Carry or borrow did not occur
1: Carry or borrow occurred.
2
OV
a
Overflow flag.
Indicates whether an overflow occurred as a result of the operation.
0: Overflow did not occur.
1: Overflow occurred.
1
S
a
Sign flag.
Indicates whether the result of the operation is negative.
0: Result is positive or zero.
1: Result is negative.
0
Z
Zero flag.
Indicates whether the result of the operation is zero.
0: Result is not zero.
1: Result is zero.
electronic components distributor