Propeller Manual

Table Of Contents
CMPX – Assembly Language Reference
CMPX
Instruction: Compare two unsigned values plus C.
CMPX Value1, # Value2
Result: Optionally, equality and greater/lesser status is written to the Z and C flags.
Value1 (d-field) is the register containing the value to compare with that of Value2.
Value2 (s-field) is a register or a 9-bit literal whose value is compared with Value1.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– Z Result C Result Result Clocks
110011 000i 1111 ddddddddd sssssssss
Z & (D = S+C) Unsigned (D < S+C)
Not Written 4
Concise Truth Table:
In Out
Destination
1
Source
1
Z
C
Effects
Destination
2
Z C
$0000_0003; 3 $0000_0002; 2 x
0
wr wz wc
$0000_0001; 1 0 0
$0000_0003; 3 $0000_0002; 2 0
1
wr wz wc
$0000_0000; 0 0 0
$0000_0003; 3 $0000_0002; 2 1
1
wr wz wc
$0000_0000; 0 1 0
$0000_0003; 3 $0000_0003; 3 0
0
wr wz wc
$0000_0000; 0 0 0
$0000_0003; 3 $0000_0003; 3 1
0
wr wz wc
$0000_0000; 0 1 0
$0000_0003; 3 $0000_0003; 3 x
1
wr wz wc
$FFFF_FFFF; -1
3
0 1
$0000_0003; 3 $0000_0004; 4 x
0
wr wz wc
$FFFF_FFFF; -1
3
0 1
$0000_0003; 3 $0000_0004; 4 x
1
wr wz wc
$FFFF_FFFE; -2
3
0 1
$8000_0000; 2,147,483,648 $7FFF_FFFF; 2,147,483,647 0
0
wr wz wc
$0000_0001; 1 0
0
4
$7FFF_FFFF; 2,147,483,647 $8000_0000; 2,147,483,648 0
0
wr wz wc
$FFFF_FFFF; -1
3
0
1
4
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFF; 4,294,967,295 x
0
wr wz wc
$FFFF_FFFF; -1
3
0 1
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFF; 4,294,967,295 x
1
wr wz wc
$FFFF_FFFE; -2
3
0 1
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFE; 4,294,967,294 0
0
wr wz wc
$0000_0000; 0 0 0
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFE; 4,294,967,294 1
0
wr wz wc
$0000_0000; 0 1 0
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFE; 4,294,967,294 x
1
wr wz wc
$FFFF_FFFF; -1
3
0 1
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFD; 4,294,967,293 x
0
wr wz wc
$0000_0001; 1 0 0
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFD; 4,294,967,293 0
1
wr wz wc
$0000_0000; 0 0 0
$FFFF_FFFE; 4,294,967,294 $FFFF_FFFD; 4,294,967,293 1
1
wr wz wc
$0000_0000; 0 1 0
1
Both Source and Destination are treated as unsigned values.
2
Destination is not written unless the WR effect is given.
3
Destination Out (written Destination) may be thought of as either unsigned or signed; it is shown here as signed for demonstration
purposes only.
Page 280 · Propeller Manual v1.1