SPRUI03E June 2015 – January 2023
Table 6-1 through Table 6-15 summarize the assembler directives. In addition to the directives documented here, the TMS320C6000 software tools support the following directives:
Mnemonic and Syntax | Description | See |
---|---|---|
.bss
symbol,
size in
bytes[,
alignment
[, bank offset]] |
Reserves size bytes in the .bss (uninitialized data) section | .bss topic |
.data | Assembles into the .data (initialized data) section | .data topic |
.sect "section name" | Assembles into a named (initialized) section | .sect topic |
.text | Assembles into the .text (executable code) section | .text topic |
symbol
.usect "section name",
size in bytes
[, alignment[,bank offset]] |
Reserves size bytes in a named (uninitialized) section | .usect topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.endgroup | Ends the group declaration. | .endgroup topic |
.gmember section name | Designates section name as a member of the group. | .gmember topic |
.group group section name group type : | Begins a group declaration. | .group topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.retain "section name" | Instructs linker to include current or specified section in the linked output file, regardless of whether section is referenced or not | .retain topic |
.retainrefs "section name" | Instructs the linker to include any data object that references the current or specified section. | .retain topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.bits value1[, ... , valuen] | Initializes one or more successive bits in the current section | .bits topic |
.byte value1[, ... , valuen] | Initializes one or more successive bytes in the current section | .byte topic |
.char value1[, ... , valuen] | Initializes one or more successive bytes in the current section | .char topic |
.cstring {expr1|"string1"}[,... , {exprn|"stringn"}] | Initializes one or more text strings | .string topic |
.double value1[, ... , valuen] | Initializes one or more 64-bit, IEEE double-precision, floating-point constants | .double topic |
.field value[, size] | Initializes a field of size bits (1-32) with value | .field topic |
.float value1[, ... , valuen] | Initializes one or more 32-bit, IEEE single-precision, floating-point constants | .float topic |
.half value1[, ... , valuen] | Initializes one or more 16-bit integers (halfword) | .half topic |
.int value1[, ... , valuen] | Initializes one or more 32-bit integers | .int topic |
.long value1[, ... , valuen] | Initializes one or more 32-bit integers | .long topic |
.short value1[, ... , valuen] | Initializes one or more 16-bit integers (halfword) | .short topic |
.string {expr1|"string1"}[,... , {exprn|"stringn"}] | Initializes one or more text strings | .string topic |
.ubyte value1[, ... , valuen] | Initializes one or more successive unsigned bytes in current section | .ubyte topic |
.uchar value1[, ... , valuen] | Initializes one or more successive unsigned bytes in current section | .uchar topic |
.uhalf value1[, ... , valuen] | Initializes one or more unsigned 16-bit integers (halfword) | .uhalf topic |
.uint value1[, ... , valuen] | Initializes one or more unsigned 32-bit integers | .uint topic |
.ulong value1[, ... , valuen] | Initializes one or more unsigned 32-bit integers | .long topic |
.ushort value1[, ... , valuen] | Initializes one or more unsigned 16-bit integers (halfword) | .short topic |
.uword value1[, ... , valuen] | Initializes one or more unsigned 32-bit integers | .uword topic |
.word value1[, ... , valuen] | Initializes one or more 32-bit integers | .word topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.align [size in bytes ] | Aligns the SPC on a boundary specified by size in bytes , which must be a power of 2; defaults to byte boundary | .align topic |
.bes size | Reserves size bytes in the current section; a label points to the end of the reserved space | .bes topic |
.space size | Reserves size bytes in the current section; a label points to the beginning of the reserved space | .space topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.drlist | Enables listing of all directive lines (default) | .drlist topic |
.drnolist | Suppresses listing of certain directive lines | .drnolist topic |
.fclist | Allows false conditional code block listing (default) | .fclist topic |
.fcnolist | Suppresses false conditional code block listing | .fcnolist topic |
.length [page length] | Sets the page length of the source listing | .length topic |
.list | Restarts the source listing | .list topic |
.mlist | Allows macro listings and loop blocks (default) | .mlist topic |
.mnolist | Suppresses macro listings and loop blocks | .mnolist topic |
.nolist | Stops the source listing | .nolist topic |
.option option1[, option2 , . . .] | Selects output listing options; available options are A, B, D, H, L, M, N, O, R, T, W, and X | .option topic |
.page | Ejects a page in the source listing | .page topic |
.sslist | Allows expanded substitution symbol listing | .sslist topic |
.ssnolist | Suppresses expanded substitution symbol listing (default) | .ssnolist topic |
.tab size | Sets tab to size characters | .tab topic |
.title "string" | Prints a title in the listing page heading | .title topic |
.width [page width] | Sets the page width of the source listing | .width topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.copy ["]filename["] | Includes source statements from another file | .copy topic |
.include ["]filename["] | Includes source statements from another file | .include topic |
.mlib ["]filename["] | Specifies a macro library from which to retrieve macro definitions | .mlib topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.common
symbol,
size in bytes [, alignment] .common symbol, structure tag [, alignment] |
Defines a common symbol for a variable. | .common topic |
.def symbol1[, ... , symboln] | Identifies one or more symbols that are defined in the current module and that can be used in other modules. | .def topic |
.farcommon
symbol,
size in bytes [, alignment]r .farcommon symbol, structure tag [, alignment] |
Defines a common symbol in far memory. | .farcommon topic |
.global symbol1[, ... , symboln] | Identifies one or more global (external) symbols. | .global topic |
.nearcommon
symbol,
size in bytes [, alignment]r .nearcommon symbol, structure tag [, alignment] |
Defines a common symbol in near memory. | .farcommon topic |
.ref symbol1[, ... , symboln] | Identifies one or more symbols used in the current module that are defined in another module. | .ref topic |
.symdepend dst symbol name[, src symbol name] | Creates an artificial reference from a section to a symbol. | .symdepend topic |
.weak symbol name | Identifies a symbol used in the current module that is defined in another module. | .weak topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.asg ["]character string["], substitution symbol | Assigns a character string to substitution symbol. Substitution symbols created with .asg can be redefined. | .asg topic |
.clearmap | Cancels all .map assignments. Used by compiler for linear assembly source. | .clearmap topic |
.define ["]character string["], substitution symbol | Assigns a character string to substitution symbol. Substitution symbols created with .define cannot be redefined. | .asg topic |
symbol .equ value | Equates value with symbol | .equ topic |
.elfsym name, SYM_SIZE(size) | Provides ELF symbol information | .elfsym topic |
.eval
expression,
substitution symbol |
Performs arithmetic on a numeric substitution symbol | .eval topic |
.label symbol | Defines a load-time relocatable label in a section | .label topic |
.map symbol/register | Assigns symbol to register. Used by compiler for linear assembly source. | .map topic |
.newblock | Undefines local labels | .newblock topic |
symbol .set value | Equates value with symbol | .set topic |
.unasg symbol | Turns off assignment of symbol as a substitution symbol | .unasg topic |
.undefine symbol | Turns off assignment of symbol as a substitution symbol | .unasg topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.if condition | Assembles code block if the condition is true | .if topic |
.else | Assembles code block if the .if condition is false. When using the .if construct, the .else construct is optional. | .else topic |
.elseif condition | Assembles code block if the .if condition is false and the .elseif condition is true. When using the .if construct, the .elseif construct is optional. | .elseif topic |
.endif | Ends .if code block | .endif topic |
.loop [count] | Begins repeatable assembly of a code block; the loop count is determined by the count. | .loop topic |
.break [end condition] | Ends .loop assembly if end condition is true. When using the .loop construct, the .break construct is optional. | .break topic |
.endloop | Ends .loop code block | .endloop topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.cstruct | Acts like .struct, but adds padding and alignment like that which is done to C structures | .cstruct topic |
.cunion | Acts like .union, but adds padding and alignment like that which is done to C unions | .cunion topic |
.emember | Sets up C-like enumerated types in assembly code | Section 6.10 |
.endenum | Sets up C-like enumerated types in assembly code | Section 6.10 |
.endstruct | Ends a structure definition | .cstruct topic, .struct topic |
.endunion | Ends a union definition | .cunion topic, .union topic |
.enum | Sets up C-like enumerated types in assembly code | Section 6.10 |
.union | Begins a union definition | .union topic |
.struct | Begins structure definition | .struct topic |
.tag | Assigns structure attributes to a label | .cstruct topic, .struct topic.union topic |
Mnemonic and Syntax | Description | See |
---|---|---|
macname .macro [parameter1][,... , parametern ] | Begin definition of macro named macname | .macro topic |
.endm | End macro definition | .endm topic |
.mexit | Go to .endm | Section 7.3 |
.mlib filename | Identify library containing macro definitions | .mlib topic |
.var | Adds a local substitution symbol to a macro's parameter list | .var topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.emsg string | Sends user-defined error messages to the output device; produces no .obj file | .emsg topic |
.mmsg string | Sends user-defined messages to the output device | .mmsg topic |
.noremark[num] | Identifies the beginning of a block of code in which the assembler suppresses the num remark | .noremark topic |
.remark [num] | Resumes the default behavior of generating the remark(s) previously suppressed by .noremark | .remark topic |
.wmsg string | Sends user-defined warning messages to the output device | .wmsg topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.asmfunc | Identifies the beginning of a block of code that contains a function | .asmfunc topic |
.endasmfunc | Identifies the end of a block of code that contains a function | .endasmfunc topic |
Mnemonic and Syntax | Description | See |
---|---|---|
.cdecls [options,]"filename"[, "filename2"[, ...] | Share C headers between C and assembly code | .cdecls topic |
.end | Ends program | .end topic |
.nocmp | Instructs tools to not utilize 16-bit instructions for section | .nocmp topic |
In addition to the assembly directives that you can use in your code, the C/C++ compiler produces several directives when it creates assembly code. These directives are to be used only by the compiler; do not attempt to use these directives: