## ALP Programming Guide and Reference

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

### .ERRE/.ERRNZ (Error if Expression False/True)

The .ERRE and .ERRNZ directives test the value of an Expression.

Syntax

    . ERRE   Expression
        or
    . ERRNZ   Expression

Remarks

If the Expression evaluates to be false (zero), the .ERRE directive produces an error. If the Expression evaluates to be true (not zero), the .ERRNZ directive produces an error. The Expression must evaluate to an absolute value and cannot contain forward references.

Example

In this example, .ERRE checks the boundaries of a parameter that the program passes to the macro BUFFER. If count is less than or equal to 128, the expression that the directive tests is true (not zero) and the directive produces no error. If COUNT is greater than 128, the expression is false (zero) and the directive produces an error.

    BUFFER   MACRO    COUNT , BNAME
            . ERRE     COUNT   LE   128
            BNAME   DB   COUNT   DUP   ( 0 )   ; ;   Reserve   memory ,   but   no   more   than   128   bytes
            ENDM

    BUFFER   128 , BUF1    ;   Data   reserved   -   no   error
    BUFFER   129 , BUF2    ;   Error   produced