TENTATIVELY SOLVED
More information. The breakpoints get screwed up when it freezes.
Here are breakpoints before a freeze and after compiling:
After a freeze, restarting MPLab and loading the program shows these breakpoints:
Obviously, they moved. And of course, the one at "Debug" won't work. The program runs fine to the second breakpoint. At that point, I can step through and no problem. But when I try to run from #2 to #3 breakpoint, the program crashes. "Call BTD255" is a well used routine to convert binary to decimal and includes a 9600 baud software serial transmit. Both routines have been used many times alone and together. The transmit routine includes these steps:
I think the problem is related to the two reads of GPIO in that routine. Those reads are seen by the simulator as calls for register injection from my list, which may be what is screwing it up. I edited out the Put232 subroutine (serial transmit) and left the BTD255. Simulates fine with that change. So, tentatively, those GPIO reads in the serial transmit seem to be the problem.
I'll play with it more tomorrow to pin it down. As so often is the case, "strange" problems are only strange to us humans. The software is doing exactly what we told it to do. Now, if only MPLab would allow injection to a pin instead to a register, this problem would not have occurred. I'll leave the images as inserted, as the solution evolved while writing this update. Maybe they will help someone else.
John