9/11/95
Page 10
Line 27 indicates that the code section starts at segment 0x100 (or at address 0x1000
4
) as
indicated in the map statement on line 16. Line 28 indicates that the data section starts at
segment 0x700 (or at address 0x7000
4
) as indicated in the map statement on line 17.
Lines 29 and 37 are commented out because there is no code for chip select.
Running nmake
or
nmaker
: To build the absolute executable file, simply invoke
nmake
from
the
demo
directory (make sure the environment variable
LIB
contains the directory of the run-time
ROMable libraries as described in the section “Installing Paradigm LOCATE”). When
nmake
finishes, the absolute executable file
sieve.axe
is created and is ready for debugging. NOTE: Use
nmaker
instead of
nmake
in a Microsoft Windows DOS box to avoid possible conflict between
nmake
and
locate
.
Though Microsoft Visual Workbench (VWB) included in the Microsoft C/C++ compiler is a powerful
tool, it is incompatible for use in embedded applications. VWB does not support Microsoft assembler
MASM
directly, and it always assumes that the user wants to create a PC-type application. The user
must take care of the extra steps such as including ROM startup code and run-time libraries in a
makefile. Once the makefile is generated, it seems easier to invoke
nmake
from a DOS shell rather
than trying to include the external makefile in the VWB environment. Page 118 of the Paradigm
LOCATE Reference Manual explains in detail how to include an external makefile from the VWB
environment.
2.
Invoking Paradigm Debug/RT - PDRT186
:
pdrt186
To invoke Paradigm Debug/RT, and load the demo program from the command line, simply invoke
the “
pdrt186
sieve
” command
from a DOS shell. The serial communication information such as the
communication port and baud rate is defined in the
pdrt186.ini
file, which was created when Paradigm
Debug/RT was installed. The baud rate defined in this file must match the baud rate defined in the
dcomms.c
file in the
pdrem
directory. Information in the
pdrt186.ini
file can be changed at anytime;
it resides in the Paradigm Debug/RT
c:\pd
directory.
3.
A look at the makefile
The
makefile
included in the
demo
directory is ready to build the
sieve.c
program. A closer look at
the makefile reveals that there are two other files that are compiled and linked with the demo program
to produce a ROMable object file; the files are:
msc80.asm
, and
cinit.asm
. These are two of the five
startup files being distributed with the Paradigm LOCATE software. Startup code takes care of
necessary steps from the time the target is reset to the time the application program is executed. The
source code of the startup files resides in the
c:\locate\msc80
directory. Startup code, if used, should
always be linked first.
The
sieve.c
demo program is a simple program, more sophisticated programs are demonstrated in other
sub-directories of the
examples
directory. These programs are not only linked with the startup code,
they are also linked with ROMable run-time library helpers. The sources of the library helpers reside
in the
c:\locate\msc80\helpers
directory. Library helpers define variables/symbols and interrupt
handlers needed by the ROMable run-time libraries. When compiling the application program, if the
linker generates some “Undefined symbols” messages, chances are those unfamiliar symbols are
4
Physical address is calculated by shifting the segment value left 4 bits and adding the 16-bit offset
value to yield a 20-bit physical address. The value of the 16-bit offset is 0 in this case.