SAM47 INSTRUCTION SET
KS57C2308/P2308/C2316/P2316
5-90
XCH
— Exchange A or EA with Nibble or Byte
XCH
dst,src
Operation:
Operand
Operation Summary
Bytes
Cycles
A,DA
Exchange A and data memory contents
2
2
A,Ra
Exchange A and register (Ra) contents
1
1
A,@RRa
Exchange A and indirect data memory
1
1
EA,DA
Exchange EA and direct data memory contents
2
2
EA,RRb
Exchange EA and register pair (RRb) contents
2
2
EA,@HL
Exchange EA and indirect data memory contents
2
2
Description:
The instruction XCH loads the accumulator with the contents of the indicated destination variable
and writes the original contents of the accumulator to the source.
Operand
Binary Code
Operation Notation
A,DA
0
1
1
1
1
0
0
1
A
↔
DA
a7
a6
a5
a4
a3
a2
a1
a0
A,Ra
0
1
1
0
1
r2
r1
r0
A
↔
Ra
A,@RRa
0
1
1
1
1
i2
i1
i0
A
↔
(RRa)
EA,DA
1
1
0
0
1
1
1
1
A
↔
DA,E
↔
DA + 1
a7
a6
a5
a4
a3
a2
a1
a0
EA,RRb
1
1
0
1
1
1
0
0
EA
↔
RRb
1
1
1
0
0
r2
r1
0
EA,@HL
1
1
0
1
1
1
0
0
A
↔
(HL), E
↔
(HL + 1)
0
0
0
0
0
0
0
1
Example:
Double register HL contains the address 20H. The accumulator contains the value 3FH
(00111111B) and internal RAM location 20H the value 75H (01110101B). The instruction
XCH
EA,@HL
leaves RAM location 20H with the value 3FH (00111111B) and the extended accumulator with
the value 75H (01110101B).
Summary of Contents for C2316
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......