
6F3B0253
7. Instructions
FUN 022
XCHG
Data exchange
Expression
Input − [ A XCHG B ]− Output
Function
When the input is ON, the data of A and the data of B is exchanged.
Execution condition
Input |
| Operation | Output |
OFF | No execution |
| OFF |
ON | Execution |
| ON |
Operand
| Name |
|
| Device |
|
|
|
|
|
|
| Register |
|
|
|
|
| Constant | Index | ||
|
| X | Y | R | S | T. | C. | XW | YW | RW | SW |
| T | C | D | I |
| J | K |
|
|
A | Operation data |
|
|
|
|
|
|
| √ | √ | √ | √ | √ | √ | √ | √ | √ |
|
| √ |
|
B | Operation data |
|
|
|
|
|
|
| √ | √ | √ | √ | √ | √ | √ | √ | √ |
|
| √ |
|
Example
When R005 is ON, the data of RW23 and D0100 is exchanged. If the original data of RW23 is 23456 and that of D0100 is 291, the operation result is as follows.
RW23
D0100
23456
291
RW23
D0100
291
23456
Before operation | After operation |
Basic Hardware and Function 139