
μ
PD17016, 17017
49
5.8.2 Function of program status word
The program status word is a register that sets the condition of an operation or transfer instruction of the ALU
(Arithmetic Logic Unit) or indicates the result of an operation executed.
Table 5-2 outlines the function of each flag of the program status word.
For details, refer to
7. ALU (Arithmetic Logic Unit) BLOCK
.
Table 5-2. Functional Outline of Program Status Word
5.8.3 Notes on using program status word
If an arithmetic operation (addition or subtraction) instruction is executed to the program status word, the
“result” of the arithmetic operation is stored to the program status word.
For example, even if an operation that causes a carry to occur is executed, if the result of the operation is
0000B, 0000B is stored to PSW.
5.9 Notes on Using System Register
The data of the system register fixed to “0” is not affected even if a write instruction is executed to it.
This data is always “0” when it is read.
Program status word
(PSWORD)
RPL
PSW
b
3
b
2
b
1
b
0
B
C
D
b
3
C
M
P
b
2
C
Y
b
1
Z
b
0
I
X
E
Flag Name
Index enable flag
(IXE)
Zero flag
(Z)
Carry flag
(CY)
Compare flag
(CMP)
BCD flag
(BCD)
Function
(RP)
This flag modifies address of data memory when data memory
manipulation instruction is executed.
0 : Does not modify
1 : Modifies
This flag indicates that result of arithmetic operation
executed is 0.
Note that status of 0 or 1 differs depending on content of compare flag.
This flag indicates occurrence of carry or borrow as result of execution
of addition or subtraction instruction.
It is reset to “0” if carry/borrow does not occur; it is set to “1” if
carry/borrow occurs.
This flag is also used as sift bit of “RORC r” instruction.
This flag is used to not store result of arithmetic operation to data
memory or general register.
0 : Result stored
1 : Result not stored
This flag is used to execute arithmetic operation in decimal.
0 : Executes binary operation
1 : Executes decimal operation