60
8.25 Trace T
Format:
T[Repeats] [StartAddress|*]
Command to trace a program in MCU controlled memory. If no explicit start address is specified, then
tracing will begin at the current value of the 'T/G' address. Repeats is an optional number which
specifies how many times the command is to be repeated. Note that repeats is specified as a decimal
number, unlike all other values which are entered in hexadecimal. The value of 'Repeats' follows the
letter T without a gap. When the command is given, Xplor8 carries out the following operations:
1. The instruction at the starting address is disassembled to discover the address of the following
instruction (or instructions if there is the possibility of a branch);
2. Xplor8 determines which is the effective following instruction, based on the opcode, the
contents of the CCR, and on other information as appropriate.
3. A breakpoint is then written to MCU memory to 'catch' the program after execution of the
current instruction. This breakpoint is displayed in the Start/Break Point window (page 22);
4. The MCU is set running at the current instruction, the status line is updated to read 'Tracing',
and the instruction at the trace starting address appears in the breakpoint display in green;
5. As soon as the MCU stops at a breakpoint, that breakpoint is highlighted in red in the
breakpoint display, the breakpoint information is copied to the output window, and the status
line reverts to: 'Monitor Mode'. If populated, the watch window display is also updated.
6. The above processes are repeated if 'Repeats' is specified as greater than 1.
The Xplor8 internal trace starting address, T/G, and the default list and unassemble address, L/U, are
also updated to show where the last trace instruction has stopped; so issuing the 'T' command alone
will continue tracing from where the previous trace operation halted.
Care needs to be taken if tracing is begun at an RTS or RTI instruction if program execution has not
arrived at that point by itself, e.g. as the result of issuing a Go (Run) command (page 48). This is so
because the next address at which tracing (or stepping over - see the Step Over command on page 61)
will halt is computed from the preceding value on the stack: this value will be quite arbitrary if tracing
is begun 'out of the blue' at either of these instructions.
Examples:
T 800B Begins tracing with the instruction at address $800B
T3 Begins tracing at the current value of 'T/G' address and traces the next three
instructions
Kommentare zu diesen Handbüchern