Example:
FLEXIBLE MACRO QUANTITY DB 'Text' IF QUANTITY LE 255 EXITM ENDIF DW QUANTITY ENDM
The 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.
Otherwise the macro expansion should be terminated with EXITM before. If the macro is called as follows,FLEXIBLE 42it will be expanded toDB 'Text'
in list mode $GENONLY/$CONDONLY.
However, if it is called like this,FLEXIBLE 4711it will be expanded to:DB 'Text' DW 4711
When a macro expansion is terminated with EXITM, all IFxx constructions that
have been opened within the macro body so far, are closed.
Of course macro bodies may also contain control statements. If an include
file is inserted into a macro body with a $INCLUDE control, and this include
file, or a nested include file, contains an EXITM instruction, all include
file levels up to the next macro level are closed at this point, and the
expansion of that macro is terminated immediately.