EOR Instruction



EOR performs an exclusive OR between a data register and the memory. EOR gives the result (binary) 1 if one, and only one, of the operators are 1 (compare with OR). The data register must be the source and the effective address the destination.

ADDRESS METHODS: Dn, (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l

DATA LENGTH: Byte, word, longword


FLAGS: X - U
N - S
Z - S
C - 0
V - 0

SYNTAX: EOR Dn,<ea>

EXAMPLE CODE:

   EOR    #%11110000,D0    if D0 contains 01010101, then after the EOR it would have 10100101

Use EOR to selectively invert bits in the destination. Each bit in the source operand that is 1 will cause the corresponding bit in the destination to be inverted. Each bit in the source that is 0 will leave the corresponding bit in the destination unchanged. For example:

SOURCE             1111    0101
DESTINATION        0011    0011
-----------        ----    ----
RESULT             1100    0110