#include <p16f877A.inc>
org 0x00
banksel TRISC
clrf TRISC ; Make the PORTC as output // ok
banksel PORTC
//here you dont test RC0 but you have to set/clear it using bsf/bcf instruction
// here BCF PORTC,0 ;RC0=0
// and BCF PORTC,1 ;RC1=0
;btfsc PORTC,0 ; Check bit0 in PORTC and skip next instruction if bit0 = 0 .
; goto p ; This be skipped if bit0 = 0
;btfsc PORTC,1 ;Check bit1 in PORTC and skip next instruction if bit1 = 0 .
;goto k ; This be skipped if bit1 = 0
;k
banksel PORTD ; choose PORTD
movlw 80h
movwf PORTD ; make PORTD bit 7 as input while 0~6 output
btfss PORTD,7 ; if RD7=1 then skip to next test
goto ERROR
// continue to test for 2nd condition........ etc
ERROR:
Lite the "BAD" LED
end