Trying to understand PIC datasheet for the PIC 12F683
Taking this datasheet for the PIC12F683 (To ensure we're using the same version of datasheet):
http://ww1.microchip.com/downloads/en/devicedoc/41211d_.pdf

Section 4.0 "GPIO PORT" offers a complete description on how the IO port works. You should read this On the right hand side of the page it says: 

"Note:
The ANSEL and CMCON0 registers must
be initialized to configure an analog
channel as a digital input. Pins configured
as analog inputs will read ‘
0
’."

This means if ANSEL and CMCON0 are not configured, any reads on a IO pin that doubles as analog input will always return 0.

Further down in that section at 4.2 you get the detailed description about the ANSEL register and it's bit mask on the next page:

Bits 0 to 3
ANS&lt;3:0&gt;: Analog Select bits
Analog select between analog or digital function on pins AN&lt;3:0&gt;, respectively.
1 = Analog input. Pin is assigned as analog input(1).
0 = Digital I/O. Pin is assigned to port or special function.


So, writing XXXX0000 to ANSEL makes all pins digital IO. XXXX0001 would make AN0 analog and the other 3 digital, and so on.

CMCOM0's bitmask is described under section 8.7

&lt;snip&gt;
111 = CIN pins are configured as I/O, COUT pin is configured as I/O, Comparator output disabled, Comparator off.


So you need to write XXXXX111 to CMCON0 to disable the comparator and free the pins for digital IO.