neg
Sizes
byte, word, long
Default Size
word
Affected Flags
X
N
Z
V
C
✱
✱
✱
✱
✱
Operands
Op 1
Dn/(An)/d(An)/Ea/<label>/d(An,Xn)
Flips the sign of the operand, depending on the specified size, defaults to word
Flips the sign of the operand, depending on the specified size, defaults to word
move.b #1, d0
neg.b d0 ; d0 low byte = $FF (-1)
move.l #$7F, d1
neg.b d1 ; d1 low byte = $81 (-127), V flag set
* --- Negating zero ---
move.l #0, d2
neg.l d2 ; d2 = 0, Z flag set
* --- Size matters ---
move.l #$100, d3
neg.b d3 ; only negates low byte (was $00)