Skip to main content

xor

The xor instructions compute a bitwise and as shown in the table below. All flags are updated accordingly. Note that the carry and overflow flags are set iff (lhs ^ rhs)==0xff & carry_in==1 due to jankiness of the 74382's xor function mode.

InstructionEncodingSemanticsCycles
xor acc, reg801 110 rrraccacc XOR reg8\mathit{acc} \gets \mathit{acc}~\mathrm{XOR}~\mathit{reg8}3/41/52
xor acc, imm800 110 011 imm8accacc XOR imm8\mathit{acc} \gets \mathit{acc}~\mathrm{XOR}~\mathit{imm8}3
  1. 4 cycles for unprefixed xor acc, [pi]
  2. 5 cycles for xor acc, [pi] with prefix_a16 (the sequence prefix_a16; xor acc, [pi] takes 6 cycles)