
PIC12C5XX
DS40139A-page 40
Advanced Information
1996 Microchip Technology Inc.
BSF
Syntax:
Operands:
Bit Set f
[ label BSF f,b
0
≤
f
≤
31
0
≤
b
≤
7
1
→
(f<b>)
None
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example:
Before Instruction
FLAG_REG = 0x0A
After Instruction
FLAG_REG = 0x8A
0101
bbbf
ffff
Bit 'b' in register 'f' is set.
1
1
BSF
FLAG_REG, 7
BTFSC
Syntax:
Operands:
Bit Test f, Skip if Clear
[ label BTFSC f,b
0
≤
f
≤
31
0
≤
b
≤
7
skip if (f<b>) = 0
None
Operation:
Status Affected:
Encoding:
Description:
0110
bbbf
ffff
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
execution is discarded, and an NOP is
executed instead, making this a 2 cycle
instruction.
1
1(2)
Words:
Cycles:
Example:
HERE
FALSE
TRUE
BTFSC
GOTO
FLAG,1
PROCESS_CODE
Before Instruction
PC
After Instruction
if FLAG<1>
PC
if FLAG<1>
PC
=
address
(HERE)
=
=
=
=
0,
address
(TRUE)
;
1,
address
(FALSE)
BTFSS
Syntax:
Operands:
Bit Test f, Skip if Set
[ label BTFSS f,b
0
≤
f
≤
31
0
≤
b < 7
skip if (f<b>) = 1
None
Operation:
Status Affected:
Encoding:
Description:
0111
bbbf
ffff
If bit 'b' in register 'f' is '1' then the next
instruction is skipped.
If bit 'b' is '1', then the next instruction
fetched during the current instruction
execution, is discarded and an NOP is
executed instead, making this a 2 cycle
instruction.
1
1(2)
Words:
Cycles:
Example:
HERE BTFSS FLAG,1
FALSE GOTO PROCESS_CODE
TRUE
Before Instruction
PC
=
After Instruction
If FLAG<1>
=
PC
=
if FLAG<1>
=
PC
=
address
(HERE)
0,
address
(FALSE)
;
1,
address
(TRUE)