Compare; Table 6-8. Condition Code Settings - Intel i960 Jx Developer's Manual

Microprocessor
Table of Contents

Advertisement

6.2.20

COMPARE

Mnemonic:
cmpi
cmpib
cmpis
cmpo
cmpob
cmpos
*
Format:
cmp
Description:
Compares src2 and src1 values and sets condition code according to
comparison results. The following table shows condition code settings for the
three possible comparison results.
cmpi*
compare-integer-and-branch instruction. The latter method of comparing and
branching produces more compact code; however, the former method can
execute byte and short compares without masking. The same is true for
cmpo*
# For cmpo, cmpi, N = 31.
Action:
# For cmpos, cmpis, N = 15.
# For cmpob, cmpib, N = 7.
if (src1[N:0] < src2[N:0])
AC.cc = 100
else if (src1[N:0] == src2[N:0])
AC.cc = 010
else if (src1[N:0] > src2[N:0])
AC.cc = 001
STANDARD
Faults:
Compare Integer
Compare Integer Byte
Compare Integer Short
Compare Ordinal
Compare Ordinal Byte
Compare Ordinal Short
src1,
src2
reg/lit
reg/lit

Table 6-8. Condition Code Settings

Condition Code
100
2
010
2
001
2
followed
by
a
branch-if
and the compare-ordinal-and-branch instructions.
;
2
;
2
;
2
Refer to
INSTRUCTION SET REFERENCE
Comparison
src1 < src2
src1 = src2
src1 > src2
instruction
is
equivalent
section 6.1.6, "Faults" (pg.
6
to
a
6-5).
6-33

Advertisement

Table of Contents
loading

Table of Contents