Detailed reference for the BTFSC instruction in PIC18 ISA.
Test the bit value of a file register f at bit position b.
a = 0 → Addressing uses the access bank.a = 1 → Addressing uses the banked file registers.; Skip next instruction if RB2 is clear (Access bank)
BTFSC PORTB, 2 ; Skip IF bit 2 of PORTB is clear
CLRF PORTC ; Executed only if bit 2 of PORTB is set; Skip next instruction if RB2 is clear (Access bank)
BTFSC PORTB, 2 ; Skip IF bit 2 of PORTB is clear
CLRF PORTC ; Executed only if bit 2 of PORTB is set; Test a banked register: skip if bit 5 of file register 0x78 is clear
BTFSC 0x78, 5, 1 ; Skip IF bit 5 of file register 0x78 is clear
CLRF 0x79 ; Executed only if bit 5 of 0x78 is set; Test a banked register: skip if bit 5 of file register 0x78 is clear
BTFSC 0x78, 5, 1 ; Skip IF bit 5 of file register 0x78 is clear
CLRF 0x79 ; Executed only if bit 5 of 0x78 is set