Chapter 6 Instruction Details
XBC E-Type Main Unit
6-142
Ver. 1
6.25.3 ROR, RORP, DROR, DRORP
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)
ROR(P)
DROR(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) ROR (Rotate Right)
(1) Rotates D’s 16 bits for the number of bits specified to the right bit by bit. The lowest bit will rotate to Carry
Flag (F112) and the highest bit. (Rotation within 1 word)
2) DROR (Double Rotate Right)
(1) Rotates D and D+1’s 32 bits data for n bits to the right, not including Carry Flag.
b30 b29 b28 b27
b18 b17 b16 b15
b14
b31
b5 b4
b3
b2
b1 b0
Rotation for n bits
D+1
D
(F112)
Carry Flag
3) Program Example
(1) If P1000=h1234, Input Signal P00000 is changed to On from Off status, it rotates 4 bits to the right bit by
bit and then h4123 is saved in P1000.
RORP P1000 4
P00000
ROR,
DROR
RORP,
DRORP
D
means ROR/DROR
P D
n
n
Command
Command
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
1
0
Carry Flag
Rotation to the right
b15
b0
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...