User`s guide
Pragmas for the DSP56800 and DSP56800E
Pragma Reference
415Targeting MC56F83xx/DSP5685x Controllers
use_rodata
Controls the section where constant data is emitted.
Compatibility
This pragma is compatible with the DSP56800, but it is not compatible with the
DSP56800E.
Prototype
#pragma use_rodata [ on | off | reset ]
Remarks
By default, the compiler emits const defined data to the .data section. There are two
ways to cause the compiler to emit const defined data to the .rodata section:
1. Setting the “write const data to .rodata section” option in the M56800 Processor
Settings panel.
This method is a global change and emits all const-defined data to the .rodata
section for the current build target.
2. Using #pragma use_rodata [on | off | reset].
on Write const data to .rodata section.
off Write const data to .data section.
reset Toggle pragma state.
To use this pragma, place the pragma before the const data that you wish the
compiler to emit to the .rodata section. This method overrides the target setting
and allows a subset of constant data to be emitted to or excluded from the .rodata
section.
To see the usage of the pragma use_rodata see the code example in Listing C.18
.
Listing C.18 Sample Code _ Pragma use_rodata
const UInt16 len_l_mult_ls_data = sizeof(l_mult_ls_data) /
sizeof(Frac32) ;
const Int16 g = a+b+c;