Instruction Set
C500 Family
Semiconductor Group
4-78
1998-04-01
XCHD
A,@Ri
Function:
Exchange digit
Description:
XCHD exchanges the low-order nibble of the accumulator (bits 3-0, generally
representing a hexadecimal or BCD digit), with that of the internal RAM location
indirectly addressed by the specified register. The high-order nibbles (bits 7-4) of
each register are not affected. No flags are affected.
Example:
R0 contains the address 20H. The accumulator holds the value 36H (00110110B).
Internal RAM location 20H holds the value 75H (01110101B). The instruction
XCHD
A, @ R0
will leave RAM location 20H holding the value 76H (01110110B) and 35H
(00110101B) in the accumulator.
Operation:
XCHD
(A3-0)
((Ri)3-0)
Bytes:
1
Cycles:
1
Encoding:
1 1 0 1
0 1 1 i
¬
®