III.11.6 Premature End of a Macro Expansion
Sometimes it is useful, if a macro expansion can be terminated, before the end of the macro body is reached. This can be forced with the EXITM (exit macro) instruction. However, this makes sense in conjunction with conditional assembly only.
FLEXIBLE MACRO QUANTITY DB 'Text' IF QUANTITY LE 255 EXITM ENDIF DW QUANTITY ENDMThe macro FLEXIBLE always has to insert the string 'Text' into the CODE space. After that, it should insert a 16-bit constant only, if the numerical value of the parameter QUANTITY is greater than 255.
When a macro expansion is terminated with EXITM, all IFxx constructions that
have been opened within the macro body so far, are closed.