![NEC mPD17120 Subseries User Manual Download Page 105](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259105.webp)
CHAPTER 11 ARITHMETIC AND LOGIC UNIT
90
11.2.2 Functions of Temporary Registers A and B
Temporary registers A and B are needed for processing of 4-bit data. These registers are used for temporary
storage of the first and second data operands of an instruction.
11.2.3 Functions of the Status Flip-flop
The status flip-flop is used for controlling operation of the ALU and for storing data which has been processed.
Each flag in the status flip-flop corresponds directly to a flag in the program status word (PSWORD) located in the
system register. This means that when a flag in the system register is manipulated it is the same as manipulating
a flag in the status flip-flop. Each flag in the program status word is described below.
(1) Z flag
This flag is set (1) when the result of an arithmetic operation is 0000B, otherwise it is reset (0). However,
as described below, depending on the status of the CMP flag, the conditions which cause this flag to be set
(1) can be changed.
(i)
When CMP=0
Z flag is set (1) when the result of an arithmetic operation is 0000B, otherwise it is reset (0).
(ii) When CMP=1
The previous state of the Z flag is maintained when the result of an arithmetic operation is 0000B,
otherwise it is reset (0). Only affected by arithmetic operations.
(2) CY flag
This flag is set (1) when a carry or borrow is generated in the result of an arithmetic operation, otherwise
it is reset (0).
When an arithmetic operation is being performed using a carry or borrow, the operation is performed using
the CY flag as the least significant bit. When a rotation (RORC instruction) is performed, the contents of the
CY flag becomes the most significant bit (bit b
3
) of the general register and the least significant bit of the
general register is stored in the CY flag.
Only affected by arithmetic operations and rotations.
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 ...