Chapter 6 Instruction Details
XBC E-Type Main Unit
6-159
Ver. 1
6.27.3 SWAP, SWAPP
Instruction
Area Available
Step
Flag
P M K F L T C S Z D.x R.x
Co
nst.
U N D R
Error
(F110)
Zero
(F111)
Carry
(F112)
SWAP(P) D O O O - O -
-
-
-
-
-
- O O O O
2
-
-
-
Operand
Description
Data Type
D
Word address of data to exchange byte upper and lower
WORD
1) SWAP
(1) Exchanges byte upper and lower in a word.
0
Upper byte
D
D
0
1
0
0
1
0
0
1
0
0
0
1
0
0
1
1
0
0
1
0
0
1
0
1
0
1
0
0
1
0
0
Lower byte
2) Program Example
(1) Input Signal P00000 is changed from Off to On, 1-word data in D00100’s upper byte and lower byte is
exchanged and then saved in P00100 again.
SWAP D00100
P00000
SWAP
SWAPP
D
means
SWAP
P D
Command
Command
0
Upper byte
D100
D100
0
1
0
0
0
0
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
0
0
1
0
0
0
0
0
Lower byte
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...