SPRU513Z August 2001 – October 2023 SM320F28335-EP
Define Macro
macname .macro [parameter1[, ... ,parametern]]
model statements or macro directives
.endm
The .macro and .endm directives are used to define 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, in an .include/.copy file, or in a macro library.
macname | names the macro. You must place the name in the source statement's label field. | |
.macro | identifies the source statement as the first line of a macro definition. You must place .macro in the opcode field. | |
[parameters] | are optional substitution symbols that appear as operands for the .macro directive. | |
model statements | are instructions or assembler directives that are executed each time the macro is called. | |
macro directives | are used to control macro expansion. | |
.endm | marks the end of the macro definition. |
Macros are explained in further detail in Chapter 6.