Rol, Rolp, Rcl, Rclp Left Rotation Of 16-Bit Data - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

7.2.2
ROL, ROLP, RCL, RCLPLeft rotation of 16-bit data
7.2.2
ROL, ROLP, RCL, RCLP
ROL, RCL
ROLP, RCLP
: Head number of the devices to rotate (BIN 16 bits)
D
n
: Number of rotations (0 to 15) (BIN 32 bits)
Internal Devices
Setting
Data
Bit
D
n
Function
ROL
(1) Rotates the 16-bit data of the device designated at
The carry flag turns ON or OFF depending on its status prior to the execution of ROL instruction.
Carry flag
(SM700)
0
Carry flag
(SM700)
1
Value of b15
Carry flag
(SM700)
0
Value of b15
Carry flag
(SM700)
Value of b(16-n)
(2) When a bit device is designated for
The number of bits by which a rotation is executed is the remainder of n/(specified number of bits).
For example, when n
rotated 3 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 rotation.
For example, when n
Command
Command
R, ZR
Word
Bit
D
b15
b14 b13 b12 b11
1
0
1
0
0
b15
b14 b13 b12 b11
0
1
0
0
0
b15
b14 b13 b12 b11
1
0
0
0
0
b15
b14 b13 b12 b11
, a rotation is performed within the device range specified by digit specification.
D
15 and (specified number of bits)
18, the data is rotated 2 bits to the left since the remainder of 18/16
High
Basic
performance
indicates an instruction symbol of ROL/RCL.
P
J
\
U
\G
Word
, not including the carry flag, n-bits to the left.
b10
b9
b8 b7 b6 b5 b4 b3 b2 b1 b0
0
0
0
0
0
0
0
0
Left rotation (1 bit)
b10
b9
b8 b7 b6 b5 b4 b3 b2 b1 b0
0
0
0
0
0
0
0
0
Left rotation (1 bit)
b10
b9
b8 b7 b6 b5 b4 b3 b2 b1 b0
0
0
0
0
0
0
0
0
Left rotation (n bits)
b10
b9
b8 b7 b6 b5 b4 b3 b2 b1 b0
12 bits, the remainder of 15/12
ROL, ROLP, RCL, RCLP
Process
Redundant Universal
LCPU
D
n
n
D
Constants
Zn
K, H
––
0
0
0
D
0
0
1
D
Value of b15
0
1
0
D
Value of b15
D
Value of b(16-n)
1 is "3", and the data is
1 is "2".
1
2
3
4
Other
––
4
––
6
7
8
333

Advertisement

Table of Contents
loading

Table of Contents