This is an official announcement regarding the rewrite/revamp of the NASM preprocessor, now available as part of the official/main NASM source code starting with NASM 2.10rc2.

This rewrite addresses issues with implementing recursive macros (%rmacro/%irmacro) as previously attempted, %exitmacro and also makes room for new directives.

New NASM Directives:

  • %rmacro: Recursive Macro, can be called arbitrarily deep (really high limit [2^20] set to catch infinite loops.)

  • %irmacro: Same as above, except case-insensitive like %imacro.

  • %exitmacro: Terminates the current macro invocation, much like %exitrep; can be nested in other preprocessor directives (e.g. %if/%endif) within the macro, with exception of another macro, of course.

  • %while/%endwhile/%exitwhile: A fusion between %rep and %if.

  • %comment/%endcomment: Comment block for long/multi-line comments. A little syntactic sugar, if you will.

  • %final: Causes rest of line after %final to be preprocessed after all other "normal" preprocessing is complete. Multiple %final directives work like the x86 stack, LIFO/FILO.

This rewrite also addresses efficiency issues with heavy/nested macro invocations.

Please help us test this rewrite further by downloading/compiling the NASM 2.10rc2 and testing it against your NASM code/snippets.

NASM 2.10rc2 is available for download (source and binaries) at

Please note that the official documentation will be updated over the next few weeks as we approach an official/stable NASM 2.10 release.

If there are any questions/comments/concerns, please reply to this thread.

Thanks. -SpooK
Posted on 2010-11-08 11:23:39 by SpooK
Congratulations on reaching this milestone, I'll make time to play around with this stuff :)
Posted on 2010-11-08 18:43:20 by Homer