Assembly Language Help (alang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
OLDMACROS│NOOLDMACROS Option
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Syntax: OPTION OLDMACROS
OPTION NOOLDMACROS
See also: MACRO, Ampersand(&), MASM 5.1 Compatibility
Description:
The OLDMACROS option enables MASM 5.1-compatible macros and
parameter substitution. NOOLDMACROS is the default. The OLDMACROS
option is enabled with the M510 option.
Without OPTION OLDMACROS or OPTION M510, MASM 6.1 changes the behavior of
macros in several ways. If you want the MASM 5.1 macro behavior, add
OPTION OLDMACROS or OPTION M510 to your MASM 5.1 code.
MASM 5.1 allows white spaces or commas to separate arguments to macros.
MASM 6.1 with OPTION NOOLDMACROS (the default) requires commas between
arguments. For example, in the macro call
MyMacro var1 var2 var3, var4
OPTION OLDMACROS causes the assembler to treat all four items as separate
arguments. With OPTION NOOLDMACROS, the assembler treats
var1 var2 var3
as one argument since the items are not separated with commas. To
convert your macro code, replace spaces between macro arguments with
a single comma.
The default OPTION NOOLDMACROS causes the assembler to interpret
ampersands (&) within a macro differently than does MASM 5.1. MASM 5.1
requires one ampersand for each level of macro nesting. OPTION OLDMACROS
emulates this behavior.
Without OPTION OLDMACROS, MASM 6.1 removes ampersands only once no
matter how deeply nested the macro. To update your MASM 5.1 macros,
follow this simple rule: replace every sequence of ampersands with a
single ampersand. The only exception is when macro parameters immediately
precede and follow the ampersand, and both require substitution. In this
case, use two ampersands.
-♦-