11.5.2 Macro Local Variables
Example 11–4. Macro Local Variables
When macro local variables are encountered, they are changed so that
repeated calls to the macro do not generate identical labels. The following
source code preprocesses to the intermediate code as shown:
(a) Source code
mymac .macro
lab?
.word
.endm
mymac 4
mymac 40
mymac 400
(b) Intermediate code
mymac
.macro
lab?
.word
.endm
;
mymac 4
lab$1$
.word
;
mymac 40
lab$2$
.word
;
mymac 400
lab$3$
.word
The local label name is appended with $ n $, where n is the number of the macro
invocation. Insure that there are no other labels that could be identical to a
generated macro local label.
How the Translator Works With Macros
parm1
parm1
parm1
parm1
4
40
400
Mnemonic-to-Algebraic Translator Description
11-9
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?