.ER     forced ERror

Syntax:

        .ER  [F | W [,] ] [errormessage]

See also:

.DO   .EL   .FI   .CO   .EB   .EC   .EN   .ST  

Function:

The .ER directive can force the SB-Assembler to report an error message. Such an error message can either be a normal error or a fatal error.

Boundary Sync:

In Version 3 of the SB-Assembler this directive will perform a boundary sync.

Example:

You can force an error message to be reported with the use of the .ER directive. This may be useful if you want to be warned if the program you're writing exceeds a certain memory range for instance, or if a memory page boundary is crossed.
The .ER directive is intended to be used in co-operation with the conditional assembly directives .DO .EL and .FI. Without conditional assembly this directive has very little use because the SB-Assembler would never reach pass 2 to produce the program if the .ER directive is used unconditionally.

The parameter following the .ER directive is the text of the error message that is to be reported. It is not possible to place comments on the same source line. All text is considered to be the error message, including spaces. Even the case of the characters of the message is retained. The parameter doesn't have to be enclosed in delimiters, like it would have been for other literal strings.

If no parameter is given the standard text User error is reported.

If the parameter is a single character F or an F followed by a comma a fatal error will be reported. A fatal error will terminate the assembly process immediately, while a normal error would continue the current pass of the assembly process.
If you want to include a custom error text with this fatal error the character F must be followed by a comma, which should be followed by the custom error message.

In version 3 of the SB-Assembler you may also generate warnings, in stead of the errors. A user generated warning is reported if the first character of the error text is a single W or an W follwed by a comma. In case no error message is given, the default User warning is reported.

Examples:

; Generate a standard non-fatal error
         .ER

; Generate a standard fatal error
         .ER   F

; Generate a custom non-fatal error
         .ER   *** This is the error message

; Generate a custom fatal error
         .ER   F,*** This is the error message

; Generate a standard warning (version 3 only)
         .ER   W

; Generate a custom warning (version 3 only)
         .ER   W,*** This is the warning message