Software Project Management
Example 1: Multi-programmer Environment
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
4-15
to set the current memory space to P(rogram) and restore the last used P(rogram) L(ow)
location counter. The <IO source program statements> shown previously will be assem-
bled at the next available Low Program memory space. When the end of the IO.ASM file
is encountered, the X, Y, and P(rogram) location counters (High and Low) will have been
advanced corresponding to the number of words generated for each memory space.
In a similar manner, the file FILTER.ASM will be assembled. The last statement of the
PROJECT.ASM file informs the Assembler that this is the last logical source statement,
and the starting address for the object module will be a label called ENTRY. In the exam-
ple above, ENTRY would have been a label defined in the section MAIN and declared as
global with the
XDEF
directive.
4.6.2
Relative Mode Implementation
Using the Assembler default relative mode, each of the source files is assembled sepa-
rately. For each section defined in the input files a separate set of location counters is
maintained such that all memory spaces for each section begin at relative address zero.
The linker is invoked to combine the files and establish base addresses:
DSPLNK
-B -M -OXLI:0 -OYLI:0 -OYH:FFC0 -OXH:FFC0 \
-OPL:1000 -OPHE:A000 MAIN IO FILTER
The linker reads the command input and sets up base values for all counters specified on
the command line. In this example, the X and Y low memory counters are initialized to ze-
ro, whereas the X and Y high memory counters are set to FFC0 hexadecimal. The pro-
gram low and high memory counters are initialized similarly. When the linker creates the
executable file it reads the input files and sets the starting address for all sections relative
to the values obtained from the command line. As the MAIN object file is read the linker
increments the section counters for all appropriate memory spaces.
After the MAIN object file is processed, the IO object file is read. The section named I_O
contained an
ORG
directive indicating a switch to the low X data memory counter. Recall
that the Assembler generated relocatable code for the I_O section source such that the
low X data memory counter begins at zero. The linker adjusts the low X memory counter
associated with section I_O to reflect any previous data generation performed in low X
memory (e.g. in MAIN). The FILTER module is linked in a similar fashion.
Another way for specifying base addresses, instead of lengthy command line options, is
through a
memory control file
. The memory control file allows the programmer to indi-
cate memory space starting addresses analogously to the command line approach. In ad-
dition, the memory control file offers finer control over placement of sections in memory.
See the
Motorola DSP Linker/Librarian Reference Manual
for more information on the
memory control file.
The preceding examples described two methods for organizing a software project. Refer
to the descriptions of the
ORG
and
SECTION
directives in Chapter 6 for a more detailed
discussion. See also the
Motorola DSP Linker/Librarian Reference Manual
for more in-
F
Freescale Semiconductor, Inc.
n
.