Shift Instructions 7.3.1 N-Bit Right/Left Shift Of 16-Bit Data - Mitsubishi MELSEC-Q Series Programming Manual

Hide thumbs Also See for MELSEC-Q Series:
Table of Contents

Advertisement

SFR, SFL
(2) When a bit device is specified for
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
remainder of 15/8
(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
the right.
SFL(P)
(1) Shifts 16-bit data in the device specified for
The n bits from the lowest bit become 0.
Carry flag
(2) When a bit device is specified for
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
bits, the remainder of 15/8
(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
to the left.
Operation Error
No operation error occurs in the execution of the SFR(P) and SFL(P) instructions.
7.3 Shift Instructions
7-42
7.3.1 n-bit right/left shift of 16-bit data
Y1B
Y18
Y17
1
0
1
0
1
When n = 4:
Y1B
Y18
Y17
0
0
0
0
1
Become 0
15 and 'number of points by digit specification'
1 is 7, thus the data are shifted 7 bits.
18, the remainder of 18/16
b15
b14 b13 b12 b11b10 b9
1
1
1
(SM700)
b15
b14 b13 b12 b11b10 b9
1
0
0
0
Carry flag
(SM700)
1
1 is 7, thus the data are shifted 7 bits.
18, the remainder of 18/16
, a right shift is performed within the device range
d
Y14 Y13
Y10
0
1
0
1
0
1
0
Y14 Y13
Y10
0
1
0
1
0
1
0
1 is 2, thus the data are shifted 2 bits to
n bits to the left.
d
b8
b7
b6 b5 b4 b3 b2 b1
1
0
0
1
1
0
0
0
b8
b7
b6 b5 b4 b3 b2 b1
0
1
1
1
1
0
0
0
Become 0
, a left shift is performed within the device range set by
d
X17
X14
X13
0
0
1
1
0
0
1
X17
X14 X13
X12
1
0
0
1
1
0
0
Become 0
15 and 'number of points by digit specification'
1 is 2, thus the data are shifted 2 bits
Carry flag
(SM700)
1
8 bits, the
b0
0
1
1
1
1
d
When n=8:
b0
d
0
0
0
0
0
X10
1
When n=5:
X10
0
8

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qcpu

Table of Contents