summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Kanios <keith@kanios.net>2010-12-18 13:19:01 -0600
committerKeith Kanios <keith@kanios.net>2010-12-18 13:19:01 -0600
commit02e49e048546ae5a4156585ed7de8f0ba89d9395 (patch)
tree87352a73360ea647ef6506a97db438dfebb6f6d4
parent21d885b164c76e20b4fcd19384a82c90fbfd51e2 (diff)
downloadnasm-02e49e048546ae5a4156585ed7de8f0ba89d9395.tar.gz
doc/nasmdoc.src: document additions from preprocessor-rewrite merge
-rw-r--r--doc/nasmdoc.src77
1 files changed, 49 insertions, 28 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index 4b2c2acd..515a8bb2 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -2415,20 +2415,21 @@ things like
\c silly {13,10}, crlf ; crlf: db 13,10
-\#\S{mlrmacro} \i{Recursive Multi-Line Macros}: \I\c{%irmacro}\i\c{%rmacro}
-\#
-\#A multi-line macro cannot be referenced within itself, in order to
-\#prevent accidental infinite recursion.
-\#
-\#Recursive multi-line macros allow for self-referencing, with the
-\#caveat that the user is aware of the existence, use and purpose of
-\#recursive multi-line macros. There is also a generous, but sane, upper
-\#limit to the number of recursions, in order to prevent run-away memory
-\#consumption in case of accidental infinite recursion.
-\#
-\#As with non-recursive multi-line macros, recursive multi-line macros are
-\#\i{case-sensitive}, unless you define them using the alternative
-\#directive \c{%irmacro}.
+\S{mlrmacro} \i{Recursive Multi-Line Macros}: \I\c{%irmacro}\i\c{%rmacro}
+
+A multi-line macro cannot be referenced within itself, in order to
+prevent accidental infinite recursion and allow instruction overloading.
+
+Recursive multi-line macros allow for self-referencing, with the
+caveat that the user is aware of the existence, use and purpose of
+recursive multi-line macros. There is also a generous, but sane, upper
+limit to the number of recursions, in order to prevent run-away memory
+consumption in case of accidental infinite recursion.
+
+As with non-recursive multi-line macros, recursive multi-line macros are
+\i{case-sensitive}, unless you define them using the alternative
+directive \c{%irmacro}.
+
\S{mlmacover} Overloading Multi-Line Macros\I{overloading, multi-line macros}
@@ -2887,20 +2888,21 @@ does \e{not} remove the macro \c{bar}, since the argument
specification does not match exactly.
-\#\S{exitmacro} Exiting Multi-Line Macros: \i\c{%exitmacro}
-\#
-\#Multi-line macro expansions can be arbitrarily terminated with
-\#the \c{%exitmacro} directive.
-\#
-\#For example:
-\#
-\#\c %macro foo 1-3
-\#\c ; Do something
-\#\c %if<condition>
-\#\c %exitmacro
-\#\c %endif
-\#\c ; Do something
-\#\c %endmacro
+\S{exitmacro} Exiting Multi-Line Macros: \i\c{%exitmacro}
+
+Multi-line macro expansions can be arbitrarily terminated with
+the \c{%exitmacro} directive.
+
+For example:
+
+\c %macro foo 1-3
+\c ; Do something
+\c %if<condition>
+\c %exitmacro
+\c %endif
+\c ; Do something
+\c %endmacro
+
\H{condasm} \i{Conditional Assembly}\I\c{%if}
@@ -3221,6 +3223,17 @@ Note a maximum repeat count is limited by 62 bit number, though it
is hardly possible that you ever need anything bigger.
+\H{while} \i{Conditional Loops}: \i\c{%while}
+
+The directives \c{%while} and \i\c{%endwhile} combine preprocessor
+loops with conditional assembly, allowing the enclosed chunk of
+code to be replicated as long as certain conditions are met:
+
+\c %while<condition>
+\c ; some code which only repeats while <condition> is met
+\c %endwhile
+
+
\H{files} Source Files and Dependencies
These commands allow you to split your sources into multiple files.
@@ -3793,6 +3806,14 @@ variable, for example:
\c %defstr C_colon %!'C:'
+\S{final} \i\c{%final} Directive
+
+The \c{%final} directive is used to delay preprocessing of a line
+until all other "normal" preprocessing is complete. Multiple
+\c{%final} directives are processed in the opposite order of their
+declaration, last one first and first one last.
+
+
\H{stdmac} \i{Standard Macros}
NASM defines a set of standard macros, which are already defined