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