User`s guide

Using the Configuration Tool
2-8
The small model makes assumptions about the placement of global data in
order to reduce the number of instruction cycles. If you are using the small
model (the default compilation mode) to optimize global data access, your
code can be modified to make sure that it references objects created with the
Configuration Tool correctly.
There are four methods for dealing with this issue. These methods are
described in the sections following and have the pros and cons as shown in
Example 2-1.
Table 2-1. Methods of Referencing C6000 Global Objects
2.2.7.1 Referencing Static DSP/BIOS Objects in the Small Model (C6000 Platform Only)
In the small model, all compiled code accesses global data relative to a data
page pointer register. The register B14 is treated as a read-only register by
the compiler and is initialized with the starting address of the .bss section
during program startup. Global data is assumed to be at a constant offset
from the beginning of the .bss section and this section is assumed to be at
most 32K bytes in length. Global data, therefore, can be accessed with a
single instruction like the following:
LDW *+DP(_x), A0 ; load _x into A0 (DP = B14)
Method
Declare
objects
with far
Use global
object
pointers
Objects
adjacent
to .bss
Compile
with large
model
Code works independent of compilation model Yes Yes Yes Yes
Code works independent of object placement Yes Yes No Yes
C code is portable to other compilers No Yes Yes Yes
Size of all statically created objects not limited to 32K
bytes
Yes Yes No Yes
Minimizes size of .bss Yes Yes No Yes
Minimizes instruction cycles
No
(3 cycles)
No
(2-6 cycles)
Yes
(1 cycle)
No
(3 cycles)
Minimizes storage per object
No
(12 bytes)
No
(12 bytes)
Yes
(4 bytes)
No
(12 bytes)
Easy to remember when programming; easy to find
errors
Somewhat Error prone Somewhat Yes