XOR

From ArchaicPixels: HuC and PCEAS Documentation

Jump to: navigation, search

Exclusive OR, an operation that creates an output by comparing each bit in an input with the corresponding bit of the other input: if the two compared bits are both set, the output is 0; if one bit is 1 and the other is 0, then the output is 1; if both bits are 0, then the output is 0.

Examples:

0 XOR 0 = 0

0 XOR 1 = 1

1 XOR 0 = 1

1 XOR 1 = 0

$FF XOR $FF = 0

$00 XOR $00 = 0

$FF XOR $80 = $7F

Personal tools