The .ERR, .ERR1, and .ERR2 directives cause errors at the points at which they occur in the source file.
Syntax
.ERR or .ERR1 or .ERR2Remarks
The .ERR directive causes an error regardless of the pass. .ERR1 causes an error on the first pass only. .ERR2 causes an error on the second pass only. If you use the -Lp:1 option to request a first pass listing, the .ERR1 error message appears on the screen and in the listing file. Like other error conditions occurring during pass one, the error generated by .ERR1 does not cause the assembly to fail.
This example ensures that you define either the DOS or the OS2 symbol. If you define neither, the assembler assembles the nested ELSE condition and produces an error message. The .ERR directive causes an error on each pass.
IFDEF DOS . . . ELSE IFDEF OS2 . . . ELSE .ERR ENDIF ENDIF