bchg

Sizes

byte, long

Affected Flags

X
N
Z
V
C
-
-
✱
-
-

Operands

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

Inverts the bit of the second operand at the position of the value of the first operand

* --- Toggles the specified bit ---
move.l #%0001, d0
bchg #0, d0 ; bit 0 was 1, now 0. Z flag clear (old value)
bchg #0, d0 ; bit 0 was 0, now 1. Z flag set (old value)

move.l #%0000, d1
bchg #3, d1 ; bit 3 was 0, now 1. Z flag set