
Chapter 5. Application instructions
5-38
5.6.2
WSFT, WSFTP
WSFT
(Word shift)
FUN(70) WSFT
FUN(71) WSFTP
Applicable
CPU
All CPUs
Available Device
Flag
Instructions
M
P
K
L
F
T
C
S
D
#D Integer
Steps
Error
(F110)
Zero
(F111)
Carry
(F112)
O O O O*
O O
O O
WSFT(P)
O O O O*
O O
O O
5
O
* Available only when do not use computer link module or data link module
1) Functions
-
Shifts the block specified as [ S1 ] ~ [ S2 ] by 1 word.
-
The direction of shift is from [ S1 ] to [ S2 ]. Therefore, if [ S1 ] is lower than [ S2 ], the block is
shifted in left direction. Otherwise, the block is shifted in right direction.
Operand setting
The start word of block to
be shifted
WSFT
S1
S2
WSFTP
S1
S2
S1
S2
The end word of block to be
shifted
n words
[ S2 ]
[ S1 ]
h0000 is entered
Erased
When [ S1 ] is
lower than [ S2 ]
S1
S2
[ S1-1 ]
[ S2+1 ]
[ S2 ]
[ S1 ]
[ S1-1 ]
[ S2+1 ]
n words
[ S1 ]
[ S2 ]
h0000 is entered
Erased
When [ S1 ] is
higher than [ S2 ]
[ S2-1 ]
[ S1+1 ]
[ S1 ]
[ S2 ]
[ S2-1 ]
[ S1+1 ]