Dave,
Thanks for the input.
When I said that the lower 3 bits of CMCON were set = 1
I SHOULD have said that Each of the lower 3 bits is set to 1
which makes CMCON = %00000111 which = 7.

I do have a 1K pullup to +5 on MCLR.

I have also discovered that if I set the config bits for the 16F877A
to turn the Brownout reset = OFF the code I have been running in
the 16F877 now also runs perfectly in the 16F877A.

What is it about pulling PortA.7 to ground with a pushbutton switch that
could lead to a system reset ??? And why would turning the brownout
reset OFF correct that problem ???

Thanks,
Dan