
MicroBlaze Processor Reference Guide
189
UG081 (v14.7)
Instructions
cmp
Integer Compare
Description
The contents of register rA is subtracted from the contents of register rB and the result is placed into
register rD.
The MSB bit of rD is adjusted to shown true relation between rA and rB. If the U bit is set, rA and
rB is considered unsigned values. If the U bit is clear, rA and rB is considered signed values.
Pseudocode
(rD)
←
(rB) +
(rA) + 1
(rD)(MSB)
←
(rA) > (rB)
Registers Altered
•
rD
Latency
•
1 cycle
cmp
rD, rA, rB
compare rB with rA (signed)
cmpu
rD, rA, rB
compare rB with rA (unsigned)
0 0 0 1 0 1
rD
rA
rB
0 0 0 0 0 0 0 0 0 U 1
0
6
1
1
1
6
2
1
3
1