TMS320C28x Assembly Language Tools v15.12.0.LTS User's Guide
SPRU513J - REVISED JANUARY 2016

6 Macro Language Description

The TMS320C28x assembler supports a macro language that enables you to create your own instructions. This is especially useful when a program executes a particular task several times. The macro language lets you:

  • Define your own macros and redefine existing macros
  • Simplify long or complicated assembly code
  • Access macro libraries created with the archiver
  • Define conditional and repeatable blocks within a macro
  • Manipulate strings within a macro
  • Control expansion listing

6.1 Using Macros

Programs often contain routines that are executed several times. Instead of repeating the source statements for a routine, you can define the routine as a macro, then call the macro in the places where you would normally repeat the routine. This simplifies and shortens your source program.

If you want to call a macro several times but with different data each time, you can assign parameters within a macro. This enables you to pass different information to the macro each time you call it. The macro language supports a special symbol called a substitution symbol, which is used for macro parameters. See Section 6.3 for more information.

Using a macro is a 3-step process.

  1. Define the macro. You must define macros before you can use them in your program. There are two methods for defining macros:
    1. Macros can be defined at the beginning of a source file or in a copy/include file. See Section 6.2, Defining Macros, for more information.
    2. Macros can also be defined in a macro library. A macro library is a collection of files in archive format created by the archiver. Each member of the archive file (macro library) may contain one macro definition corresponding to the member name. You can access a macro library by using the .mlib directive. For more information, see Section 6.4.
  2. Call the macro. After you have defined a macro, call it by using the macro name as a mnemonic in the source program. This is referred to as a macro call.
  3. Expand the macro. The assembler expands your macros when the source program calls them. During expansion, the assembler passes arguments by variable to the macro parameters, replaces the macro call statement with the macro definition, then assembles the source code. By default, the macro expansions are printed in the listing file. You can turn off expansion listing by using the .mnolist directive. For more information, see Section 6.8.

When the assembler encounters a macro definition, it places the macro name in the opcode table. This redefines any previously defined macro, library entry, directive, or instruction mnemonic that has the same name as the macro. This allows you to expand the functions of directives and instructions, as well as to add new instructions.

6.2 Defining Macros

You can define a macro anywhere in your program, but you must define the macro before you can use it. Macros can be defined at the beginning of a source file or in a .copy/.include file (see Copy Source File); they can also be defined in a macro library. For more information about macro libraries, see Section 6.4.

Macro definitions can be nested, and they can call other macros, but all elements of the macro must be defined in the same file. Nested macros are discussed in Section 6.9.

A macro definition is a series of source statements in the following format:

macname .macro [parameter1 ] [, ... ,parametern ]
model statements or macro directives
[.mexit]
.endm
macname names the macro. You must place the name in the source statement's label field. Only the first 128 characters of a macro name are significant. The assembler places the macro name in the internal opcode table, replacing any instruction or previous macro definition with the same name.
.macro is the directive that identifies the source statement as the first line of a macro definition. You must place .macro in the opcode field.
parameter1,
parametern
are optional substitution symbols that appear as operands for the .macro directive. Parameters are discussed in Section 6.3.
model statements are instructions or assembler directives that are executed each time the macro is called.
macro directives are used to control macro expansion.
.mexit is a directive that functions as a goto .endm. The .mexit directive is useful when error testing confirms that macro expansion fails and completing the rest of the macro is unnecessary.
.endm is the directive that terminates the macro definition.

If you want to include comments with your macro definition but do not want those comments to appear in the macro expansion, use an exclamation point to precede your comments. If you do want your comments to appear in the macro expansion, use an asterisk or semicolon. See Section 6.7 for more information about macro comments.

Example 6-1 shows the definition, call, and expansion of a macro.

Example 6-1 Macro Definition, Call, and Expansion

