4.15 #define Directive

The MPASM #DEFINE directive defines textual replacement for a macro.

Suggested Replacement

As assembly source files can be preprocessed, the #define preprocessor directive (case sensitive) can be used as a direct replacement for this assembler directive, as shown in the example below.

All the usual preprocessor features associated with macro replacement are available. Ensure the assembly source file uses a .S extension so that it will be preprocessed by the assembler, or alternatively, use the -xassembler-with-cpp option to request that source files be preprocessed regardless of their extension.

#define SUMSP(a, b) (a+2*b)
PSECT code
process:
  movlw SUMSP(5, 3)
  movwf volume
  ...