The full code is a huge program... here are the appropiate bits, hope this is enough
; routines within the main program so ADC conversion
call WaitForConversionStarted
call WaitForConversionDone
call StoreMeasurement ; store value
InitiateADconversion
bcf PIR2,CCP2IF ; clear interrupt flag
bsf Mail,2 ; indicate that conversion was started
bsf ADCON0,GO ; start conversion
nop
nop
bra EndInterrupt
; --------------------------------------------------------------------------------
WaitForConversionDone ; conversion done ?
btfsc ADCON0,1
bra WaitForConversionDone
bcf PIR1,ADIF ; clears ADC interrupt flag
return
; ------------------------------------------------------------------------------
WaitForConversionStarted ; conversion started ?
btfss Mail,2
bra WaitForConversionStarted
bcf Mail,2
return
; -----------------END OF INTERRUPT SERVICE ROUTINES ----------------------