User`s manual

Exploiting Memory Control Files
Motorola Debugging C and Assembly Code 3-25
Example 3 -8. An Assembly Routine Called by a C Program
section norm_routine_in_asm
global Fnorm_l
Fnorm_l
; Receives parameter in a, returns normalized value in a
clb a,b
neg b
move b,a
rts
endsec
3.5 Exploiting Memory Control Files
This example, showing you how to use a memory control file to locate sections at specific
addresses in X memory on a target device, is based on the Suite56 assembler for the
DSP56300 family. The principles it illustrates about memory control files also apply to
other target devices. The example uses two simple files of assembly code,
section_a.asm (in Example 3 -9) and section_b.asm (in Example 3 -10). As you
can see, the assembly code in
section_a.asm fills a 256-word block of X memory on
the target device with zeroes, and
section_b.asm fills a 16-word block of X memory
with ones.
Example 3 -9. A Sample Assembly File for Memory Mapping: section_a.asm
section section_a
org x:
bsc $ff,0
endsec
Example 3 -10. A Sample Assembly File for Memory Mapping: section_b.asm
section section_b
org x:
bsc $10,$ff
endsec
To assemble those two files, we use the commands to the assembler in Example 3 -11. The
option
-b makes the assembler produce object files. Since no other option appears in each
command, the assembler will produce relocatable object files.