Start: banksel ANSELA bcf ANSELA,3 ; set RA3 as digital banksel TRISA bsf TRISA3 ; set RA3 as an input pin Loop: banksel PORTA btfsc PORTA,3 ; "test" RA3 goto Exception_Routnine ; if 1 do this goto Loop Exception_Routine ; exception code goes here