Shift Instruction; Sfr, Sfrp; N-Bit Shift To Right Of 16-Bit Data; N-Bit Shift To Left Of 16-Bit Data - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

7.3

Shift instruction

7.3.1

SFR, SFRP

n-bit shift to right of 16-bit data

7.3.1
SFL, SFLP

n-bit shift to left of 16-bit data

SFR, SFRP, SFL, SFLP
SFR, SFL
SFRP, SFLP
: Head number of the devices where shift data is stored (BIN 16 bits)
D
n
: Number of shifts (0 to 15) (BIN 16 bits)
Internal Devices
Setting
Data
Bit
D
n
Function
SFR
(1) Causes a shift to the right by n bits of the 16-bit data from the device designated at
The n bits from the upper bit are filled with 0s.
b15
D
1
When n=6:
b15
0
D
(2) When a bit device is designated for
The number of bits by which a shift is executed is the remainder of n/(specified number of bits).
For example, when n
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
right.
For example, when n
Command
Command
R, ZR
Word
Bit
b14 b13 b12 b11b10 b9
b8
b7
1
1
0
1
1
1
0
1
b14 b13 b12 b11b10 b9
b8
b7
0
0
0
0
0
1
1
1
Filled with 0s.
, a right shift is executed within the device range specified by digit specification.
D
Y1B
Y18
Y17
1
0
1
0
1
0
1
When n = 4:
Y1B
Y18
Y17
0
0
0
0
0
1
1
Filled with 0s.
15 and (specified number of bits)
18, the data is shifted 2 bits to the right since the remainder of 18/16
High
Basic
performance
indicates an instruction symbol of SFR/SFL.
P
J
\
U
\G
Word
b6 b5 b4 b3 b2 b1
b0
1
1
0
1
1
1
0
b6 b5 b4 b3 b2 b1
b0
0
1
1
1
0
1
1
Y14 Y13
Y10
0
1
0
1
0
Carry flag
(SM700)
Y14 Y13
Y10
0
0
0
1
1
8 bits, the remainder of 15/8
SFR, SFRP, SFL, SFLP
Process
Redundant Universal
LCPU
n
D
D
n
Constants
Zn
Other
K, H
––
.
D
Carry flag
(SM700)
1
1
1 is "7", and the data is
1 is 2.
1
2
3
4
4
––
––
6
7
8
339

Advertisement

Table of Contents
loading

Table of Contents