![NEC mPD17120 Subseries User Manual Download Page 106](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259106.webp)
CHAPTER 11 ARITHMETIC AND LOGIC UNIT
91
(3) CMP flag
When the CMP flag is set (1), the result of an arithmetic operation is not stored in either the general register
or data memory.
When the bit evaluation instruction is performed, the CMP flag is reset (0).
The CMP flag does not affect comparison evaluations, logical operations, or rotations.
(4) BCD flag
When the BCD flag is set (1), decimal correction is performed for all arithmetic operations. When the flag
is reset (0), decimal correction is not performed.
The BCD flag does not affect logical operations, bit evaluations, comparison evaluations, or rotations.
These flags can also be set through direct manipulation of the values in the program status word. When the flags
in the program status word are manipulated, the corresponding flag in the status flip-flop is also manipulated.
11.2.4 Performing Operations in 4-Bit Binary
When the BCD flag is set to 0, arithmetic operations are performed in 4-bit binary.
11.2.5 Performing Operations in BCD
When the BCD flag is set to 1, decimal correction is performed for arithmetic operations performed in 4-bit binary.
Table 11-2 shows the differences in the results of operations performed in 4-bit binary and in BCD. When the result
of an addition after decimal correction is equal to or greater than 20, or the result of a subtraction after decimal
correction is outside of the range –10 to +9, a value of 1010B (0AH) or higher is stored as the result (shaded area
in Table 11-2).
Summary of Contents for mPD17120 Subseries
Page 15: ... x MEMO ...
Page 23: ... MEMO 8 ...
Page 45: ... MEMO 30 ...
Page 49: ... MEMO 34 ...
Page 55: ... MEMO 40 ...
Page 93: ... MEMO 78 ...
Page 99: ... MEMO 84 ...
Page 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Page 119: ... MEMO 104 ...
Page 175: ... MEMO 160 ...
Page 199: ... MEMO 184 ...
Page 265: ... MEMO 250 ...
Page 281: ...266 MEMO ...
Page 285: ... MEMO 270 ...
Page 289: ... MEMO 274 ...