7-42
7.3 Shift Instructions
7.3.1 n-bit right/left shift of 16-bit data
SFR, SFL
(2) When a bit device is specified for
, a right shift is performed within the device range
of points by digit specification.
The number of bits that shift is the remainder of n divided by ‘number of points by digit
specification’.
For example, when n 15 and ‘number of points by digit specification’ 8 bits, the
remainder of 15/8 1 is 7, thus the data are shifted 7 bits.
(3) Specify any of 0 to 15 for n.
If the value specified for n is 16 or higher, the remainder of n divided by 16 is used for right
shift.
For example, when n 18, the remainder of 18/16 1 is 2, thus the data are shifted 2 bits to
the right.
SFL(P)
(1) Shifts 16-bit data in the device specified for
n bits to the left.
The n bits from the lowest bit become 0.
(2) When a bit device is specified for
, a left shift is performed within the device range set by
digit specification.
The number of bits that shift is the remainder of n divided by ‘number of points by digit
specification’. For example, when n 15 and ‘number of points by digit specification’ 8
bits, the remainder of 15/8 1 is 7, thus the data are shifted 7 bits.
(3) Specify any of 0 to 15 for n.
If the value specified for n is 16 or higher, the remainder of n divided by 16 is used for left
shift.
For example, when n 18, the remainder of 18/16 1 is 2, thus the data are shifted 2 bits
to the left.
O
peration Error
No operation error occurs in the execution of the SFR(P) and SFL(P) instructions.
d
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
1
0
Y18
Y10
Y17
Y10
Y17
Y18
1
Y1
B
Y14 Y13
Y1
B
Y14 Y13
C
arr
y
f
l
ag
(SM700)
W
hen
n
= 4:
Become
0
d
1
1
1
1
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
b15
b8
b0
b7
b0
b7
b15
b8
1
b14 b13 b12 b11b10 b9
b6 b5 b4 b3 b2 b1
b14 b13 b12 b11b10 b9
b6 b5 b4 b3 b2 b1
C
arr
y
f
l
ag
(SM700)
Become
0
W
hen
n
=8:
d
d
d
0
0
1
1
0
0
1
1
1
0
0
1
1
0
0
0
X
14
X
13
X
13
X
14
1
X
17
X
10
X
17
X
10
C
arr
y
f
l
ag
(SM700)
Become
0
X
12
W
hen
n
=5:
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......