📄 exitm.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- Premature End of a Macro Expansion --><HTML><HEAD><TITLE>Premature End of a Macro Expansion</TITLE></HEAD><BODY BACKGROUND="spiral.gif" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#990099" ALINK="#FF0000"><TABLE WIDTH="98%"><TR><TD WIDTH=60 VALIGN=BOTTOM NOWRAP><IMG SRC="transp.gif" ALT="" WIDTH=60 HEIGHT=20></TD><TD><!-- Ab hier Seitentext: --><BIG><BR><P><STRONG><U>III.11.6 Premature End of a Macro Expansion</U></STRONG></P><P>Sometimes it is useful, if a macro expansion can be terminated, beforethe end of the macro body is reached. This can be forced with the EXITM(exit macro) instruction. However, this makes sense in conjunction withconditional assembly only.</P><P><BR><STRONG>Example:</STRONG><BLOCKQUOTE><PRE> FLEXIBLE MACRO QUANTITY DB 'Text' IF QUANTITY LE 255 EXITM ENDIF DW QUANTITY ENDM</PRE>The macro FLEXIBLE always has to insert the string 'Text'into the CODE space. After that, it should insert a 16-bitconstant only, if the numerical value of the parameterQUANTITY is greater than 255.<BR>Otherwise the macro expansion should be terminated withEXITM before. If the macro is called as follows,<PRE> FLEXIBLE 42</PRE>it will be expanded to<PRE> DB 'Text'</PRE>in list mode $GENONLY/$CONDONLY.<BR>However, if it is called like this,<PRE> FLEXIBLE 4711</PRE>it will be expanded to:<PRE> DB 'Text' DW 4711</PRE></BLOCKQUOTE></P><P>When a macro expansion is terminated with EXITM, all IFxx constructions thathave been opened within the macro body so far, are closed.<BR>Of course macro bodies may also contain control statements. If an includefile is inserted into a macro body with a $INCLUDE control, and this includefile, or a nested include file, contains an EXITM instruction, all includefile levels up to the next macro level are closed at this point, and theexpansion of that macro is terminated immediately.</P></BIG><!-- Seitentext Ende --><P><BR><BR><CENTER><TABLE WIDTH="70%"><TR><TH><A HREF="contents.htm"><IMG SRC="home.gif" ALT="[contents]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="macros.htm"><IMG SRC="up.gif" ALT="[up]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="operator.htm"><IMG SRC="back.gif" ALT="[back]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="nestcall.htm"><IMG SRC="next.gif" ALT="[next]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH></TR></TABLE></CENTER></P></TD></TR></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -