SPNU118Z September 1995 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
The macro language supports three directives that enable you to define your own assembly-time error and warning messages. These directives are especially useful when you want to create messages specific to your needs. The last line of the listing file shows the error and warning counts. These counts alert you to problems in your code and are especially useful during debugging.
.emsg | sends error messages to the listing file. The .emsg directive generates errors in the same manner as the assembler, incrementing the error count and preventing the assembler from producing an object file. |
.mmsg | sends assembly-time messages to the listing file. The .mmsg directive functions in the same manner as the .emsg directive but does not set the error count or prevent the creation of an object file. |
.wmsg | sends warning messages to the listing file. The .wmsg directive functions in the same manner as the .emsg directive, but it increments the warning count and does not prevent the generation of an object file. |
Macro comments are comments that appear in the definition of the macro but do not show up in the expansion of the macro. An exclamation point in column 1 identifies a macro comment. If you want your comments to appear in the macro expansion, precede your comment with an asterisk or semicolon.
Producing Messages in a Macro shows user messages in macros and macro comments that do not appear in the macro expansion. For more information about the .emsg, .mmsg, and .wmsg assembler directives, see Define Messages.
1 MUL_I .macro x,y
2 .if ($$symlen(x) ==0)
3 .emsg "ERROR -- Missing Parameter"
4 .mexit
5 .elseif ($$symlen(y) == 0)
6 .emsg "ERROR -- Missing Parameter"
7 .mexit
8 .else
9 MOV R1, x
10 MOV R2, y
11 MUL R0, R1, R2
12 .endif
13 .endm
14
15 00000000 MUL_I #50, #51
1 .if ($$symlen(x) ==0)
1 .emsg "ERROR -- Missing Parameter"
1 .mexit
1 .elseif ($$symlen(y) == 0)
1 .emsg "ERROR -- Missing Parameter"
1 .mexit
1 .else
1 00000000 E3A01032 MOV R1, #50
1 00000004 E3A02033 MOV R2, #51
1 00000008 E0000291 MUL R0, R1, R2
1 .endif
16
17 0000000c MUL_I
1 .if ($$symlen(x) ==0)
1 .emsg "ERROR -- Missing Parameter"
***** USER ERROR ***** - : ERROR -- Missing Parameter
1 .mexit
1 Error, No Warnings