DRCR
- 157 -
Program example
Program to rotate the D10, 11 details 3 bits to the right when M0 turns ON.
Coding
No. of
steps
Com-
mand
Device
10 LD XA
11 DMOV K1 D10
15 LD M0
16 DRCR D10 K3
K1DMOV D10
XA
D10DRCR
K3
M0
(pulse coding)
10
15
19
Before execution
After execution
Transition
Carry flag
(SM12)
B15B31B30 B29 B16 B2 B1 B0
D10D11
B28B27 B5 B4 B3B14B17B18
To carry flag
To carry flag
To carry flag
1
1
*
*
*
01 0 0 00000 000000
0
0
000 000
00 0 0 0 0
0000000000
00000
00000
00 0 0 0
0000
0001
*The carry flag is set to 1 or 0 before execution.
B0 before
execution
(n=1)
B0 when n=1
(n=2)
B0 when n=2
(n=3)
*
Right rotation of data using DRCR command