ZiLOG
12.3 CONDITION CODES
The C, Z, S, and V Flags control the operation of the 'Condition-
al' Jump instructions. Sixteen 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.
Table 12-9. 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
Binary
HEX
0000
1000
0111
1111
0110
1110
1101
0101
0100
1100
0110
1110
1001
0001
1010
0010
1111
0111
1011
0011
UM001601-0803
Table 12-11. Condition Codes
Mnemonic
0
F
8
(blank)
7
C
F
NC
6
Z
E
NZ
D
PL
5
Ml
4
OV
C
NOV
6
EQ
E
NE
9
GE
1
LT
A
GT
2
LE
F
UGE
7
ULT
B
UGT
3
ULE
Condition codes and flag settings are summarized in Tables 12-
9, 12-10, and 12-11. Notation for the flags and how they are af-
fected are as follows:
Table 12-10. Flag Settings Definitions
Symbol
Definition
0
Cleared to 0
1
Set to 1
*
Set or cleared according to operation
–
Unaffected
X
Undefined
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
Z8 Microcontrollers
Instruction Set
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
12-5
Need help?
Do you have a question about the Z8 and is the answer not in the manual?