Samsung S3C80M4/F80M4 User Manual page 114

8-bit cmos microcontrollers
Table of Contents

Advertisement

INSTRUCTION SET
CONDITION CODES
The opcode of a conditional jump always contains a 4-bit field called the condition code (cc). This specifies under
which conditions it is to execute the jump. For example, a conditional jump with the condition code for "equal"
after a compare operation only jumps if the two operands are equal. Condition codes are listed in Table 6-6.
The carry (C), zero (Z), sign (S), and overflow (V) flags are used to control the operation of conditional jump
instructions.
Binary
0000
F
1000
T
(note)
C
0111
(note)
NC
1111
(note)
Z
0110
(note)
NZ
1110
1101
PL
0101
MI
0100
OV
1100
NOV
(note)
EQ
0110
(note)
NE
1110
1001
GE
0001
LT
1010
GT
0010
LE
(note)
UGE
1111
(note)
ULT
0111
1011
UGT
0011
ULE
NOTES:
1.
It indicates condition codes that are related to two different mnemonics but which test the same flag. For
example, Z and EQ are both true if the zero flag (Z) is set, but after an ADD instruction, Z would probably be used;
after a CP instruction, however, EQ would probably be used.
2.
For operations involving unsigned numbers, the special condition codes UGE, ULT, UGT, and ULE must be used.
6-12
Table 6-6. Condition Codes
Mnemonic
Always false
Always true
Carry
No carry
Zero
Not 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
Description
S3C80M4/F80M4
Flags Set
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

Advertisement

Table of Contents
loading

Table of Contents