There's more to the code.
For some reason vBulletin saw "Reference&lt;Voltage" as being HTML and it messed up the post. I added a space, and now it shows the whole thing.<hr>
I think Proteus is complaining about using ADCON0=%11000001.
A/D Clock mode 3 is not recommended at 20mhz, but I wouldn't call it an error.
Using ADCON0 = %10000001 might clear the problem, by selecting FOSC/32, which is what the comments say you wanted anyhow.

But I think the biggest problem is that the execution from the beginning falls into the get_reference Subroutine.
When it hits the RETURN, it has no idea where to go, because nothing GOSUB'd to it to begin with.
You should have a GOTO main_loop before that point.

You should also put some limits on CCPR1L.
It shouldn't go above PR2 (49) or try to go below 0.
Just some IF statements will fix that.

hth,