The .ERRDIF and .ERRDIFI directives generate an assembler error if the two Text-Arguments are different.
Syntax
.ERRDIF Text-Argument-1, Text-Argument-2 or .ERRDIFI Text-Argument-1, Text-Argument-2Remarks
The .ERRDIF directive performs a case-sensitive comparision, and the .ERRDIFI directive performs a case-insensitive comparision.
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