Справочник Пользователя для Mitsubishi Electronics FXCPU

Скачать
Страница из 838
19 Applied Instructions (Data Operation 2)
19.6 SWAP / Byte Swap
510
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
19.6
SWAP / Byte Swap
Outline
This instruction swaps higher 8 bits and lower 8 bits of word data.
1. Format and operation, execution form
2. Set data
3. Applicable devices
S: Refer to "Cautions".
Function and operation explanation
1. 16-bit operation (SWAP, SWAPP, DSWAP, DSWAPP)
This instruction swaps lower 8 bits and higher 8 bits.
FX
3U(C)
FX
3G(C)
FX
3S
FX
2N(C)
FX
1N(C)
FX
1S
FX
U
/FX
2C
FX
0N
FX
0(S)
Instruction 
name
Operation
Execution 
form
Expression in each language
Structured ladder/FBD
ST
SWAP
16 bits
Continuous
SWAP(EN,s);
SWAPP
16 bits
Pulse
SWAPP(EN,s);
DSWAP
32 bits
Continuous
DSWAP(EN,s);
DSWAPP
32 bits
Pulse
DSWAPP(EN,s);
Variable
Description
Data type
16-bit 
operation
32-bit 
operation
Input
variable
EN
Execution condition
Bit
Device for swapping higher and lower bytes.
ANY16
ANY32
Output
variable
ENO
Execution state
Bit
Operand 
type
Bit Devices
Word Devices
Others
System user
Digit designation
Special unit
Index
Index
Cons
tant
Real 
Number
Character 
String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS T C D R U
\G
V Z Modifier K H
E
"
"
P
z
z
z z z z
S1
S1
z z
z
SWAP
EN
ENO
s
SWAPP
EN
ENO
s
DSWAP
EN
ENO
s
DSWAPP
EN
ENO
s
Higher 8 bits
Lower 8 bits
SWAPP
EN
ENO
 
Command 
input
Device for swapping higher 
and lower bytes.
s