A-11
Appendices
CP2E CPU Unit Software User’s Manual(W614)
A-1 Instruction Functions
App
A-1-5 Comparison Instructions
DOUBLE
UNSIGNED
COMPARE
CMPL --- Compares two double unsigned binary values (constants and/or
the contents of specified words) and outputs the result to the Arith-
metic Flags in the Auxiliary Area.
SIGNED
BINARY COM-
PA R E
CPS ! Compares two signed binary values (constants and/or the con-
tents of specified words) and outputs the result to the Arithmetic
Flags in the Auxiliary Area.
DOUBLE
SIGNED
BINARY COM-
PA R E
CPSL --- Compares two double signed binary values (constants and/or the
contents of specified words) and outputs the result to the Arith-
metic Flags in the Auxiliary Area.
TABLE COM-
PA R E
TCMP @ Compares the source data to the contents of 16 words and turns
ON the corresponding bit in the result word when the contents are
equal.
T: First word of table
UNSIGNED
BLOCK COM-
PA R E
BCMP @ Compares the source data to 16 ranges (defined by 16 lower limits
and 16 upper limits) and turns ON the corresponding bit in the
result word when the source data is within the range.
B: First word of block
Instruction Mnemonic Variations Symbol/Operand Function
CMPL(060)
S
1
S
2
S1: Comparison data 1
S2: Comparison data 2
S1+1
S2+1
(>, >=, =, <=, <, <>)
Unsigned binary
comparison
Arithmetic Flags
CPS(114)
S
1
S
2
S1: Comparison data 1
S2: Comparison data 2
(>, >=, =, <=, <, <>)
Signed binary
comparison
Arithmetic Flags
CPSL(115)
S
1
S
2
S1: Comparison data 1
S2: Comparison data 2
S1+1
S2+1
(>, >=, =, <=, <, <>)
Signed binary
comparison
Arithmetic Flags
TCMP(085)
S
T
R
S: Source data
T: 1st word of table
R: Result word
R
Comparison
1: Data
are equal.
0: Data
aren't equal.
Comparison data 0
Comparison data 1
to
Comparison data 15
T
T+1
to
T+15
BCMP(068)
S
T
R
S: Source data
T: 1st word of table
R: Result word
T+3
1
0
14
15
T+29
T+31
T+1
T+2
T+28
T+30
T
S
R
to
to
to
to
Ranges
Upper limit
Source data
Lower limit
1: In range
0: Not in range
B
B+1
B+2
B+3
to
B+30
B+31
Lower limit value 0
Upper limit value 0
Lower limit value 1
Upper limit value 1
to
Lower limit value 15
Upper limit value 15