BCHG
Operation
Toggles the indexed destination bit, sets Z when it was clear, and clears NCV.
Assembler Syntax
BCHG Rn(b), <ea>(e)
BCHG imm6(i), <ea>(e)
BCHG Rn(b), Rn(e)
BCHG imm6(i), Rn(e)
Privilege
Unprivileged
Repeat eligibility
REP eligible; REPcc observes computed
Complements the destination bit selected by the low six bits of the bit index, writes FLAGS.Z from whether that bit was previously clear, and clears FLAGS.N, FLAGS.C, and FLAGS.V. A memory destination is read by an ordinary selected-width load and updated by an ordinary selected-width store. The B-sized 0 or 1 value of the old tested bit supplies the REPcc observed value.
2.75in
Encodings
BCHG Rn(b), <ea>(e)
Format: Instruction format for BCHG Rn(b), <ea>(e)
dst — excluded: immediate [invalid_destination]
2.75in BCHG imm6(i), <ea>(e)
Format: Instruction format for BCHG imm6(i), <ea>(e)
dst — excluded: immediate [invalid_destination]
2.75in BCHG Rn(b), Rn(e)
Format: Instruction format for BCHG Rn(b), Rn(e)
2.75in BCHG imm6(i), Rn(e)
Format: Instruction format for BCHG imm6(i), Rn(e)