Macro Usage

MPASM Assembler

Macro Usage

Once the macro has been defined, it can be invoked at any point within the source module by using a macro call, as described below:

<macro_name> [<arg>, ..., <arg>]

where <macro_name> is the name of a previously defined macro and arguments are supplied as required.

The macro call itself will not occupy any locations in memory. However, the macro expansion will begin at the current memory location. Commas may be used to reserve an argument position. In this case, the argument will be an empty string. The argument list is terminated by white space or a semicolon.

The EXITM directive provides an alternate method for terminating a macro expansion. During a macro expansion, this directive causes expansion of the current macro to stop and all code between the EXITM and the ENDM directives for this macro to be ignored. If macros are nested, EXITM causes code generation to return to the previous level of macro expansion.


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