Look from page 142 and after the details of the AD converter. It always makes a 10 bit conversion. It is up to you if you want 8 or 10 bits result.

Anyway, having ADFM=1, the result is Right justified and stored in the ADRESH, ADRESL.

So get your result in the baty variable as:

baty.HIGHBYTE=ADRESH
baty.LOWBYTE=ADRESL

or

baty.BYTE1=ADRESH
baty.BYTE0=ADRESL

In any case for the variable handling (e.g. baty.BYTE1, etc) look at the PICBASIC reference manual.

Ioannis