4.60 #undefine Directive

The MPASM #undefine directive undefines textual replacement for a macro.

Suggested Replacement

As assembly source files can be preprocessed, the PIC Assembler's #undef preprocessor directive can be used as a direct replacement for this directive, as shown in the example below.

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.

;ensure the macro has been cleared first
#ifdef SUMSP
#undef SUMSP
#endif
;now create a new macro
#define SUMSP(a, b) (a+2*b)
PSECT text,class=CODE
process:
  movlw SUMSP(5, 3)
  movwf volume