412
7 APPLICATION INSTRUCTIONS
7.4 Bit Processing Instructions
7.4 Bit Processing Instructions
Bit set for word devices, bit reset for word devices
BSET(P), BRST(P)
■BSET
• Sets (sets "1" at) the nth bit in the word device designated at (D).
• If n exceeds "15", bit set/reset is performed with the lower 4 bits of the data.
■BRST
• Resets the nth bit of a word device designated by (D) to 0.
• If n exceeds "15", bit set/reset is performed with the lower 4 bits of the data.
(D): Device whose bits are set/reset (BIN 16 bits)
n: Position of the bit to be set/reset (0 to 15) (BIN 16 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant
K, H
Others
Bit Word Bit Word
(D)
n
Basic
Process
High
performance
Redundant
Universal
LCPU
Command
Command
P
D
n
D
n
BSET, BRST
BSETP, BRSTP
indicates an instruction symbol of BSET/BRST.
1 1
0 0
1
0
1 1
00
111
0
11D10
b15
b6
b0b1
Before execution
1 1
0 0
1
0
1 1
0
1 111
0
11D10
After execution
b15 b6
b0b1
1 is set
K6
D10BSETP
1 1
0 0
1
0
1 1
00
111
0
11D10
Before execution
1 1 0 000 1 100111011D10
After execution
0 is set.
K11
D10
BRSTP
b0b1
b15 b11
b0b1
b15 b11