1. Read the Datasheet.

2. You will discover the F876 has ADC's (and Comparators I believe in the case of the A version). By default, PortA comes up in Analogue mode. You must set the pins to Digital. See the sections for A/D Convertor Module (and Comparator Module section if it has one) to see how to do this.

I really am trying to force people to read the Datasheets (the solution is very simple) before asking for answers on the forum.