1 * add3 arg1, arg2, arg3 2 * arg3 = arg1 + arg2 + arg3 3 4 add3 .macro P1, P2, P3, ADDRP 5 6 MOV ACC, P1 7 ADD ACC, P2 8 ADD ACC, P3 9 ADD ACC, ADDRP 10 .endm 11 12 .global ABC, def, ghi, adr 13 14 000000 add3 @abc, @def, @ghi, @adr 1 1 000000 E000! MOV ACC, @abc 1 000001 A000! ADD ACC, @def 1 000002 A000! ADD ACC, @ghi 1 000003 A000! ADD ACC, @adr 15

6.3 Macro Parameters/Substitution Symbols

If you want to call a macro several times with different data each time, you can assign parameters within the macro. The macro language supports a special symbol, called a substitution symbol, which is used for macro parameters.

Macro parameters are substitution symbols that represent a character string. These symbols can also be used outside of macros to equate a character string to a symbol name (see Section 4.7.8).

Valid substitution symbols can be up to 128 characters long and must begin with a letter. The remainder of the symbol can be a combination of alphanumeric characters, underscores, and dollar signs.

Substitution symbols used as macro parameters are local to the macro they are defined in. You can define up to 32 local substitution symbols (including substitution symbols defined with the .var directive) per macro. For more information about the .var directive, see Section 6.3.6.

During macro expansion, the assembler passes arguments by variable to the macro parameters. The character-string equivalent of each argument is assigned to the corresponding parameter. Parameters without corresponding arguments are set to the null string. If the number of arguments exceeds the number of parameters, the last parameter is assigned the character-string equivalent of all remaining arguments.

If you pass a list of arguments to one parameter or if you pass a comma or semicolon to a parameter, you must surround these terms with quotation marks.

At assembly time, the assembler replaces the macro parameter/substitution symbol with its corresponding character string, then translates the source code into object code.

Example 6-2 shows the expansion of a macro with varying numbers of arguments.

Example 6-2 Calling a Macro With Varying Numbers of Arguments

Macro definition:

Parms .macro a,b,c ; a = :a: ; b = :b: ; c = :c: .endm

Calling the macro:

Parms 100,label Parms 100,label,x,y ; a = 100 ; a = 100 ; b = label ; b = label ; c = "" ; c = x,y Parms 100, , x Parms "100,200,300",x,y ; a = 100 ; a = 100,200,300 ; b = "" ; b = x ; c = x ; c = y Parms """string""",x,y ; a = "string"; b = x ; c = y

6.3.1 Directives That Define Substitution Symbols

You can manipulate substitution symbols with the .asg and .eval directives.

  • The .asg directive assigns a character string to a substitution symbol.
  • For the .asg directive, the quotation marks are optional. If there are no quotation marks, the assembler reads characters up to the first comma and removes leading and trailing blanks. In either case, a character string is read and assigned to the substitution symbol. The syntax of the .asg directive is:

    .asg["]character string["], substitution symbol

Example 6-3 shows character strings being assigned to substitution symbols.

Example 6-3 The .asg Directive

.asg "A4", RETVAL ; return value
  • The .eval directive performs arithmetic on numeric substitution symbols.
  • The .eval directive evaluates the expression and assigns the string value of the result to the substitution symbol. If the expression is not well defined, the assembler generates an error and assigns the null string to the symbol. The syntax of the .eval directive is:

    .evalwell-defined expression, substitution symbol

Example 6-4 shows arithmetic being performed on substitution symbols.

Example 6-4 The .eval Directive

.asg 1,counter .loop 100 .word counter .eval counter + 1,counter .endloop

In Example 6-4, the .asg directive could be replaced with the .eval directive (.eval 1, counter) without changing the output. In simple cases like this, you can use .eval and .asg interchangeably. However, you must use .eval if you want to calculate a value from an expression. While .asg only assigns a character string to a substitution symbol, .eval evaluates an expression and then assigns the character string equivalent to a substitution symbol.

See Assign a Substitution Symbol for more information about the .asg and .eval assembler directives.

6.3.2 Built-In Substitution Symbol Functions

