7-30
7.2 Rotation Instructions
7.2.1 Right rotation of 16-bit data
ROR, RCR
O
peration Error
No operation error occurs in the execution of the ROR(P) and RCR(P) instructions.
Program Example
(1) In the following program, the data in Var_D0 are rotated, not including the carry flag, 3 bits to
the right, when X0C turns ON.
[Structured ladder]
[ST]
RORP(X0C,3,Var_D0);
[Operation]
(2) In the following program, the data in Var_D0 are rotated, including the carry flag, 3 bits to the
right, when X0C turns ON.
[Structured ladder]
[ST]
RCRP(X0C,3,Var_D0);
[Operation]
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
b15
b8
b0
b7
b0
b7
b15
b8
0
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)
C
arr
y
f
l
ag
(SM700)
C
ontents
of
b2
to
b0
b
efore
execut
i
on
C
ontents
of
b15
to
b4
b
efore
execut
i
on
C
ontent
of
b3
b
efore
execut
i
on
C
ontent
of
b2
b
efore
execut
i
on
Var
_
D
0
Var
_
D
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
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)
C
arr
y
f
l
ag
(SM700)
C
ontents
of
b1
an
d b0
b
efore
execut
i
on
C
ontents
of
b15
to
b4
b
efore
execut
i
on
C
ontent
of
b3
b
efore
execut
i
on
C
ontent
of
b2
b
efore
execut
i
on
C
ontent
of
carr
y
f
l
ag
SM700
ON/OFF
status
of
the
carr
y
f
l
ag
d
epen
d
s
on
i
ts
status
b
efore
the
execut
i
on
of
RCR i
nstruct
i
on
.
Var
_
D
0
Var
_
D
0
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: ......