## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### EXITM (End Current Macro Expansion)

Use the EXITM directive when a block contains a directive that tests for some condition and you want to end the current macro expansion when the test proves that the remainder of the expansion is not required. When an EXITM directive is run, the expansion is stopped immediately, and any remaining expansion or repetition is not produced.

Syntax

    EXITM

Remarks

Only the block containing the EXITM directive is ended; outer levels of a nested macro expansion continue unaffected.

EXITM is executed at macro expansion time and is not a substitute for the ENDM directive, which marks the end of the macro body and is recognized at macro definition time.

Example

    DSEG   SEGMENT
          .
          .
          .
    SYM   =   0
          REPEAT   16
    ; ; Check   for   paragraph   boundary
          IF   ( $ - DSEG )   MOD   16   EQ   0
          EXITM   ; ; quit   if   padded   to   boundary
          ENDIF
    SYM   =   SYM   +   1
          DB   SYM   ; ; produce   numbered   padding
          ENDM