First page Back Continue Last page Overview Graphics
Logic Instructions: Exclusive-OR
EXOR - Performs a bit-by-bit exclusive OR operation (EX-OR).
An EX-OR gate output is high if either but not both of the inputs is high.
Destination registers are A (EORA) or B (EORB).
All addressing modes are available.
What is the value in A after the following code executes?
- ldaa #$bb
- eora #$f0
The truth table (A and B are inputs and X is an output) for an EX-OR gate is:
A B X
0 0 0
0 1 1
1 0 1
1 1 0
The eora instruction performs a bit-by-bit EX-ORing of the bits in the destination register with the operand. In this example bit 0 of register A is EX-ORed with bit 0 of the number f0 hex, and bit 1 of A is EX-ORed with bit 1 of the number f0 hex etc.