9/11/95
Page 14
The main function of PDREM is to create an environment for high level debugging. Once the
debugging process is done, PDREM is no longer needed in memory. The debug information included
in the object files such as symbol names only takes up space, and has very little use. Therefore, to
build a stand-alone program, users need to recompile the source code to discard the debug information,
and add other optimizations to create more productive code. Users should also re-LOCATE the .ROM
file using a configuration file similar to the
pdrem.cfg
file to make use of the memory region
previously occupied by PDREM.
This section shows how to build the
sieve.c
demo program as a stand-alone program; it is divided into
three parts: Changing the makefile, changing the configuration file, and downloading a stand-alone
program.
1.
Changing the makefile
: The makefile of the
sieve
.
c
demo program is very simple; the user only
needs to add the desired optimization options to the command
cl
in the makefile. As mentioned
earlier, the standalone versions of
stdio.c
program and other examples are controlled by the value of
the variable DEBUG in the makefile. In these cases, simply add the desired optimization options and
change the value of DEBUG from 2 to 0 (Figure 10).
Figure 10 - Makefile to Build a Standalone Program
2.
Changing the configuration file
: The configuration file for building a standalone program should
be similar to the
pdrem.cfg
configuration file shown in Figure 5, except for the memory mapping
statements. Figure 11 shows the configuration file for building the
sieve.c
program as a standalone
program.
Figure 11 - Memory Mapping for a Standalone Program
......
FLOAT = 0 # 0 - none, 1 - alternate, 2 - emulator, 3 - coprocessor
FARDATA = 0 # 0 - none, 1 - normal, 2 - compressed
DEBUG = 0 # 0 - none, 1 - debug EPROM, 2 - debug PDREMOTE
WARNINGS = 2 # 0 - none, 1 - min, 2 - medium, 3 - max
OPTIMIZE = 0 # 0 - none, 1 - size, 2 - speed
......
......
hexfile intel86 // Intel extended hex output
listfile segments // Create a segment map
map 0x00000 to 0x003ff as reserved // Interrupt vector table
map 0x00400 to 0x01fff as rdwr // data area
map 0x02000 to 0xdffff as reserved
map 0xe0000 to 0xfffff as rdonly // EPROM
cputype Am186EM // Select the processor type
initcode inbyte 0x1000 // Reset vector
.......