English
Language : 

PD17012_15 Datasheet, PDF (61/320 Pages) Renesas Technology Corp – 4-BIT SINGLE-CHIP MICROCONTROLLERS WITH DIGITAL TUNING SYSTEM HARDWARE
µPD17012, 17P012
7.4 Notes on Using ALU
7.4.1 Notes on using operations for program status word
If an arithmetic operation is executed for the program status word, the result of the arithmetic operation is
stored in the program status word.
The CY and Z flags of the program status word are set or reset depending on the result of the arithmetic
operation. If an arithmetic operation is executed on the program status word itself, the result of the operation
is stored in the program status word, which makes it impossible to judge occurrence of a carry or a borrow, or
whether the result of the operation is zero.
If the CMP flag is set, however, the result of the operation is not stored in the program status word, and the
CY and Z flags are set or reset normally.
7.4.2 Notes on using decimal operations
A decimal operation can be executed only if the result falls within the following range:
(1) Result of addition: 0 to 19 in decimal
(2) Result of subtraction: 0 to 9 or –10 to –1 in decimal
If a decimal operation is executed exceeding this range, the CY flag is set, and the result is a value greater
than 1010B (0AH).
Data Sheet U10101EJ4V0DS
59