Download Print this page

Omron NS Reference Manual page 56

Hide thumbs Also See for NS:

Advertisement

Section2 Functions
NS series Macro Reference
SWAPL
Swaps high order (2byte) and low order (2byte) of the specified long word
data
Applicable versions System version 4 or higher
Format
Function
Return Value
Example
SWAPL(S,n)
Swap high order (2 byte) and low order (2 byte) of the long word data or the internal
holding word which was taken n long word from S.
S: Top address ($W or $HW) to be swapped. (See note.)
n: The number of words to be swapped.
Setting range is as follows:
When specifying "n" directly : 1 to 16384
When specifying "n" indirectly: $W0 to $W32767
Note: Index can be set when using address to specify for S. Setting range is for $W
is between 0 and 32767 and for $HW is between 0 to 8191..
None
SWAPL ($W100, 3);
Swap high order and low order of the word data which was taken from 3 long words
from $W100.
<Before executing SWAPL>
$W100
1
2
$W101
5
6
$W102
9
0
$W103
3
4
$W104
7
8
$W105
1
2
$HW0 to $HW8191
3
4
7
8
Sw ap high
order and low
1
2
order of long
w ord data
5
6
9
0
3
4
36
<After executing SWAPL>
$W100
5
6
7
$W101
1
2
3
$W102
3
4
5
$W103
9
0
1
$W104
1
2
3
$W105
7
8
9
8
4
6
2
4
0

Advertisement

loading

This manual is also suitable for:

Ns-series