EasyManua.ls Logo

LS Industrial Systems XBC-E Series - Rotation Instruction

LS Industrial Systems XBC-E Series
542 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 6 Instruction Details
XBC E-Type Main Unit 6-140 Ve r. 1
6.25 Rotation Instruction
6.25.1 ROL, ROLP, DROL, DROLP
Instruction
Area Available
Step
Flag
P M K F L T C S Z D.x
R.x
Co
nst.
U N D R
Error
(F110)
Zero
(F111)
Carry
(F112)
ROL(P)
DROL(P)
D
O
O
O
-
O
O
O
-
O
-
-
-
O
O
O
O
2~4 - - O
n
O
O
O
-
O
O
O
-
O
-
-
O
O
O
O
O
Operand
Description
Data Type
D
Data address to perform operation.
WORD/DWORD
n
Number of bits to rotate to the left.
WORD
[Flag Set]
Flag Description
Device
Number
Carry
If Carry is caused during rotation, Carry Flag will be set.
F112
1) ROL (Rotate Left)
(1) Rotates D’s 16 Bits for the number of bits specified to the left, bit by bit. The highest bit will rotate to Carry
Flag (F112) and the lowest bit. (Rotation within 1 word)
2) DROL (Double Rotate Left)
(1) Rotates D and D+1’s 32 Bits data for n bits to the left, not including Carry Flag.
b30 b
29 b28 b27 b18
b17 b16 b15 b14b31
b5 b4 b3 b2 b1 b0
Rotation for n bits
(F112)
Carry Flag
D+1
D
3) Program Example
(1) For P1000=h1234, when Input signal P00000 is changed to On from Off status, it rotates 4 bits to the left
bit by bit and then h2341 will be saved in P1000.
ROLP P1000 4
P00000
ROL, DROL
ROLP, DROLP
D
means
ROL/DROL
P
D
n
n
Command
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
1
0
Carry Flag
Rotation to the left
b15
b0
Command

Table of Contents

Related product manuals