10.16
CMP/cond
Compare
Format
CMP/EQ
Rm,Rn
CMP/GE
Rm,Rn
CMP/GT
Rm,Rn
CMP/HI
Rm,Rn
CMP/HS
Rm,Rn
CMP/PL
Rn
CMP/PZ
Rn
CMP/STR Rm,Rn
#imm,R0 If R0 = imm, 1 → T
CMP/EQ
Description
This instruction compares general registers Rn and Rm, and sets the T bit if the specified condition
(cond) is true. If the condition is false, the T bit is cleared. The contents of Rn are not changed.
Nine conditions can be specified. For the two conditions PZ and PL, Rn is compared with 0.
With the EQ condition, sign-extended 8-bit immediate data can be compared with R0. The
contents of R0 are not changed.
CoMPare conditionally
Summary of Operation
If Rn = Rm, 1 → T
If Rn ≥ Rm, signed, 1 → T
If Rn > Rm, signed, 1 → T
If Rn > Rm, unsigned, 1 → T 0011nnnnmmmm0110 1
If Rn ≥ Rm, unsigned, 1 → T 0011nnnnmmmm0010 1
If Rn > 0, 1 → T
If Rn ≥ 0, 1 → T
If any bytes are equal, 1 → T 0010nnnnmmmm1100 1
Arithmetic Instruction
Instruction Code
0011nnnnmmmm0000 1
0011nnnnmmmm0011 1
0011nnnnmmmm0111 1
0100nnnn00010101 1
0100nnnn00010001 1
10001000iiiiiiii 1
Rev. 2.0, 03/99, page 225 of 396
Execution
States
T Bit
Result of
comparison
Result of
comparison
Result of
comparison
Result of
comparison
Result of
comparison
Result of
comparison
Result of
comparison
Result of
comparison
Result of
comparison