8. Function Commands
SFR, SFRP
- 267 -
Execution conditions
The execution conditions for SFR, SFRP are as shown below.
Right shift command OFF
SFR
ON
Executed per scan
Executed per scan
SFRP
Program example
Program that shifts the D8 data 5 bits to the right when M10 turns ON.
Coding
No. of
steps
Com-
mand
Device
10 LD M10
11 SFR D8 K5
D8SFR K5
M10
10
(Pulse coding)
14
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
Carry flag
(SM12)
Before execution
After execution
0
000000
1
1
00000
11
1
0
0
1100000
1
1
1
00011
D8
Right shift of data with SFR command (word device)