320
7 APPLICATION INSTRUCTION
7.1 Rotation Instruction
Rotating 16-bit data to the left
ROL(P), RCL(P)
• ROL(P): These instructions rotate the 16-bit binary data in the device specified by (d) to the left by (n) bit(s) (not including
the carry flag).
• RCL(P): These instructions rotate the 16-bit binary data in the device specified by (d) to the left by (n) bit(s) (including the
carry flag).
*1 The ROL instruction is not supported by the ST language. Use ROL of the standard function.
Page 795 ROL(_E)
■Descriptions, ranges, and data types
■Applicable devices
■ROL(P)
• These instructions rotate the 16-bit binary data in the device specified by (d) to the left by (n) bit(s) (not including the carry
flag). The carry flag is on or off depending on the status prior to the execution of the instruction.
Ladder diagram Structured text
*1
ENO:=ROLP(EN,n,d);
ENO:=RCL(EN,n,d);
ENO:=RCLP(EN,n,d);
Operand Description Range Data type Data type (label)
(d) Head device number where the rotation target data is stored 16-bit signed binary ANY16
(n) Number of rotations 0 to 15 16-bit unsigned binary ANY16
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(d)
(n)
b0
b7
b15 b8b14 b13 b12 b11 b10 b9 b6
b5
b4 b3 b2 b1
0
0
1001000 0 0
0
0000
b0
b7
b15 b8b14 b13 b12 b11 b10 b9 b6
b5
b4 b3 b2 b1
1
0
0010000 0 0
0
0000
0
1
b0
b7
b15 b8b14 b13 b12 b11 b10 b9 b6
b5
b4 b3 b2 b1
0
0
1000000 0 0
0
0001
0
b0
b7
b15 b8b14 b13 b12 b11 b10 b9 b6
b5
b4 b3 b2 b1
(d)
(d)
(d)
(d)
Value of b15
Rotating n-bit data to the left
Rotating 1-bit data to the left
Rotating 1-bit data to the left
Value of b15
Value of b15
Value of b(16-n)
Carry flag (SM700, SM8022)
Carry flag (SM700, SM8022)
Carry flag (SM700, SM8022)
Carry flag (SM700, SM8022)
Value of b(16-n)
Value of b15