PIC17C4X
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'
Execute
Write
register 'f'
Words:
Cycles:
1
1(2)
BSF
FLAG_REG, 7
Example:
Q Cycle Activity:
Q1
Before Instruction
Q2
Q3
Q4
FLAG_REG= 0x0A
Decode
Read
Execute
NOP
After Instruction
register 'f'
FLAG_REG= 0x8A
If skip:
Q1
Q2
Q3
Q4
Forced NOP
NOP
Execute
NOP
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
1996 Microchip Technology Inc.
DS30412C-page 115