Chapter
3.
Instruction
Set
XRA
3-66
Example:
Assume that the
Hand
L registers contain 1234H, and the D and E registers contain
OABCDH.
Following
execution of the
XCHG
instruction,
Hand
L contain OABCDH, and D and E contain 1234H.
EXCLUSIVE
OR
WITH
ACCUMULATOR
XRA performs an exclusive OR logical operation using the contents of the specified byte and the accumulator.
The result
is
pldced
in
the accumulator.
Summary
of
Logical Operations
AND
produces a one bit
in
the
I"esult
only when the corresponding bits
in
the test data and the mask data are
ones.
OR produces a one bit
in
the result when the corresponding bits
in
either the test data
or
the mask data are
ones.
Exclusive
OR produces a one bit only when the corresponding bits
in
the test data and the mask data are
different; i.e.,
a one bit
in
either the test data or the mask data
--
but
not both - produces a one bit
in
the
resu I
t.
AND
1010 1010
0000
1111
0000 1010
XRA
Register with
Accumulator
Opcode
XRA
OR
1010
1010
0000
1111
1010 1111
Operand
reg
EXCLUSIVE
OR
10101010
0000 1111
10100101
The operand must specify one
of
the registers A through
E,
H or
L.
This instruction performs
an
exclusive OR
using the contents of the specified register and the accumuldtor and stores the result
in
the accumulator. The
carry and auxiliary carry
flags are reset to zero.
o
Cycles:
States:
Addressing:
Flags:
o
S
S~
4
regis ter
Z,S,P,CY,AC