
Software Project Management
Example 3: Bootstrap Overlay
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
4-21
4.8.1
Absolute Mode Implementation
In order to avoid binding addresses within the individual modules, the programmer could
devise a preamble file called BOOTPROJ.ASM which sets the appropriate options and
establishes load and runtime base addresses:
OPT
LB
; increment load counter by
bytes
ORG
PI(1):$100,PE(2):$C000
; set runtime RAM address,
; bytewide load ROM ad-
dress
The
OPT
directive with the
LB
option indicates that the Assembler should increment the
load counter by the number of bytes in the target processor word. This guarantees that
the EPROM addresses will be correct for bytewide loading during bootstrap processing.
In the
ORG
directive, the runtime location counter, tagged as 1 and mapped to internal
memory, is set to hex 100. The load counter is tagged as 2, mapped to external memory,
and set to hex C000, where the built-in bootstrap program will begin loading bytes after
processor reset. The files are assembled using the command below:
ASM56100
-A -B -L BOOTPROJ SECT1 SECT2
The Assembler is invoked in absolute mode (
-A
option), and generates an executable and
listing file. All files on the command line are processed as a single assembly run and all
are used to produce the output. BOOTPROJ.ASM is read first and sets up the appropriate
absolute addresses for later sections. Since no explicit base address was given in the sec-
tion files, both load and runtime addresses will continue from one section to the other, e.g.
they will be contiguous. For example, if only two words of instruction were between each
of the START and END labels, the runtime value for END1 and START2 would be hex
102. However, the load address of the code associated with these labels, assuming a 16
bit target word size, would be C004 hexadecimal. Similarly, the runtime value for END2
would be 104 hex and the corresponding load address would be C008 hexadecimal.
4.8.2
Relative Mode Implementation
In relative mode each of the source files is assembled separately to create individual ob-
ject files. The object files are combined to build a single executable file. A preamble file is
not necessary to handle bootstrap files in relative mode because the addresses are es-
tablished at link time. In order to generate bytewide load addresses the
LB
option can be
specified on the Assembler command line using the
-O
command line option:
ASM56100
-B -L -OLB SECT1
This command assembles the file SECT1.ASM and creates a relocatable object file called
SECT1.CLN. The listing file shows that the starting address of the section is zero; howev-
er, because of the
LB
option on the command line the load counter will increment at twice
the rate of the runtime counter (assuming a 16 bit DSP56100 family target processor). A
F
Freescale Semiconductor, Inc.
n
.