cmpi

Sizes

byte, word, long

Default Size

word

Affected Flags

X
N
Z
V
C
-
✱
✱
✱
✱

Operands

Op 1
Im
Op 2
Dn/(An)/d(An)/Ea/<label>/d(An,Xn)

Compares the second operand with the first operand, it sets the flags accordingly which will be used by the branching instructions.

move.l #10, d0
cmpi.w #10, d0
seq d1 ; d1 = $FF (equal)

move.l #5, d2
cmpi.w #10, d2
slt d3 ; d3 = $FF (5 < 10)
sgt d4 ; d4 = $00