Chapter 6: Instructions
131
Bit Conversion Instruction Details
Instruction
Instruction
Bit Set, Reset, Reverse, Test
Range
Bit
■
Word
BSET
BRST
BNOT
BTST
BSET: Nth bit set
BRST: Nth bit reset
BNOT: Nth bit reverse
BTST: Nth bit test
Double words
Ladder
BSET: Set the Nth bit in the D register
(X
→
1).
BNOT: Reverse the Nth bit in the D
register (0
→
1, 1
→
0).
BRST: Reset the Nth bit in the D
register (X
→
0).
BTST: Copy the Nth bit to the carry bit
in the D register (X
→
F1.8).
Description
1. BSET: Set the Nth bit of register D to 1.
2. BRST: Reset the Nth bit of register D to 0.
3. BNOT: Reverse the state of the Nth bit of register D.
4. BTST: Set the carry bit F1.8 to the state of the Nth bit of register D.
5. These instructions are useful when it is necessary to perform bit-level operations on word-
only memory addresses, such as W, PV, SV, and SR.
BSET
D =
N =
R
BNOT
D =
N =
R
BRST
D =
N =
R
BTST
D =
N =
R
BSET
BNOT
BRST
BTST
D ...... 0 1 1 1 1 1 0 0
if N=5
1
D ...... 0 1 0 1 0 1 0 0
if N=3
0
D ...... 0 1 1 1 0 1 0 0
if N=4
D ...... 0 1 1 0 0 1 0 0
D ...... 0 1 1 1 0 1 0 0
if N=6 F1.8
Summary of Contents for D320 PLC
Page 1: ...D320 PLC User s Manual...
Page 18: ...6 D320 PLC User s Manual...
Page 28: ...16 D320 PLC User s Manual...
Page 34: ...22 D320 PLC User s Manual...
Page 78: ...66 D320 PLC User s Manual...
Page 176: ...164 D320 PLC User s Manual...
Page 210: ...198 D320 PLC User s Manual...
Page 258: ...246 D320 PLC User s Manual...