Macro Parameters/Substitution Symbols
5-10
Example 5–5 shows built-in substitution symbol functions.
Example 5–5. Using Built-In Substitution Symbol Functions
.asg
label, ADDR
; ADDR = label
.if
($symcmp(ADDR,”label”) = 0); evaluates to true
SUB
ADDR, A
.endif
.asg
”x,y,z” , list
; list = x,y,z
.if
($ismember(ADDR,list))
; addr = x, list = y,z
SUB
ADDRA, A
; sub x
.endif
5.3.4
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 5–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 5–6. Recursive Substitution
.asg
”x”,z
; declare z and assign z = ”x”
.asg
”z”,y
; declare y and assign y = ”z”
.asg
”y”,x
; declare x and assign x = ”y”
add
x, A
*
add
x, A
; recursive expansion
Содержание TMS320C54x
Страница 38: ......
Страница 39: ......
Страница 40: ......
Страница 41: ......
Страница 42: ......
Страница 43: ......
Страница 44: ......
Страница 45: ......
Страница 46: ......
Страница 47: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 51: ......
Страница 52: ......
Страница 53: ......
Страница 54: ......
Страница 55: ......
Страница 56: ......
Страница 57: ......
Страница 58: ......
Страница 59: ......
Страница 60: ......
Страница 61: ......
Страница 62: ......
Страница 276: ......
Страница 277: ......
Страница 278: ......
Страница 279: ......
Страница 280: ......
Страница 281: ......
Страница 282: ......
Страница 283: ......
Страница 284: ......
Страница 285: ......
Страница 286: ......
Страница 287: ......
Страница 288: ......
Страница 289: ......
Страница 290: ......
Страница 291: ......
Страница 292: ......
Страница 293: ......
Страница 294: ......
Страница 295: ......
Страница 296: ......
Страница 297: ......
Страница 298: ......
Страница 299: ......
Страница 300: ......
Страница 301: ......
Страница 302: ......