The following built-in substitution symbol functions enable you to make decisions on the basis of the string value of substitution symbols. These functions always return a value, and they can be used in expressions. Built-in substitution symbol functions are especially useful in conditional assembly expressions. Parameters of these functions are substitution symbols or character-string constants.

In the function definitions shown in Table 6-1, a and b are parameters that represent substitution symbols or character-string constants. The term string refers to the string value of the parameter. The symbol ch represents a character constant.

Table 6-1 Substitution Symbol Functions and Return Values

Function Return Value
$symlen(a) Length of string a
$symcmp(a,b) < 0 if a < b; 0 if a = b; > 0 if a > b
$firstch(a,ch) Index of the first occurrence of character constant ch in string a
$lastch(a,ch) Index of the last occurrence of character constant ch in string a
$isdefed(a) 1 if string a is defined in the symbol table
0 if string a is not defined in the symbol table
$ismember(a,b) Top member of list b is assigned to string a
0 if b is a null string
$iscons(a) 1 if string a is a binary constant
2 if string a is an octal constant
3 if string a is a hexadecimal constant
4 if string a is a character constant
5 if string a is a decimal constant
$isname(a) 1 if string a is a valid symbol name
0 if string a is not a valid symbol name
$isreg(a)(1) 1 if string a is a valid predefined register name
0 if string a is not a valid predefined register name
(1) For more information about predefined register names, see Section 4.7.6.

Example 6-5 shows built-in substitution symbol functions.

Example 6-5 Using Built-In Substitution Symbol Functions

1 global x, label 2 .asg label, ADDR ; ADDR = label 3 .if ($symcmp(ADDR,"label") = 0) ; evaluates to true 4 000000 8000! SUB ACC, @ADDR 5 .endif 6 .asg "x, y, z", list ; list = x, y, z 7 .if ($ismember(ADDR, list)) ; ADDR = x list = y,z 8 000001 8000! SUB ACC, @ADDR 9 .endif

6.3.3 Recursive Substitution Symbols

When the assembler encounters a substitution symbol, it attempts to substitute the corresponding character string. If that string is also a substitution symbol, the assembler performs substitution again. The assembler continues doing this until it encounters a token that is not a substitution symbol or until it encounters a substitution symbol that it has already encountered during this evaluation.

In Example 6-6, the x is substituted for z; z is substituted for y; and y is substituted for x. The assembler recognizes this as infinite recursion and ceases substitution.

Example 6-6 Recursive Substitution

1 .global x 2 .asg "x", z ; declare z and assign z = "x" 3 .asg "z", y ; declare y and assign y = "z" 4 .asg "y", x ; declare x and assign x = "y" 5 000000 FF10 ADD ACC, x 000001 0000! 6

6.3.4 Forced Substitution

In some cases, substitution symbols are not recognizable to the assembler. The forced substitution operator, which is a set of colons surrounding the symbol, enables you to force the substitution of a symbol's character string. Simply enclose a symbol with colons to force the substitution. Do not include any spaces between the colons and the symbol. The syntax for the forced substitution operator is:

:symbol:

The assembler expands substitution symbols surrounded by colons before expanding other substitution symbols.

You can use the forced substitution operator only inside macros, and you cannot nest a forced substitution operator within another forced substitution operator.

Example 6-7 shows how the forced substitution operator is used.

Example 6-7 Using the Forced Substitution Operator

force .macro x .loop 8 PORT:x: .set x*4 .eval x+1, x .endloop .endm .global portbase force PORT0 .set 0 PORT1 .set 4 . . . PORT7 .set 28

6.3.5 Accessing Individual Characters of Subscripted Substitution Symbols

In a macro, you can access the individual characters (substrings) of a substitution symbol with subscripted substitution symbols. You must use the forced substitution operator for clarity.

You can access substrings in two ways:

  • :symbol (well-defined expression):
  • This method of subscripting evaluates to a character string with one character.

  • :symbol (well-defined expression1, well-defined expression2):
  • In this method, expression1 represents the substring's starting position, and expression2 represents the substring's length. You can specify exactly where to begin subscripting and the exact length of the resulting character string. The index of substring characters begins with 1, not 0.

