PIC17C75X
BSF
Bit Set f
BTFSC
Bit Test, skip if Clear
Syntax:
Operands:
[ label ] BSF f,b
Syntax:
[ label ] BTFSC f,b
0 ≤ f ≤ 255
0 ≤ b ≤ 7
Operands:
0 ≤ f ≤ 255
0 ≤ b ≤ 7
Operation:
Status Affected:
Encoding:
Description:
Words:
1 → (f<b>)
Operation:
skip if (f<b>) = 0
None
None
Status Affected:
Encoding:
1000
0bbb
ffff
ffff
1001
1bbb
ffff
ffff
Bit 'b' in register 'f' is set.
If bit 'b' in register ’f' is 0 then the next
instruction is skipped.
Description:
1
1
If bit 'b' is 0 then the next instruction
fetched during the current instruction exe-
cution is discarded, and a NOPis exe-
cuted instead, making this a two-cycle
instruction.
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
Data
Write
register 'f'
Words:
Cycles:
1
1(2)
BSF
FLAG_REG, 7
Example:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Before Instruction
FLAG_REG= 0x0A
Decode
Read
register 'f'
Process
Data
No
operation
After Instruction
If skip:
Q1
FLAG_REG= 0x8A
Q2
Q3
Q4
No
No
No
No
operation
operation
operation
operation
HERE
FALSE
TRUE
BTFSC
:
:
FLAG,1
Example:
Before Instruction
PC
=
address (HERE)
After Instruction
If FLAG<1>
PC
=
=
=
=
0;
address (TRUE)
1;
address (FALSE)
If FLAG<1>
PC
1997 Microchip Technology Inc.
DS30264A-page 191