MACRO - Declare Macro Definition

MPASM Assembler

MACRO - Declare Macro Definition

Syntax

<label> macro [<arg>, ..., <arg>]

Description

A macro is a sequence of instructions that can be inserted in the assembly source code by using a single macro call. The macro must first be defined, then it can be referred to in subsequent source code.

Arguments are read in from the source line, stored in a linked list and then counted. The maximum number of arguments would be the number of arguments that would fit on the source line, after the label and macro terms. The maximum source line length is 200.

A macro can call another macro, or may call itself recursively. The maximum number of nested macro calls is 16.

Please refer to Macro Language for more information.

Example

Read macro device, buffer, count

movlw device

movwf ram_20

movlw buffer ; buffer address

movwf ram_21

movlw count ; byte count

call sys_21 ; read file call

endm

See Also

ENDM EXITM LOCAL


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