NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Roman on July 31, 2012, 10:02:52 AM

Title: Special symbols in macro names
Post by: Roman on July 31, 2012, 10:02:52 AM
Hi, All!
Sorry for my English, i do not know it...
I have a some trouble: I support the old code, which would be written in nasm 0.98.35. And now i'm use nasm 2.10.
I don't know enough English to describe the problem, therefore show an example :D
there is a macro
Code: [Select]
%macro defineMacro 2
; defines new one line macro
; %1 - macro name
; %2 - macro value
%define %1 %2
%endm
and this macro calling as
Code: [Select]
defineMacro %$SOMENAME1 %+ %$SOMENAME2, 1expected
Code: [Select]
%define %$SOMENAME1%$SOMENAME2 1 ; it was in nasm0.98but  nasm 2.10 generates
Code: [Select]
%define %$SOMENAME1  %$SOMENAME2 1 ; %$SOMENAME1 - macros name and '%$SOMENAME2 1' - value
is there any way to fix this?
Title: Re: Special symbols in macro names
Post by: Cyrill Gorcunov on July 31, 2012, 05:19:30 PM
Would it help if you define it as below
Code: [Select]
defineMacro %$SOMENAME1%+%$SOMENAME2, 1

i.e. without spaces around %+ term?
Title: Re: Special symbols in macro names
Post by: Cyrill Gorcunov on July 31, 2012, 05:29:55 PM
By the way, if there some unexpected change in behavior -- don't hesitate to file a bug on http://bugzilla.nasm.us/ This allows us to track the problems and fix them.
Title: Re: Special symbols in macro names
Post by: Cyrill Gorcunov on August 01, 2012, 07:52:25 PM
For me it looks like a bug, so I filed it here http://bugzilla.nasm.us/show_bug.cgi?id=3392219
Title: Re: Special symbols in macro names
Post by: Cyrill Gorcunov on August 07, 2012, 07:30:48 AM
The patch has been pushed upstream, please test it out.
Title: Re: Special symbols in macro names
Post by: Cyrill Gorcunov on August 07, 2012, 07:33:28 AM
I mean wait until our compile farm build a snapshot (http://www.nasm.us/pub/nasm/snapshots/) and pick it up from there.
Optionally you can fetch git repo itself and build nasm by own.