Example 6-8 and Example 6-9 show built-in substitution symbol functions used with subscripted substitution symbols. In Example 6-8, subscripted substitution symbols redefine the STW instruction so that it handles immediates. In Example 6-9, the subscripted substitution symbol is used to find a substring strg1 beginning at position start in the string strg2. The position of the substring strg1 is assigned to the substitution symbol pos.

Example 6-8 Using Subscripted Substitution Symbols to Redefine an Instruction

ADDX .macro ABC .var TMP .asg :ABC(1): , TMP .if $symcmp(TMP, "#") = 0 ADD ACC, ABC .else .emsg "Bad Macro Parameter" .endif .endm ADDX #100 ;macro call

Example 6-9 Using Subscripted Substitution Symbols to Find Substrings

substr .macro start,strg1,strg2,pos .var len1,len2,i,tmp .if $symlen(start) = 0 .eval 1,start .endif .eval 0,pos .eval start,i .eval $symlen(strg1),len1 .eval $symlen(strg2),len2 .loop .break i = (len2 - len1 + 1) .asg ":strg2(i,len1):",tmp .if $symcmp(strg1,tmp) = 0 .eval i,pos .break .else .eval i + 1,i .endif .endloop .endm .asg 0,pos .asg "ar1 ar2 ar3 ar4",regs substr 1,"ar2",regs,pos .word pos

6.3.6 Substitution Symbols as Local Variables in Macros

If you want to use substitution symbols as local variables within a macro, you can use the .var directive to define up to 32 local macro substitution symbols (including parameters) per macro. The .var directive creates temporary substitution symbols with the initial value of the null string. These symbols are not passed in as parameters, and they are lost after expansion.

.var sym1 [,sym2 , ... ,symn ]

The .var directive is used in Example 6-8 and Example 6-9.

6.4 Macro Libraries

One way to define macros is by creating a macro library. A macro library is a collection of files that contain macro definitions. You must use the archiver to collect these files, or members, into a single file (called an archive). Each member of a macro library contains one macro definition. The files in a macro library must be unassembled source files. The macro name and the member name must be the same, and the macro filename's extension must be .asm. For example:

Macro Name Filename in Macro Library
simple simple.asm
add3 add3.asm

You can access the macro library by using the .mlib assembler directive (described in Define Macro Library). The syntax is:

.mlibfilename

When the assembler encounters the .mlib directive, it opens the library named by filename and creates a table of the library's contents. The assembler enters the names of the individual members within the library into the opcode tables as library entries; this redefines any existing opcodes or macros that have the same name. If one of these macros is called, the assembler extracts the entry from the library and loads it into the macro table.

The assembler expands the library entry the same way it expands other macros. See Section 6.1 for how the assembler expands macros. You can control the listing of library entry expansions with the .mlist directive. For information about the .mlist directive, see Section 6.8 and Start/Stop Macro Expansion Listing. Only macros that are actually called from the library are extracted, and they are extracted only once.

You can use the archiver to create a macro library by including the desired files in an archive. A macro library is no different from any other archive, except that the assembler expects the macro library to contain macro definitions. The assembler expects only macro definitions in a macro library; putting object code or miscellaneous source files into the library may produce undesirable results. For information about creating a macro library archive, see Section 7.1.

6.5 Using Conditional Assembly in Macros

The conditional assembly directives are .if/.elseif/.else/.endif and .loop/ .break/.endloop. They can be nested within each other up to 32 levels deep. The format of a conditional block is:

.ifwell-defined expression
[.elseifwell-defined expression]
[.else]
.endif

The .elseif and .else directives are optional in conditional assembly. The .elseif directive can be used more than once within a conditional assembly code block. When .elseif and .else are omitted and when the .if expression is false (0), the assembler continues to the code following the .endif directive. See Assemble Conditional Blocks for more information on the .if/ .elseif/.else/.endif directives.

