Author Topic: Special symbols in macro names  (Read 6260 times)

Offline Roman

  • Jr. Member
  • *
  • Posts: 10
Special symbols in macro names
« 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?

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Special symbols in macro names
« Reply #1 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?

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Special symbols in macro names
« Reply #2 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.

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Special symbols in macro names
« Reply #3 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

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Special symbols in macro names
« Reply #4 on: August 07, 2012, 07:30:48 AM »
The patch has been pushed upstream, please test it out.

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Special symbols in macro names
« Reply #5 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.
« Last Edit: August 07, 2012, 07:35:37 AM by Cyrill Gorcunov »