Macro Syntax

MPASM Assembler

Macro Syntax

MPASM assembler macros are defined according to the following syntax:

<label> macro [<arg1>,<arg2> ..., <argn>]

:

:

endm

where <label> is a valid assembler label and <arg> is any number of optional arguments supplied to the macro (that will fit on the source line.) The values assigned to these arguments at the time the macro is invoked will be substituted wherever the argument name occurs in the body of the macro.

The body of a macro may be comprised of MPASM assembler directives, PICmicro MCU assembly instructions, or MPASM assembler macro directives (LOCAL for example.) The assembler continues to process the body of the macro until an EXITM or ENDM directive is encountered.

Note: Forward references to macros are not permitted.


Microchip Technology Inc.
Microchip's Web Site
Voice: (480) 792-7200
Fax: (480) 899-9210
Microchip's E-mail Address
PreviousNext