From 4a532bc707280a0c8a1f9a0e276a4247fcddf9ea Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 3 Sep 2008 14:31:20 -0700 Subject: Document %unmacro --- doc/nasmdoc.src | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 23c03907..cea7a6ec 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -2144,9 +2144,9 @@ instruction has been used as a label in older code. For example: \c %idefine pause $%? ; Hide the PAUSE instruction -\S{undef} Undefining Macros: \i\c{%undef} +\S{undef} Undefining Single-Line Macros: \i\c{%undef} -Single-line macros can be removed with the \c{%undef} command. For +Single-line macros can be removed with the \c{%undef} directive. For example, the following sequence: \c %define foo bar @@ -2713,6 +2713,30 @@ Or like this: \c %macro bar 1-5+.nolist a,b,c,d,e,f,g,h +\S{unmacro} Undefining Multi-Line Macros: \i\c{%unmacro} + +Multi-line macros can be removed with the \c{%unmacro} directive. +Unlike the \c{%undef} directive, however, \c{%unmacro} takes an +argument specification, and will only remove \i{exact matches} with +that argument specification. + +For example: + +\c %macro foo 1-3 +\c ; Do something +\c %endmacro +\c %unmacro foo 1-3 + +removes the previously defined macro \c{foo}, but + +\c %unmacro bar 1-3 +\c ; Do something +\c %endmacro +\c %unmacro bar 1 + +does \e{not} remove the macro \c{bar}, since the argument +specification does not match exactly. + \H{condasm} \i{Conditional Assembly}\I\c{%if} Similarly to the C preprocessor, NASM allows sections of a source -- cgit v1.2.1