Directives That Define Substitution Symbols - Texas Instruments TMS320C54x User Manual

Digital signal processors
Hide thumbs Also See for TMS320C54x:
Table of Contents

Advertisement

Macro Parameters/Substitution Symbols
5.3.2

Directives That Define Substitution Symbols

Example 5–3. The .asg Directive
Example 5–4. The .eval Directive
5-8
You can manipulate substitution symbols with the .asg and .eval directives.
The .asg directive assigns a character string to a substitution symbol.
The syntax of the .asg directive is:
.asg ["] character string ["] , substitution symbol
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.
Example 5–3 shows character strings being assigned to substitution symbols.
.asg AR0,FP
.asg *AR1+,Ind
.asg *AR1+0b,Rc_Prop
.asg """string""",strng
.asg "a,b,c",parms
The .eval directive performs arithmetic on numeric substitution symbols.
The syntax of the .eval directive is
.eval well-defined expression, substitution symbol
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.
Example 5–4 shows arithmetic being performed on substitution symbols.
.asg
1,counter
.loop 100
.word counter
.eval counter + 1,counter
.endloop
;
frame pointer
;
indirect addressing
;
reverse carry propagation
;
string
;
parameters

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C54x and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents