Z8 Microcontrollers
Instruction Set
ZiLOG
UM001600-Z8X0599
12-5
12.3 CONDITION CODES
The C, Z, S, and V Flags control the operation of the ‘Con-
ditional’ Jump instructions. Sixteen frequently useful func-
tions of the flag settings are encoded in a 4-bit field called
the condition code (cc), which forms bits 4-7 of the condi-
tional instructions.
Condition codes and flag settings are summarized in Ta-
bles 12-9, 12-10, and 12-11. Notation for the flags and how
they are affected are as follows:
Table 12-9. Z8 Flag Definitions
Flag
C
Z
S
V
D
H
Description
Carry Flag
Zero Flag
Sign Flag
Overflow Flag
Decimal Adjust Flag
Half Carry Flag
Table 12-10. Flag Settings Definitions
Symbol
Definition
Cleared to 0
Set to 1
Set or cleared according to operation
Unaffected
Undefined
0
1
*
–
X
Table 12-11. Condition Codes
Binary
0000
1000
0111
1111
0110
1110
1101
0101
0100
1100
0110
1110
1001
0001
1010
0010
1111
0111
1011
0011
HEX
0
8
7
F
6
E
D
5
4
C
6
E
9
1
A
2
F
7
B
3
Mnemonic
F
(blank)
C
NC
Z
NZ
PL
Ml
OV
NOV
EQ
NE
GE
LT
GT
LE
UGE
ULT
UGT
ULE
Definition
Always False
Always True
Carry
No Carry
Zero
Non-Zero
Plus
Minus
Overflow
No Overflow
Equal
Not Equal
Greater Than or Equal
Less Than
Greater Than
Less Than or Equal
Unsigned Greater Than or Equal
Unsigned Less Than
Unsigned Greater Than
Unsigned Less Than or Equal
Flag Settings
–
–
C = 1
C = 0
Z = 1
Z = 0
S = 0
S = 1
V = 1
V = 0
Z = 1
Z = 0
(S XOR V) = 0
(S XOR V) = 1
(Z OR (S XOR V)) = 0
(Z OR (S XOR V)) = 1
C = 0
C = 1
(C = 0 AND Z = 0) = 1
(C OR Z) = 1