SPRUI03E June 2015 – January 2023
Define Messages
.emsg string
.mmsg string
.wmsg string
These directives allow you to define your own error and warning messages. When you use these directives, the assembler tracks the number of errors and warnings it encounters and prints these numbers on the last line of the listing file.
The .emsg directive sends an error message to the standard output device in the same manner as the assembler. It increments the error count and prevents the assembler from producing an object file.
The .mmsg directive sends an assembly-time message to the standard output device in the same manner as the .emsg and .wmsg directives. It does not, however, set the error or warning counts, and it does not prevent the assembler from producing an object file.
The .wmsg directive sends a warning message to the standard output device in the same manner as the .emsg directive. It increments the warning count rather than the error count, however. It does not prevent the assembler from producing an object file.
This example sends the message ERROR -- MISSING PARAMETER to the standard output device.
Source file:
.global PARAM
MSG_EX .macro parm1
.if $symlen(parm1) = 0
.emsg "ERROR -- MISSING PARAMETER"
.else
MVK parm1, A1
.endif
.endm
MSG_EX PARAM
MSG_EX
Listing file:
1 .global PARAM
2 MSG_EX .macro parm1
3 .if $symlen(parm1) = 0
4 .emsg "ERROR -- MISSING PARAMETER"
5 .else
6 MVK parm1, A1
7 .endif
8 .endm
9
10 00000000 MSG_EX PARAM
1 .if $symlen(parm1) = 0
1 .emsg "ERROR -- MISSING PARAMETER"
1 .else
1 00000000 00800028! MVK PARAM, A1
1 .endif
11
12 00000004 MSG_EX
1 .if $symlen(parm1) = 0
1 .emsg "ERROR -- MISSING PARAMETER"
***** USER ERROR ***** - : ERROR -- MISSING PARAMETER
1 .else
1 MVK parm1, A1
1 .endif
1 Error, No Warnings
In addition, the following messages are sent to standard output by the assembler:
"t.asm", ERROR! at line 10: [ ***** USER ERROR ***** - ] ERROR -- MISSING PARAMETER
.emsg "ERROR -- MISSING PARAMETER"
1 Assembly Error, No Assembly Warnings
Errors in Source - Assembler Aborted