I'm trying to write a program to have port A and Port B light up seven segment displays at the same time. The question I had was how does the compiler distinguish between a port A I/O or a port B I/O? I'm including some of my code to demonstrate what I'm talking about.

loop1: if bit0 = 1 then loopx 'if true program ends
if 7 = 1 then loop1 'if beam isn't broken endless loop

what's happening here is I have a seperate counter set-up and when the counter equals 0, it will send out a logic 1 to PortA bit 0 in the shown code. this in turn will end this program. then the second line is if bit 7 of portB is a logic 1 then this will create an endless loop until the pin turns low. At the of a low state the program will continue execution.

Now onto the question: How does the compiler distinguish between a portA command (line 1) and a portB command (line2)? when compiling I receive a "variable expected (token '7') error. and this is probably due to my lack in knowledge in managing the I/O ports of the 16F84A. Any help would be greatly appreciated.