8. Function Commands
ROR, RORP
- 251 -
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 ROR D10 K3
D10ROR
K3
M0
10
(Pulse coding)
14
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
0
000
0
0
0
0
00
0
0
00 0
1
1
100000000 00
0
0
0
00
Carry flag
(SM12)
D10 before execution
D10 after execution
0
0100000
0
00
0
000
0
0
0001000
00
0
0
0
0
0
0
00
To B15
To B15
To B15
B0 before execution
B0 when n=1
B0 when n=2
Transition
(n=1)
(n=2)
(n=3)
Right rotation of data using ROR command