## ALP Programming Guide and Reference

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

### .ERRDIF/.ERRDIFI (Error if Arguments are Different)

The .ERRDIF and .ERRDIFI directives generate an assembler error if the two Text-Argument s are different.

Syntax

    . ERRDIF   Text - Argument - 1 ,   Text - Argument - 2
        or
    . ERRDIFI   Text - Argument - 1 ,   Text - Argument - 2

Remarks

The .ERRDIF directive performs a case-sensitive comparision, and the . ERRDIFI directive performs a case-insensitive comparision.

Example

In this example, a check is made to verify that the currently opened segment is _TEXT. This helps to insure that the macro is used only from within the default near code segment, and not from a program with a memory model that uses far code pointers (MEDIUM, LARGE, or HUGE).

    RETURN   MACRO
         ; ;   Use   the   expansion   operator   ( % )   to   resolve   @ CurSeg   equate
         %   . errdif   < _ TEXT > , < @ CurSeg >    ; ;   Must   be   in   near   . CODE   segment
         RETN                             ; ;   Force   a   near   return
    ENDM