NEC PD754144 User Manual page 259

4-bit single-chip microcontrollers
Table of Contents

Advertisement

XCH A, @HL
Function: A
(HL)
Exchanges the contents of the A register with the contents of the data memory addressed by register pair HL.
XCH A, @HL+
(HL), L ← L+1
Function: A
skip if L = 0H
Exchanges the contents of the A register with the contents of the data memory addressed by register pair HL. Then,
the contents of the L register are automatically incremented by one, and if the contents of the L register become 0H
as a result, the next instruction is skipped.
XCH A, @HL–
(HL), L ← L–1
Function: A
skip if L = FH
Exchanges the contents of the A register with the contents of the data memory addressed by register pair HL. Then,
the contents of the L register are automatically decremented by one, and if the contents of the L register become
FH as a result, the next instruction is skipped.
XCH A, @rpa1
Function: A
(rpa)
Where rpa = HL+: skip if L = 0
Where rpa = HL–: sKIP if L = FH
Exchanges the contents of the A register with the contents of the data memory addressed by register pair rpa (HL,
HL+, HL–, DE, or DL). If autoincrement (HL+) or autodecrement (HL–) is specified as rpa, the contents of the L register
are automatically incremented or decremented by one after the data have been exchanged. If the result is 0 in the
case of HL+ and FH in the case of HL–, the next instruction is skipped.
Application example
To exchange the data at data memory addresses 20H to 2FH with the data at addresses 30H to 3FH
SEL
MB0
MOV
D, #2
MOV
HL, #30H
LOOP: XCH
A, @HL
XCH
A, @DL
XCH
A, @HL+
BR
LOOP
CHAPTER 11 INSTRUCTION SET
; A
(3×)
; A
(2×)
; A
(3×)
User's Manual U10676EJ3V0UM
259

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents