The information in this article applies to:
SUMMARYAttempting to use the & substitute operator to combine parameters requires that each parameter being substituted have one ampersand on the left and right. If an ampersand is adjacent to white space, it can be omitted as long as one ampersand is next to each parameter to be substituted. MORE INFORMATIONIf multiple parameters are being combined with the & operator, each parameter must have it's own & symbol associated with it. Also each & symbol can only be associated with one parameter. The sample code provided below helps to illustrate the use of the & substitute operator to combine multiple parameters. Sample Code
Attempting to assemble the sample code given above will cause MASM 6.0
to generate the following error messages:
MASM generates the following code for the macros in the sample code:
The A2048 error is generated because the substitution of the 'y'
parameter being performed in the call to the level3 macro from inside
the level2 macro is not occurring. The A2048 error is generated when
the level3 macro attempts to store the invalid value it was passed
from the level2 macro in the BP register.
The substitution of the 'y' parameter is not occurring because the syntax being used with the & operator is incorrect. The level2 macro is defined as follows:
To allow the correct substitution to take place, add another & to the
level3 macro call, like this:
After making the change shown above, MASM 6.0 then generates the
following code for the macros:
The value being placed into the BP register is now valid and the code
functions as expected.
Additional query words: kbinf 5.10 5.10a 6.00 6.00a 6.00b
Keywords : |
Last Reviewed: January 4, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |