SPRUI03E June 2015 – January 2023
Uninitialized sections reserve space in TMS320C6000 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 bytes[, alignment[, bank offset] ] | |
symbol | .usect "section name", size in bytes[, alignment[, bank offset] ] |
symbol | points to the first byte reserved by this invocation of the .bss or .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 bytes | is an absolute expression (see Section 5.10). The .bss directive reserves size in bytes bytes in the .bss section. The .usect directive reserves size in bytes bytes in section name. For both directives, you must specify a size; there is no default value. |
alignment | is an optional parameter. It specifies the minimum alignment in bytes required by the space allocated. The default value is byte aligned; this option is represented by the value 1. The value must be a power of 2. |
bank offset | is an optional parameter. It ensures that the space allocated to the symbol occurs on a specific memory bank boundary. The bank offset measures the number of bytes to offset from the alignment specified before assigning the symbol to that location. |
section name | specifies the user-named section in which to reserve space. See Section 3.5.3. |
Initialized section directives (.text, .data, and .sect) change which section is considered the current section (see Section 3.5.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 3.5.7.
The .usect directive can also be used to create uninitialized subsections. See Section 3.5.6 for more information on creating subsections.
The .nearcommon and .farcommon directives are similar to directives that create uninitialized data sections, except that common symbols are created by the linker instead.