Author Topic: Delegating %undef  (Read 18647 times)

Jasper Neumann

  • Guest
Delegating %undef
« on: November 12, 2009, 01:47:03 PM »
How can I delegate %undef?

In the example below the assembler (called with "nasm.exe -t -f rdf q.asm") bemoans my code, displays

"q.asm:19: error: interminable macro recursion"

and hangs.

===q.asm===
Code: [Select]
bits 32
CPU P4

%macro my_def 2
%xdefine %1 esp+%2
%endmacro

%macro my_undef 1
%undef %1
%endmacro

global check_it
check_it:
my_def x,4
mov eax,[x]
my_undef x

my_def x,8
add eax,[x]
my_undef x
ret
===

What is the preferred way to do this?

Thanks,

Jasper

Offline Cyrill Gorcunov

  • NASM Developer
  • Full Member
  • *****
  • Posts: 179
  • Country: 00
Re: Delegating %undef
« Reply #1 on: November 29, 2009, 10:09:57 PM »
> ...
> and hangs.
> ...

It'll not hang anymore. Fixed.
Meanwhile such a style not supported yet.

See comments on commit
http://repo.or.cz/w/nasm.git/commit/bd38c8f231d938ffdf0916809bf2a6b65e62ea61

Thanks for report. If you find something strange like "hang", "crash" or whatever -- do not hesitate to file a bug report on tracker :)