I spent a couple nights trying to track down some strange behavior in my fledgling monitor program. Basically, it had all the hallmarks of some sort of RAM corruption leading to inadvertent crashes.
Finally I inspected the identifier window of the simulator.
In my code, I have the following:
previou
Code:
STRING_PTR: .DS $02 ;pointer to current output message string
STRING_INDEX: .DS $01 ;index into input buffer
LINE_CNT: .DS $01 ;clear screen line count
CMD_INDEX: .DS $02 ;index into command string list
SELECTED_CMD: .DS $02 ;pointer to slected command routine
LINE_CNT, and CMD_INDEX weren't shown in the sim's identifier window. Even after re-assembling. What was weirder, SELECTED_CMD was show to be where it should have been if the two missing identifiers were ther as they should have been.
So I saved, closed, re-opened, and re-assembled. I checked the identifier window, and everything was fixed! Put the code in ROM, and all the weird crashes stopped.
Any idea what happened here? Is it a bug, or could I have done something strange? BTW, the two identifiers had been in use before the weirdness, so adding them wasn't the trigger.