AH500 Programming Manual
6-218
API Instruction code Operand
Function
0901 D RCR P
D, n
Rotating to the right with the carry
flag
Device
X Y M S T C HC D L SM SR E PR K 16#
“$” DF
16-bit instruction (5 steps)
32-bit instruction (5 steps)
Symbol:
D
:
Device which is rotated Word/Double word
n
:
Number of bits forming a
group
Word/Double word
Explanation:
1. The values of the bits in the device specified by D are divided into groups (n bits as a group),
and these groups are rotated to the right with the carry flag SM602.
2. Only the 32-bit instructions can use the 32-bit counter.
3. The operand n used in the 16-bit instruction should be within the range between 1 and 16. The
operand n used in the 32-bit instruction should be within the range between 1 and 32.
4. Generally, the pulse instructions RCRP and DRCRP are used.
Example:
When X0.0 is switched from OFF to ON, the values of the bits in D10 are divided into groups (four
bits as a group), and these groups are rotated to the right with the carry flag SM602. (The value of
the bit marked ※ is transmitted to the carry flag SM602.)
Carry flag
Carry flag
A
fter the rotation is executed
0
0 0 0 1 1 1 1 0 0 0 0 0 1 1
0
1 1 0
1
※
0
b0b15
b0
b15
1
0
0 0 0 1 1 1 1 0 0 0 0