Renesas Electronics
XCHG
Exchanging values
eXCHanGe
[Syntax]
XCHG src, dest
[Operation]
tmp = src;
src = dest;
dest = tmp;
[Function]
-
This instruction exchanges the contents of src and dest as listed in the following table.
[Instruction Format]
Syntax
Processng Size
src
dest
Code size
(Byte)
L
Rs
Rd
3
[Rs].memex
3 (memex == UB)
4 (memex != UB)
dsp:8[Rs].memex
4 (memex == UB)
5 (memex != UB)
dsp:16[Rs].memex
5 (memex == UB)
6 (memex != UB)
[Flag Change]
This instruction does not affect the states of flags.
[Description Example]
XCHG R1, R2
XCHG [R1].W, R2