NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Jasper Neumann on November 12, 2009, 01:47:03 PM

Title: Delegating %undef
Post by: Jasper Neumann 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
Title: Re: Delegating %undef
Post by: Cyrill Gorcunov 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 (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 :)