
Chapter 5. Application instructions
5-36
5.6
Shift instructions
5.6.1
BSFT, BSFTP
BSFT
(Bit shift)
FUN(74) BSFT
FUN(75) BSFTP
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*
BSFT(P)
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 bit.
-
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
S1
Th e start bit of block to be
shifted
S2
BSFT
S1
S2
BSFTP
S1
S2
S1
S2
The end bit of block to be
shifted
n bits
0
0
1
1
1
0
0
0
1
1
0
1
0
0
1
0
[ S2 ]
[ S1 ]
0
0
1
1
1
0
0
0
1
1
0
1
0
0
1
0
[ S2 ]
[ S1 ]
0 is entered
Erased
When [ S1 ] is
lower than [ S2 ]
n bits
0
0
1
1
1
0
0
0
1
1
0
1
0
0
1
0
[ S1 ]
[ S2 ]
0
0
0
1
1
1
0
0
0
1
1
0
1
0
0
0
[ S1 ]
[ S2 ]
0 is entered
Erased
When [ S1 ] is
higher than [ S2 ]