195/317
7 - Debugger and PROM Programmer Tutorial for ST72251
Since the processor has been automatically reset after the object file was opened, the first line
of the program is underlined, showing where the execution will start from.
Opening the Sources pull-down menu, we get the list of the modules of the project. As many
other source files as you wish may be opened at the same time.
7.3.3.2 Running the application
We are now ready to run the program. Let us first do a few steps using step mode. There are
two step buttons, named Next and Step in all windows, except in the disassembler window
where they are called Nexti and Stepi. These buttons have the same behavior on simple state-
ments; they only differ on statements that produce subroutine calls, like
CALL
in assembler, or
function names in C. There, pressing Next goes to the following line, while S tep enters the
subroutine or function. We can test this by stepping through the program first using Next, until
line 45 of the source text where the first call is. Press Next once again: the PC now points to
the line that follows the code,
inc x
.
Let us restart from the beginning and try the effect of the Step button. To return to the begin-
ning, select Command/Reset again in the toolbox. The execution point then returns to the start
of the program.
When a section of program is known to be working, like the first lines of the program up to line
44, it is more convenient to execute it at full speed and stop where it is worthwhile stepping
again. To do this, let us click on line 44. This line is then highlighted in blue. Press the Goto
button of the source window, or press F4. Line 44 is now underlined, meaning that the pro-
gram has been executed from the previous position of the program counter (the beginning) to
the highlighted line, and then has stopped.
Press S tep. We go through the instruction that precedes the call, then Step again: a new
window opens, showing the source file
Timer500.asm
. The current position of the PC is the
first line of the subroutine. W e can now step through the subroutine, using either Next or Step.
7.3.3.3 Watching the registers and variables
While stepping through the program, it is useful to know the values of the registers of the core
and the value of the memory bytes. Select the toolbox Windows/Registers option. A window
then opens, showing the values of all the registers of the core. In particular, the flags in the
condition code register are shown individually. We can now step through the timing loops and
see the values change.
In this box, the background of all the fields is yellow, meaning these are “hot” fields, that is,
the y are updated each tim e executio n is stopped. In addition, in fields whose value ha s
changed since last time, the value is written in bold characters:
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...