Looks good. Write ADCON1= %10000010 for 10-bit.

Note: The 16F876 does not have comparators. The A version does.