The .loop/.break/.endloop directives enable you to assemble a code block repeatedly. The format of a repeatable block is:

.loop [well-defined expression]
[.break [well-defined expression]]
.endloop

The .loop directive's optional well-defined expression evaluates to the loop count (the number of loops to be performed). If the expression is omitted, the loop count defaults to 1024 unless the assembler encounters a .break directive with an expression that is true (nonzero). See Assemble Conditional Blocks Repeatedly for more information on the .loop/.break/.endloop directives.

The .break directive and its expression are optional in repetitive assembly. If the expression evaluates to false, the loop continues. The assembler breaks the loop when the .break expression evaluates to true or when the .break expression is omitted. When the loop is broken, the assembler continues with the code after the .endloop directive. For more information, see Section 5.8.

Example 6-10 , Example 6-11, and Example 6-12 show the .loop/.break/ .endloop directives, properly nested conditional assembly directives, and built-in substitution symbol functions used in a conditional assembly code block.

Example 6-10 The .loop/.break/.endloop Directives

.asg 1,x .loop .break (x == 10) ; if x == 10, quit loop/break with expression .eval x+1,x .endloop

Example 6-11 Nested Conditional Assembly Directives

.asg 1,x .loop .if (x == 10) ; if x == 10, quit loop .break (x == 10) ; force break .endif .eval x+1,x .endloop

Example 6-12 Built-In Substitution Symbol Functions in a Conditional Assembly Code Block

MACK3 .macro src1, src2, sum, k ; sum = sum + k * (src1 * src2) .if k = 0 MOV T,#src1 MPY ACC,T,#src2 MOV DP,#sum ADD @sum,AL .else MOV T,#src1 MPY ACC,T,#k MOV T,AL MPY ACC,T,#src2 MOV DP,#sum ADD @sum,AL .endif .endm .global A0, A1, A2 MACK3 A0,A1,A2,0 MACK3 A0,A1,A2,100

6.6 Using Labels in Macros

All labels in an assembly language program must be unique. This includes labels in macros. If a macro is expanded more than once, its labels are defined more than once. Defining a label more than once is illegal. The macro language provides a method of defining labels in macros so that the labels are unique. Simply follow each label with a question mark, and the assembler replaces the question mark with a period followed by a unique number. When the macro is expanded, you do not see the unique number in the listing file. Your label appears with the question mark as it did in the macro definition. You cannot declare this label as global. See Section 4.7.3 for more about labels.

The syntax for a unique label is:

label?

Example 6-13 shows unique label generation in a macro. The maximum label length is shortened to allow for the unique suffix. For example, if the macro is expanded fewer than 10 times, the maximum label length is 126 characters. If the macro is expanded from 10 to 99 times, the maximum label length is 125. The label with its unique suffix is shown in the cross-listing file. To obtain a cross-listing file, invoke the assembler with the --cross_reference option (see Section 4.3).

Example 6-13 Unique Labels in a Macro

1 2 min .macro x, y, z 3 4 MOV z, y 5 CMP x, y 6 B l?,GT 7 MOV z, x 8 l? 9 .endm 10 11 00000000 min AH, AL, PH 1 1 00000000 2FA9 MOV PH, AL 1 00000001 55A9 CMP AH, AL 1 00000002 6202 B l?,GT 1 00000003 2FA8 MOV PH, AH 1 l? 12 LABEL VALUE DEFN REF .TMS320C2800 000001 0 .TMS320C2800_FPU32 000000 0 .TMS320C2800_FPU64 000000 0 __TI_ASSEMBLER_VERSION_QUAL_ID__ 001c52 0 __TI_ASSEMBLER_VERSION_QUAL__ 000049 0 __TI_ASSEMBLER_VERSION__ 4c4f28 0 l$1$ 000004' 12 11

6.7 Producing Messages in Macros

