318
6 BASIC INSTRUCTIONS
6.4 Data Transfer Instructions
Upper and lower byte exchanges
SWAP(P)
• Exchanges the higher and lower 8 bits of the device designated by (D).
• There is no operation error in the SWAP(P) instruction.
• The following program exchanges the higher 8 bits and lower 8 bits of R10 when X10 goes ON.
(D): Head number of the devices where the data is stored (BIN 16 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant Others
Bit Word Bit Word
(D)
[Ladder Mode] [List Mode]
[Operation]
Basic
Process
High
performance
Redundant
Universal
LCPU
Command
Command
SWAP
SWAPP
D
D
SWAP
SWAPP
0 1 0 1 1 0 1 00 110
b11 b8b15 b12
1 0 1 0
b7 b4 b0b3
11 1111
b11 b8b15 b12
11
b7 b4 b0b3
00 000000
D
D
Step
Instruction
Device
0000 11110 000
b11 b8b15 b12
1111
b7 b4 b0b3
11 0011
b11 b8b15 b12
00
b7 b4 b0b3
11 0011 00
R10
R10