User`s guide
C for DSP56800E
Large Data Model Support
130
Targeting MC56F83xx/DSP5685x Controllers
You do not need to change C source code to take advantage of the large data memory
model.
Examples in DSP56800E assembly code of extended data addressing are:
Extended Data Addressing Example
Consider the code of Listing 6.5:
Listing 6.5 Addressing Extended Data
move.w x:0x123456,A1 ; move int using 24 bit absolute address
tst.l x:(R0-0x123456) ; test a global long for zero using 24-bit
; pointer indexed addressing
move.l r0,x:(R0)+ ; r0 stored as 24-bit quantity
cmpa r0,r1 ; compare pointer registers as 24 bit
; quantities
The large data memory model is convenient because you can place data objects
anywhere in the 24-bit data memory map. But the model is inefficient because
extended data addressing requires more program memory and additional execution
cycles.
However, all global and static data of many target applications easily fits within the 64
KB word memory boundary. With this in mind, you can check the Globals live in
lower memory checkbox of the M56800E Processor settings panel. This tells the
compiler to access global and static data with 16-bit addresses, but to use 24-bit
addressing for all pointer and stack operations. This arrangement combines the
flexibility of the large data memory model with the efficiency of the small data
model’s access to globals and statics.
NOTE
If you check the Globals live in lower memory checkbox, be sure to
store data in lower memory.
Accessing Data Objects Examples
Table 6.5 and Table 6.6 show appropriate ways to access a global integer and a global
pointer variable. The first two columns of each table list states of two checkboxes,
Large Data Model and Globals live in lower memory. Both checkboxes are in the
M56800E Processor settings panel. Note that the first enables the second.