The macro language supports three directives that enable you to define your own assembly-time error and warning messages. These directives are especially useful when you want to create messages specific to your needs. The last line of the listing file shows the error and warning counts. These counts alert you to problems in your code and are especially useful during debugging.

.emsg sends error messages to the listing file. The .emsg directive generates errors in the same manner as the assembler, incrementing the error count and preventing the assembler from producing an object file.
.mmsg sends assembly-time messages to the listing file. The .mmsg directive functions in the same manner as the .emsg directive but does not set the error count or prevent the creation of an object file.
.wmsg sends warning messages to the listing file. The .wmsg directive functions in the same manner as the .emsg directive, but it increments the warning count and does not prevent the generation of an object file.

Macro comments are comments that appear in the definition of the macro but do not show up in the expansion of the macro. An exclamation point in column 1 identifies a macro comment. If you want your comments to appear in the macro expansion, precede your comment with an asterisk or semicolon.

Example 6-14 shows user messages in macros and macro comments that do not appear in the macro expansion.

For more information about the .emsg, .mmsg, and .wmsg assembler directives, see Define Messages.

Example 6-14 Producing Messages in a Macro

1 testparam .macro x, y 2 ! 3 ! This macro checks for the correct number of parameters. 4 ! It generates an error message if x and y are not present. 5 ! 6 ! The first line tests for proper input. 7 ! 8 .if ($symlen(x) == 0) 9 .emsg "ERROR --missing parameter in call to TEST" 10 .mexit 11 .else 12 MOV ACC, #2 13 MOV AL, #1 14 ADD ACC, @AL 15 .endif 16 .endm 17 18 000000 testparam 1, 2 1 .if ($symlen(x) == 0) 1 .emsg "ERROR --missing parameter in call to TEST"1 .mexit 1 .else 1 000000 FF20 MOV ACC, #2 000001 0002 1 000002 9A01 MOV AL, #1 1 000003 A0A9 ADD ACC, @AL 1 .endif

6.8 Using Directives to Format the Output Listing

Macros, substitution symbols, and conditional assembly directives may hide information. You may need to see this hidden information, so the macro language supports an expanded listing capability.

By default, the assembler shows macro expansions and false conditional blocks in the list output file. You may want to turn this listing off or on within your listing file. Four sets of directives enable you to control the listing of this information:

  • Macro and loop expansion listing
.mlist expands macros and .loop/.endloop blocks. The .mlist directive prints all code encountered in those blocks.

.mnolist

suppresses the listing of macro expansions and .loop/ .endloop blocks.
For macro and loop expansion listing, .mlist is the default.

  • False conditional block listing
.fclist causes the assembler to include in the listing file all conditional blocks that do not generate code (false conditional blocks). Conditional blocks appear in the listing exactly as they appear in the source code.
.fcnolist suppresses the listing of false conditional blocks. Only the code in conditional blocks that actually assemble appears in the listing. The .if, .elseif, .else, and .endif directives do not appear in the listing.
For false conditional block listing, .fclist is the default.

  • Substitution symbol expansion listing
.sslist expands substitution symbols in the listing. This is useful for debugging the expansion of substitution symbols. The expanded line appears below the actual source line.
.ssnolist turns off substitution symbol expansion in the listing.
For substitution symbol expansion listing, .ssnolist is the default.

  • Directive listing
.drlist causes the assembler to print to the listing file all directive lines.
.drnolist suppresses the printing of certain directives in the listing file. These directives are .asg, .eval, .var, .sslist, .mlist, .fclist, .ssnolist, .mnolist, .fcnolist, .emsg, .wmsg, .mmsg, .length, .width, and .break.
For directive listing, .drlist is the default.

6.9 Using Recursive and Nested Macros

The macro language supports recursive and nested macro calls. This means that you can call other macros in a macro definition. You can nest macros up to 32 levels deep. When you use recursive macros, you call a macro from its own definition (the macro calls itself).

When you create recursive or nested macros, you should pay close attention to the arguments that you pass to macro parameters because the assembler uses dynamic scoping for parameters. This means that the called macro uses the environment of the macro from which it was called.

