PIC17C75X
BTFSS
Bit Test, skip if Set
BTG
Bit Toggle f
Syntax:
[ label ] BTFSS f,b
Syntax:
Operands:
[ label ] BTG f,b
Operands:
0 ≤ f ≤ 127
0 ≤ b < 7
0 ≤ f ≤ 255
0 ≤ b < 7
Operation:
skip if (f<b>) = 1
None
Operation:
(f<b>) → (f<b>)
Status Affected:
Encoding:
Status Affected:
Encoding:
None
1001
0bbb
ffff
ffff
0011
1bbb
ffff
ffff
If bit 'b' in register 'f' is 1 then the next
instruction is skipped.
Bit 'b' in data memory location 'f' is
inverted.
Description:
Description:
If bit 'b' is 1, then the next instruction
fetched during the current instruction exe-
cution, is discarded and an NOPis exe-
cuted instead, making this a two-cycle
instruction.
Words:
Cycles:
1
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Words:
Cycles:
1
Decode
Read
Process
Data
Write
register 'f'
register 'f'
1(2)
Q Cycle Activity:
Q1
BTG
PORTC,
4
Example:
Q2
Q3
Q4
Before Instruction:
Decode
Read
register 'f'
Process
Data
No
operation
PORTC
=
0111 0101[0x75]
If skip:
Q1
After Instruction:
PORTC
=
0110 0101[0x65]
Q2
Q3
Q4
No
No
No
No
operation
operation
operation
operation
HERE
FALSE
TRUE
BTFSS
:
:
FLAG,1
Example:
Before Instruction
PC
=
address (HERE)
After Instruction
If FLAG<1>
PC
=
=
=
=
0;
address (FALSE)
1;
address (TRUE)
If FLAG<1>
PC
DS30264A-page 192
1997 Microchip Technology Inc.