SPRU513Z August 2001 – October 2023 SM320F28335-EP
Uninitialized sections reserve space in TMS320C28x memory; they are usually placed in RAM. These sections have no actual contents in the object file; they simply reserve memory. A program can use this space at run time for creating and storing variables.
Uninitialized data areas are built by using the following assembler directives.
Each time you invoke the .bss or .usect directive, the assembler reserves additional space in the .bss or the user-named section. The syntax is:
.bss symbol, size in words[, blocking flag[, alignment flag] ] | |
symbol | .usect "section name", size in words[, blocking flag[, alignment flag] ] |
symbol | points to the first word reserved by this invocation of the .usect directive. The symbol corresponds to the name of the variable for which you are reserving space. It can be referenced by any other section and can also be declared as a global symbol (with the .global directive). |
size in words | is an absolute expression (see Section 4.9). The .usect directive reserves size in words words in section name. You must specify a size; there is no default value. |
blocking flag | is an optional parameter. If you specify a value greater than 0 for this parameter, the assembler allocates size in words contiguously. This means the allocated space does not cross a page boundary unless its size is greater than a page, in which case the allocated space starts a page boundary. By default, the compiler causes this flag to be set to 0 so that DP load optimization is used. The compiler provides the "blocked" and "noblocked" variable attributes for controlling blocking on a per-variable basis. For examples of DP load optimization, see the Tools Insider blog in TI's E2E community. |
alignment flag | is an optional parameter. It causes the assembler to allocate the specified size in words on long word boundaries. The resulting alignment will be on a boundary that is 2 to the power of the specified alignment flag. For example, an alignment flag of 5 gives an alignment of 2**5, which is 32 words. |
section name | specifies the user-named section in which to reserve space. See Section 2.4.3. |
Initialized section directives (.text, .data, and .sect) change which section is considered the current section (see Section 2.4.4). However, the .bss and .usect directives do not change the current section; they simply escape from the current section temporarily. Immediately after a .bss or .usect directive, the assembler resumes assembling into whatever the current section was before the directive. The .bss and .usect directives can appear anywhere in an initialized section without affecting its contents. For an example, see Section 2.4.7.
The .usect directive can also be used to create uninitialized subsections. See Section 2.4.6 for more information on creating subsections.
The .common directive (EABI only) is similar to directives that create uninitialized data sections, except that common symbols are created by the linker instead.