7-32
7.2 Rotation Instructions
7.2.2 Left rotation of 16-bit data
ROL, RCL
Function
ROL(P)
(1) Rotates 16-bit data of the device specified for
, not including the carry flag, n bits to the
left.
The carry flag turns ON or OFF depending on its status prior to the execution of the ROL
instruction.
(2) When a bit device is specified for
, a rotation is performed within the device range of
points by digit specification.
The number of bits that rotate 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’ 12 bits, the
remainder of 15/12 1 is 3, thus the data are rotated 3 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
rotation.
For example, when n 18, the remainder of 18/16 1 is 2, thus the data are rotated 2 bits
to the left.
d
b9
b15
b10
b14 b13 b12 b11
b8 b7 b6 b5 b4 b3 b2 b1 b0
b9
b15
b10
b14 b13 b12 b11
b8 b7 b6 b5 b4 b3 b2 b1 b0
b9
b15
b10
b14 b13 b12 b11
b8 b7 b6 b5 b4 b3 b2 b1 b0
b9
b15
b10
b14 b13 b12 b11
b8 b7 b6 b5 b4 b3 b2 b1 b0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
C
arr
y
f
l
ag
(SM700)
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
d
d
d
d
Va
l
ue
of
b15
C
arr
y
f
l
ag
(SM700)
L
eft
rotat
i
on
(1 bi
t
)
L
eft
rotat
i
on
(1 bi
t
)
1
Va
l
ue
of
b15
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
Va
l
ue
of
b15
C
arr
y
f
l
ag
(SM700)
0
Va
l
ue
of
b15
Va
l
ue
of
b(16-
n
)
Va
l
ue
of
b(16-
n
)
C
arr
y
f
l
ag
(SM700)
L
eft
rotat
i
on
(
n
bi
ts
)
d
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: ......