-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Label on the same line as a macro is not defined #1
Comments
To be honest, after some investigation, I am still unsure whether this is an error in A09 or not, but I lean very slightly towards "it's correct". The Flex ASMB documentation mentions a way to achieve what you want: There is actually a tenth parameter which may be passed into a macro represented by the dummy parameter "&0". It is presented on the calling line as so: This parameter is somewhat different from the others in that it must be a string of characters that conform to the rules for any other assembly language label since it is found in the label field. It is in fact a standard label which goes into the symbol table and can be used in other statement’s operands like any other label. In your context, that means: if you rewrite your macro a little bit so that it looks like:
, the invocation
has the desired effect to generate
(you can examine the macro expansion by putting an |
Still not sure, but the documentation might also be interpreted as "set the label and pass it to the macro as &0. Hmmm... tricky, this one. A09's current approach is more flexible IMO (you can put the label anywhere you want in the macro expansion), but might conflict with existing macro libraries, if they assume that the label is both set and passed as &0. Unfortunately, I don't have any reference library at hand, so I can't tell. I'll add an option for that, since I can't really determine which way is better. In any case, as soon as my time permits, I'll fire up a FLEX09 emulator and look what the original ASMB and RELASMB programs do in this case. |
OK; I uploaded a new version, which has the DLM | NDL* options added.
works.
to work. |
Wow, I hadn't even had a chance to test the workaround :-) I suspected that it would be something like that. Thanks ! |
I'm not sure if I'm just not understanding some subtlety of macros or if this is actually a bug. I've compiled A09 on Linux and it works. If I define a macro which in this case inserts a string with a trailing NUL then when I put it on the same line as a label, on pass 2 I get "Error 3: undefined label".
If I put a newline after my label "blip" then it works as expected.
The text was updated successfully, but these errors were encountered: