269
CHAPTER 11 INSTRUCTION SET
XCH XA,@HL
Function: A <–> (HL), X <–> (HL+1)
Exchanges the contents of the A register with the data at the data memory location addressed by the HL
register pair, and exchanges the contents of the X register with the data at the next memory address.
However, if the contents of the L register are odd- numbered, an address with the low-order bit ignored
is specified.
XCH A,mem
Function: A <–> (mem) mem = D7-0: 00H-FEH
Exchanges the contents of the A register with the data at the data memory location addressed by the 8-
bit immediate data mem.
XCH XA,mem
Function: A <–> (mem), X <–> (mem+1) mem = D7-0: 00H-FEH
Exchanges the contents of the A register with the data at the data memory location addressed by the 8-
bit immediate data mem, and exchanges the contents of the X register 1 with the data at the next memory
address.
An even address can be specified with mem.
XCH A,reg1
Function: A <–> reg1
Exchanges the contents of the A register with register reg1 (X, H, L, D, E, B, C).
XCH XA,rp’
Function: XA <–> rp’
Exchanges the contents of the XA register pair with the contents of register pair rp’ (XA, HL, DE, BC, XA’,
HL’, DE’, BC’).