Z8
®
CPU
User Manual
UM001604-0108
Instruction Set
146
IRET changes the value of the Decimal Adjust Flag when the Flag Register saved in the
Stack is restored.
Half Carry Flag
The Half Carry Flag (H) is set to 1 whenever an addition generates a carry bit 3 (Over-
flow) or a subtraction generates a borrow bit 3. The Half Carry Flag is used by the Deci-
mal Adjust (DA) instruction to convert the binary result of a previous addition or
subtraction into the correct decimal (BCD) result. As in the case of the Decimal Adjust
Flag, This Flag is normally not accessed.
IRET changes the value of the Half Carry Flag when the Flag Register saved in the Stack
is restored.
Condition Codes
The C, Z, S, and V Flags control the operation of the ‘Conditional’ Jump instructions. Six-
teen frequently useful functions of the flag settings are encoded in a 4-bit field called the
condition code (cc), which forms bits 4-7 of the conditional instructions.
Condition codes and Flag settings are summarized in
through
147. Notation for the Flags and how they are affected are as follows:
Table 34. Z8 Flag Definitions
Flag
Description
C
Carry Flag
Z
Zero Flag
S
Sign Flag
V
Overflow Flag
D
Decimal Adjust Flag
H
Half Carry Flag
Table 35. Flag Settings Definitions
Symbol
Definition
0
Cleared to 0
1
Set to 1
*
Set or cleared according to operation
–
Unaffected
X
Undefined