
5-24
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
#pragma Directive
where“a” is the run time counter and
runtime_address
is the optional initial value for that
counter, as specified in the “argument” to
#pragma
.
“b” is the load time counter and
loadtime_address
is the optional initial value for that
counter, as specified in the “argument” to
#pragma
.
The following two examples illustrate that the load time counter is optional. See the
section on the ORG statement in the
Motorola DSP56000/DSP56001 Assembler Manual
for a complete description and list of options.
Notice that the pragma directive run-time counter string will only affect the run-time
address and the pragma directive load-time counter string will only affect the load-time
address.
As a simple example, assuming that y-memory model (or default memory model) is used
(see Chapter 3 to change the memory model to be used), the following C segment
#pragma y_load x:$100
int coeff[5] = {0x19999a, 0x200000, 0x266666, 0x2ccccd,
0x333333};
#pragma y_load
produces the following assembly language code:
globalFcoeff
orgy:,x:$100
Fcoeff
dc 1677722
dc 2097152
dc 2516582
dc 2936013
dc 3355443
Notice that the second #pragma directive will remove the affect of the first memory
specification, i.e.,
#pragma y_load
x:$100, and the rest of the code generated by the C
compiler will be in the default memory area (see Chapter 3 in order to change this default
memory model).
The above example code will be loaded in the X memory location $100, and it should be
copied to the Y memory space upon system start-up. When burning a PROM, only one
memory space is desired to be used, as an example, P memory space, so that only one
PROM is enough for both data and program. In such case, both the data and the program
will be burned in the PROM and the data should be moved to the data memory space
(either, X, Y or L memory space depending on the program) upon system start-up.
F
Freescale Semiconductor, Inc.
n
.