beautypg.com

Xch a, @hl, Xch a, mem, Xch xa, mem – NEC PD75402A User Manual

Page 172: Xch a, reg1

background image

161

CHAPTER 9. INSTRUCTION SET

XCH A, @HL

Function: A

(HL)

Exchanges the contents of the A register and the contents of the data memory addressed by the contents

of register pair HL.

Application example:

Exchange the data of data memory addresses 20H to 2FH and the data of addresses 30H

to 3FH.

MOV HL, #30H

LOOP: XCH

A, @HL

; A

(3

×

)

MOV H, #2

XCH

A, @HL

; A

(2

×

)

MOV H, #3

XCH

A, @HL

; A

(3

×

)

INCS L

; L

L + 1

BR

LOOP

XCH A, mem

Function: A

(mem); mem = D

7

to D

0

; 00H to 3FH

Exchanges the contents of the A register and the data memory contents addressed by 8-bit immediate data

mem.

XCH XA, mem

Function: A

(mem), X

(mem + 1); mem = D

7

to D

0

: 00H to 3EH

Exchanges the contents of the A register and the data memory contents addressed by 8-bit immediate data

mem and exchanges the contents of the X register and the contents of the next memory address.

mem can specify even addresses.

XCH A, reg1

Function: A

reg1

Exchanges the contents of the A register and the contents of register reg1 (X, H, L).

This manual is related to the following products: