#include"p16f73.inc"
org 0x00bsf status,rp0 //for selecting
//RAM addresses 80h-ffh by default
movlw 0xff//for selecting
movwf trisa //port A an input port
clrf trisb //making port B an output port
l1: Bcf status,rp0 //for selecting
//RAM addresses 00h-7fh by default
movlw 0x05//Turning ON the ADC//however i think 0x01 could do the job too.//here you are assigning 1 to the GO bit in the
movwf ADCON0 //ADCON0 which is not necessary
btfsc adcon0,2//Checking the status of DONE bit in ADCON0 (0 means ADC is
//has completed the conversion operation)
goto $-1// this should be l1. this will keep the control to the upper block
// of code until conversion is complete
movf adres,0// Move the contents of ADRES (converted data) register to
// WREG (workign register)
movwf portb //Send the converted data from WREG to PORTB
goto l1 // Keep looping back to the upper block of code for
// next analog signal to be converted
end