Example 6-15 shows nested macros. The y in the in_block macro hides the y in the out_block macro. The x and z from the out_block macro, however, are accessible to the in_block macro.

Example 6-15 Using Nested Macros

in_block .macro y,a . ; visible parameters are y,a and x,z from the calling macro .endm out_block .macro x,y,z . ; visible parameters are x,y,z . in_block x,y ; macro call with x and y as arguments . . .endm out_block ; macro call

Example 6-16 shows recursive and fact macros. The fact macro produces assembly code necessary to calculate the factorial of n, where n is an immediate value. The result is placed in the A register. The fact macro accomplishes this by calling fact1, which calls itself recursively.

Example 6-16 Using Recursive Macros

1 .fcnolist 2 3 fact .macro N, LOC 4 5 .if N < 2 6 MOV @LOC, #1 7 .else 8 MOV @LOC, #N 9 10 11 .eval N-1, N 12 fact1 13 14 .endif 15 .endm 16 17 fact1 .macro 18 .if N > 1 19 MOV @T, @LOC 20 MPYB @P, @T, #N 21 MOV @LOC, @P 22 MOV ACC, @LOC 23 .eval N - 1, N 24 fact1 25 26 .endif 27 .endm

6.10 Macro Directives Summary

The directives listed in Table 6-2 through Table 6-6 can be used with macros. The .macro, .mexit, .endm and .var directives are valid only with macros; the remaining directives are general assembly language directives.

Table 6-2 Creating Macros

See
Mnemonic and Syntax Description Macro Use Directive
.endm End macro definition Section 6.2 .endm
macname .macro [parameter1 ][,... , parametern ] Define macro by macname Section 6.2 .macro
.mexit Go to .endm Section 6.2 Section 6.2
.mlib filename Identify library containing macro definitions Section 6.4 .mlib

Table 6-3 Manipulating Substitution Symbols

See
Mnemonic and Syntax Description Macro Use Directive
.asg ["]character string["], substitution symbol Assign character string to substitution symbol Section 6.3.1 .asg
.eval well-defined expression, substitution symbol Perform arithmetic on numeric substitution symbols Section 6.3.1 .eval
.var sym1 [,sym2 , ...,symn ] Define local macro symbols Section 6.3.6 .var

Table 6-4 Conditional Assembly

See
Mnemonic and Syntax Description Macro Use Directive
.break [well-defined expression] Optional repeatable block assembly Section 6.5 .break
.endif End conditional assembly Section 6.5 .endif
.endloop End repeatable block assembly Section 6.5 .endloop
.else Optional conditional assembly block Section 6.5 .else
.elseif well-defined expression Optional conditional assembly block Section 6.5 .elseif
.if well-defined expression Begin conditional assembly Section 6.5 .if
.loop [well-defined expression] Begin repeatable block assembly Section 6.5 .loop

Table 6-5 Producing Assembly-Time Messages

See
Mnemonic and Syntax Description Macro Use Directive
.emsg Send error message to standard output Section 6.7 .emsg
.mmsg Send assembly-time message to standard output Section 6.7 .mmsg
.wmsg Send warning message to standard output Section 6.7 .wmsg

Table 6-6 Formatting the Listing

See
Mnemonic and Syntax Description Macro Use Directive
.fclist Allow false conditional code block listing (default) Section 6.8 .fclist
.fcnolist Suppress false conditional code block listing Section 6.8 .fcnolist
.mlist Allow macro listings (default) Section 6.8 .mlist
.mnolist Suppress macro listings Section 6.8 .mnolist
.sslist Allow expanded substitution symbol listing Section 6.8 .sslist
.ssnolist Suppress expanded substitution symbol listing (default) Section 6.8 .ssnolist
Submit Documentation Feedback

Copyright© 2016, Texas Instruments Incorporated. An IMPORTANT NOTICE for this document addresses availability, warranty, changes, use in safety-critical applications, intellectual property matters and other important disclaimers.