Document Navigation
Table Of Contents
Index
Notes
Previous
Next


NMI

Selecting the Execute/NMI menu item causes the 6809 to set the "E" bit in the condition codes, stack all of the CPU registers, and pick up the vector from the ROM at $FFFC. This enters the PSYMON monitor NMI service, which proceeds to dump the CPU registers and display a command prompt. At this time you can use any monitor service to examine or change program memory and/or CPU registers. When you are ready to restart, typing G<return> will return from the interrupt with the registers as they were when the NMI occurred (unless you change a register value using PSYMON, of course).

PSYMON allows you to change the NMI vector indirectly. You can't actually change the value in the ROM at $FFFC, however PSYMON's NMI service picks up a jump vector from $F3FC, which is user RAM and may be modified. Because of this, you can create your own custom NMI service, if you are so inclined. Personally, I use NMI for debugging. PSYMON's classic "dump-the-registers & let-me-meddle" service is ideal for that, and if your needs are similar to mine you may never need to make a custom NMI service at all. However, if you need to, you definitely can.

To see how this works, use the MON command to enter PSYMON from the FLEX prompt, change $F3FC from $FE8E, which is the address of the normal interrupt service routine in PSYMON, to $0100. Then put an RTI instruction ($3B) at $0100, and type W to restart FLEX. Normal command processing is in effect. Now select NMI from the Execute menu, and unlike previously, nothing will appear to happen. But something did - the NMI was taken, it headed off to $0100, where it encountered the return from interrupt instruction, and went right back to what it was doing.

At this point, you'll want to either use the Mon command again, which causes PSYMON to reset the NMI vector, or use RESET and go back and change the value at $F3FC from $0100 back to $FE8E so that PSYMON's NMI service will work again. If you don't do this, and cause another NMI after $0100 has been written over by any application, you're going to experience a 6809 crash, just like the real thing. You'll probably have to use the Execute/Hard Restart menu selection to get going again.


Table Of Contents
Index
Notes
Previous
Next
Document Navigation