Joe, the switch drives an optoisolator which in turn drives the PIC input (GPIO.3 configured as input, not MCLR). (I've looked at the switch and the output from the opto on the scope; there's not much bounce.)

Alain, my general arrangement of the program is:

PROGRAM (things done at power-up only)

MAIN LOOP (you've seen it)

SUBROUTINES (you've seen the one that is the problem)

INTERRUPT HANDLER

END

I'll try moving some things around, but I continue mystified and frustrated.