268
µPD750008 USER'S MANUAL
MOV reg1,A
Function: reg1 <– A
Transfers the contents of the A register to register reg1 (X, H, L, D, E, B, C).
MOV rp’1,XA
Function: rp’1 <– XA
Transfers the contents of the XA register pair to register pair rp’1 (HL, DE, BC, XA’, HL’, DE’, BC’).
XCH A,@HL
XCH A,@HL+
XCH A,@HL–
XCH A,@rpa1
Function: A <–> (Register pair specified by the operand)
When HL+ is specified for the register pair: Skip if L = 0
When HL– is specified for the register pair: Skip if L = FH
Exchanges the contents of the A register with the data at the data memory location addressed by the
specified register pair (HL, HL+, HL– , DE, DL).
When HL+ (automatic increment) is specified for the register pair, automatically increments the contents
of the L register by one after the data exchange, and continues the operation until the contents are set to 0.
Then skips the immediately following instruction.
When HL– (automatic decrement) is specified for the register pair, automatically decrements the contents
of the L register by one after the data exchange, and continues the operation until the contents are set to FH.
Then skips the immediately following instruction.
Example The data at addresses 20H-2FH are exchanged with the data at addresses 30H-3FH.
SEL MB0
MOV D,#2
MOV HL,#30H
LOOP: XCH A,@HL ; A <–> (3x)
XCH A,@DL ; A <–> (2x)
XCH A,@HL+ ; A <–> (3x)
BR LOOP
*
*
*
*