![](http://datasheet.mmic.net.cn/390000/PD784976A_datasheet_16826985/PD784976A_58.png)
58
CHAPTER 3 CPU ARCHITECTURE
User
’
s Manual U15017EJ2V0UD
Example
The action of the overflow flag when an 8-bit addition instruction is executed is described next.
When 78H (+120) and 69H (+105) are added, the operation result becomes E1H (+225). Since the
upper limit of two
’
s complement is exceeded, the P/V flag is set to 1. In a two
’
s complement expression,
E1H becomes
–
31.
78H (+120) =
+) 69H (+105) = +) 0110 1001
0111 1000
0 1110 0001 =
–
31 P/V = 1
↑
CY
Next, since the operation result of the addition of the following two negative numbers falls within the
two
’
s complement range, the P/V flag is reset to 0.
FBH (
–
5)
+) F0H (
–
16)
=
= +) 1111 0000
1 1110 1011 =
–
21 P/V = 0
↑
CY
1111 1011
(3) Interrupt request enable flag (IE)
This flag controls the CPU interrupt request acknowledgement.
If IE is 0, interrupts are disabled, and only non-maskable interrupts and unmasked macro services can be
accepted. Otherwise, everything is disabled.
If IE is 1, the interrupt enable state is entered. Enabling the acknowledgement of interrupt requests is controlled
by the interrupt mask flags that correspond to each interrupt request and the priority of each interrupt.
This flag is set to 1 by executing the EI instruction and is reset to 0 by executing the DI instruction or acknowledging
an interrupt.
(4) Auxiliary carry flag (AC)
If the operation result has a carry from bit 3 or a borrow to bit 3, this flag is set to 1. Otherwise, the flag is reset
to 0.
This flag is used when the ADJBA and ADJBS instructions are executing.
(5) Register set selection flag (RSS)
This flag sets the general-purpose registers that function as X, A, C, and B and the general-purpose register pairs
(16 bits) that function as AX and BC.
This flag is used to maintain compatibility with the 78K/III Series. Always set this flag to 0 except when using
a 78K/III Series program.
(6) Zero flag (Z)
This flag indicates that the operation result is 0.
If the operation result is 0, this flag is set to 1. Otherwise, it is reset to 0. The state of the Z flag can be tested
by conditional branch instructions.