8. Function Commands
BSET, BSETP
- 299 -
Program example
(1) Program to reset 8th bit (to 0) of D8 when XB turns OFF, and to set 3rd bit (to 1) of D8 when XB
turns ON.
10
BRST D8 K8
X0B
19
BSET D8 K3
X
0
B
P
P
Reset
8
th bit o
f
D
8
.
S
et
3
rd bit o
f
D
8
.
Coding
No. of
steps
Com-
mand
Device
10 LDI X0B
11 BRSTP D8 K8
19 LD X0B
20 BSETP D8 K3
28
0 0 1 101 0 111110001D8
b15
b8 b0b3
実行前
0 0
1 1
0
1
0 0
11
111
0
0
1
D8
b15
b8 b0b3
実行後
XBがOFFしたとき XBがONしたとき
D8 before execution
b15
b8
0
0
1
1
0 1
0
1 1 1
1
1 0 0
0
1
b3
b0
b15
b8 b3
b0
0
0
1
1
0 1
0
0 1 1
1
1 1 0
0
1
When XB turns OFF
When XB turns ON
D8 after execution