
PIC17C4X
DS30412C-page 116
1996 Microchip Technology Inc.
BTFSS
Bit Test, skip if Set
Syntax:
[
label ] BTFSS f,b
Operands:
0
≤ f ≤ 127
0
≤ b < 7
Operation:
skip if (f<b>) = 1
Status Affected:
None
Encoding:
1001
0bbb
ffff
Description:
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 exe-
cution, is discarded and an 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
BTFSS
:
FLAG,1
Before Instruction
PC
=
address (HERE)
After Instruction
If FLAG<1>
=
0;
PC
=
address (FALSE)
If FLAG<1>
=
1;
PC
=
address (TRUE)
BTG
Bit Toggle f
Syntax:
[
label ] BTG f,b
Operands:
0
≤ f ≤ 255
0
≤ b < 7
Operation:
(f<b>)
→ (f<b>)
Status Affected:
None
Encoding:
0011
1bbb
ffff
Description:
Bit 'b' in data memory location 'f' is
inverted.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Execute
Write
register 'f'
Example:
BTG
PORTC,
4
Before Instruction:
PORTC
=
0111 0101
[0x75]
After Instruction:
PORTC
=
0110 0101
[0x65]