Example speed macro rate if rate < 50 dw slow else dw fast endif endm Example make_table macro arg1, arg2 dw "arg1", 0 ; null terminate table name resv arg2 ; reserve storage endm See Also MACRO EXITM Example error_checking macro arg1 if arg1 >= 55 ; if arg is out of range error "error_checking-01 arg out of range" endif endm See Also MESSG Example test macro fileReg if filereg == 1 ; check for valid file exitm else error "bad file assignment" endm See Also MACRO ENDM MACRO - Declare Macro Definition Syntax label macro [, ..., ] 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. A macro can call another macro, or may call itself recursively. Please refer to the chapter "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 callsys_21 ; read file call endm See Also ENDM LOCAL IF ELSE ENDIF EXITM