97
8. Tracing a Program
Type:
T FB00 <enter>
Depending on the selections in Settings>Debug, the output window will display information on the
instruction and registers at the starting point, $FB00, and at the break point ($FB01). The status line
should show 'Monitor Mode'. The Start/Break Point box, part of the information sidebar on the main
form, shows in green an abbreviated form of the instruction at the point where you began tracing, with
similar information for the breakpoint highlighted in red because the program has halted there. The
‘BR’ address panel shows the current value in the MCU BRK register. The ‘LU’ (List & Unassemble)
address panel shows the default starting address for list or unassemble operations - it is updated during
tracing to reflect the program breakpoint. Note also that the command edit box is pre-filled with 'T'
so that simply pressing <enter> will trace the next instruction.
9. Watching a Variable
Add an address to monitor during tracing. In the LOOPTEST program, the counter is stored in 1,SP
so: right-click in the Watch Window (main form, lower right-hand corner) and select ‘Add...’ The
Add to Watch dialog opens, and in the ‘Stack Relative’ box, choose 1,SP by selecting it from the
combo box. Click ‘Add & Close’. Now each time you repeat the trace command, the current value
of 1,SP is updated in the watch window.
10. Erasing
Try erasing the page containing the Looptest program using the Page Erase command. Type:
PE FB00 FB23 <enter>
Xplor8 will reply with a short dialog to the effect that the page you are about to erase is larger than
the range you typed to the command. This is because pages are only erased in minimum-sized chunks.
Answer OK to this dialog and Xplor8 should zap your program. You can check by using the Verify
Erase command (page 67):
VE FB00 FB23 <enter>
11. Mass Erase
This operation is always possible whether or not the correct security byte sequence is sent. Type:
ME <enter>
and answer 'OK' at the confirmatory dialog. This should erase all of FLASH; once again, you can
check with the Verify Erase command. Typing
VE <enter>
alone should be sufficient.
******************** This concludes the quick tour. ***********************
Comentários a estes Manuais