The code is a input driver witch collect the state of several pins on several ports
An extract of the code :


PIN_FD_BK   EQU     2       ;
PIN_VARDEF  EQU     4       ;

Variables :

INPUTS2     EQU     0x017D     ; Recopie avec mise en forme des entrees
INP_AUX4    EQU     0          ; Set Si Entree Auxiliaire 4 Active Defaut VAR
INP_AUX5    EQU     1          ; Set Si Entree Auxiliaire 5 Active FeedBack


Code:
            MOVLW   00010100B          ;
            MOVWF   TRISF              ;
            CLRF    CMCON              ; Utile Sur les Pic18 A Partir de 40 Broches
            CLRF    CVRCON             ;
;
            MOVLW   0x0F               ; Added code to desactivate the AD
            MOVWF   ADCON1             ;
            CLRF    ADCON0             ;
            LFSR    1,INPUTS2          ;
            CLRF    INDR1              ;
            LFSR    0,INPUTS           ;
            CLRF    INDR0              ;
;
            BTFSS   PORTE,IN_TOR2      ; Recopie Entree TOR Aux 1
            BSF     INDR0 ,INP_AUX1    ; Le Contact doit etre ferme
;
            BTFSS   PORTE,IN_TOR1      ; Recopie Entree TOR Aux 3
            BSF     INDR0 ,INP_AUX2    ; Le Contact doit etre ferme
;
            MOVF    PORTF,W            ;			     Doesn't work
            BTFSC   WREG ,PIN_VARDEF   ; Recopie Entree PIN_VARDEF      -    -
       ;     BTFSC   PORTF,PIN_VARDEF   ; Recopie Entree PIN_VARDEF  Doesn't work
       ;     BTFSC   PORTE,IN_TOR1      ; Recopie Entree TOR Aux 1   Work Well
            BSF     INDR1 ,INP_AUX4    ; Le Contact doit etre Ouvert
;
;
LIT_INP20   BTFSC   PORTF,PIN_FD_BK    ; Oui, Recopie Entree TOR Aux 4  Work Well !!
            BSF     INDR1 ,INP_AUX5    ; Le Contact doit etre ferme
;
;
            MOVLW   00001011B          ; Added code to restore good state for AD
            MOVWF   ADCON1             ;
            MOVLW   00000001B          ; 	
            MOVWF   ADCON0             ;
