A SERVICE OF

logo

8. Function Commands
RCR, RCRP
- 253 -
Program example
(1) Program to rotate the D10 data 3 bits to the right when M0 turns ON.
Coding
No. of
steps
Com-
mand
Device
10 LD M0
11 RCR D10 K3
D10
RCR K3
M0
10
(pulse coding)
14
B15 B14B13B12 B11B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
1
Carry flag
(SM12)
D10 before execution
D10 after execution
0
0
To carry flag
B0 before
execution
B0 when n=1
B0 when n=2
Transition
*
To carry flag
To carry flag
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
* 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 * 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 * 0 0 0 0 0 0 0 0 0 0 0 0 0
*The carry flag must be set to 1 or 0 before execution.
(n=1)
(n=2)
(n=3)
Right rotation of data using RCR command