A sample debugging session

Once NiceMon has started up you'll want to make sure everything is configured appropriately for your target. Do this using the Configure menu.

Here is the check list to go through before starting a debug session:

Start a debugging session by pushing the tool bar's Open button, and selecting tutorial.cof form the NiceMon distribution directory. If everything works NiceMon will program the device, reset and set the program counter to 0000. You will see PC: 0000 at the very bottom left. The watch area will show a chunk of the stack and the main view area will show tutorial.asm with the assembly source for address 0000 highlighted.

Now you're ready to try things out. Pushing the Step button will execute individual instructions. Hitting the Run button will run until you hit Cancel or a break point is reached. You can set a break point by selecting the ---- button in the bottom right corner. The break point can be disabled/enabled using the button next to it.

You can look at the contents of RAM by adding a watch to the watch area. Hitting the tool bar's watch button will open dialog boxes prompting you for the required information. Once the watch has been added contents of RAM can be modified by clicking the value in the watch area.

You can view the contents of flash by hitting the tool bar's Dump Flash button. This will show 0x50 bytes of data starting from the current program counter. Hitting the Disassemble button will disassemble the next five instructions.

If you want to see the contents of different flash addresses you can either change the program counter (by hitting the PC:xxxx button) and use the tool bar button as before or you can use the console to manually invoke the disassemble and dump commands. Here is an example:

    #|NiceMon:12|# (disassemble "30" 3)

    0030  push A
    0031  ld A,0F2
    0033  inc A
    #|NiceMon:13|# (dump "12" 4)

    0012 13 BC E6 10 BC E7 27 BC-EF 15 BD EE 7C AD 00 51
    0022 AD 00 5A F9 FF BD EF 6C-67 9D FE 67 9D EF 67 9D
    0032 F2 8A 9C F2 BD EF 6D 9D-DC 96 01 9C DC 8C A0 9F
    0042 EF 60 80 7F 60 40 7E 8C-9C FE 8C BD EF 7C 8F D0