## ALP Programming Guide and Reference

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

### ENDM (End Current Macro Definition)

End each MACRO, REPEAT/REPT, FOR/IRP, and FORC/IRPC directive with the ENDM directive.

Syntax

    ENDM

Remarks

If the ENDM directive is not used with the MACRO, REPEAT/REPT, FOR/IRP, and FORC/IRPC directives, an error occurs. An unmatched ENDM also causes an error.

If the assembler produces an error message stating that it found the end-of -file on the source and cannot find an END statement when there was an END, the likely cause is a missing ENDM or ENDIF statement. Without ENDM, the assembler treats the rest of the source as part of the MACRO definition.

Note: The name field is not allowed. Do not confuse the ENDM directive with other ending directives that do require the name of the block being ended, such as ENDP or ENDS.

Example

    addup     MACRO     ad1 , ad2 , ad3
             MOV       AX , ad1         ; ; first   parameter   in   AX
             ADD       AX , ad2         ; ; add   next   two   parameters
             ADD       AX , ad3         ; ; leave   sum   in   AX
             ENDM