mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-27 09:29:06 +08:00
doc/nasmdoc.src: document additions from preprocessor-rewrite merge
This commit is contained in:
parent
21d885b164
commit
02e49e0485
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user