Chapter 6 Instruction Details
XBC E-Type Main Unit
6-146
Ver. 1
6.25.7 RCR, RCRP, DRCR, DRCRP
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)
RCR(P)
DRCR(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 right.
WORD
[Flag Set]
Flag
Description
Device
Number
Carry
If Carry is caused during rotation, Carry Flag will be set.
F112
1) RCR (Rotate Right with carry)
(1) Rotates word data D’s individual bit for the number of N to the right bit by bit. The highest bit data moves to
Carry Flag (F112) and the original Carry Flag (F112) moves to the lowest bit. (Rotation within 1 word)
2) DRCR (Double Rotate Right with carry)
(1) Rotates D and D+1’s 32 bits data for n bits to the right, 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=hF, when Input Signal P00000 is changed to On from Off status, it rotates 4 bits to the right bit by
bit and then h0000 will be saved in P1000 and Carry Flag will be set.
RCRP P1000 4
P00000
RCR, DRCR
RCRP, DRCRP
D
means
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...