340
SFR, SFRP, SFL, SFLP
SFL
(1) Shifts 16-bit data at device designated by n bits to the left.
Bits starting from the lowest bit to n bit are filled with 0s.
(2) When a bit device is designated for , a left shift is executed within the device range specified by digit specification.
The number of bits by which a shift is executed is the remainder of n/(specified number of bits). For example, when n
15 and (specified number of bits) 8 bits, the remainder of 15/8 1 is "7", and the data is shifted 7 bits.
(3) Specify any of 0 to 15 as n. If the value specified as n is 16 or greater, the remainder of n/16 is used for a shift to the left.
For example, when n 18, the data is shifted 2 bits to the left since the remainder of 18/16 1 is "2".
Operation Error
(1) There is no operation error in the SFR(P) or SFL(P) instruction.
Program Example
(1) The following program shifts the data of D0 to the right by the number of bits designated by D100 when X20 is turned
ON.
[Ladder Mode]
[List Mode]
[Operation]
(2) The following program shifts the contents of X10 to X17 3 bits to the left when X1C is ON.
[Ladder Mode]
[List Mode]
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
Carr
y
flag
(
SM700
)
Filled with 0s.
W
hen n=8:
D
D
D
0
0
1
1
0
0
1
1
1
0
0
1
1
0
0
0
X14 X13
X13
X14
1
X17
X10
X17
X10
Carr
y
flag
(
SM700
)
Filled with 0s.
X12
Step
Instruction
Device
0
1
0
1
0
1
1
1
0
0
1
0
1
0
0
0
b14 b13b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0
b15
Carr
y
flag
(
SM700
)
Filled with 0s.
1
0
0
0
0
1
0
0
1
1
1
0
0
1
0
1
b14 b13b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
b15
D100
D0
D0
3
Step
Instruction
Device