The code isn't wrong but the 18F452 only has a 10-bit ADC. The lower 8 bits are returned in ADRESL and the upper 2 bits in ADRESH. That means ADRESH can never be equal to 0xFF. The maximum value it can hold is 0x03.
Hi
I found my mistake in the a2d code.
The project is a thermometer using p18f452 and lm335,
The temperature value is sending to 2x16 lcd as string-
{"Temp -/+ xxx^C"}