NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on May 26, 2007, 04:25:52 PM

Title: Macros: Identify registers
Post by: nobody on May 26, 2007, 04:25:52 PM
Hi,

I'm trying to write a macro that produces different output depending on the register used as operand.
It looks something like this:

%macro isereg 1

%if (%1 = eax)
int 10h
%else
int 11h
%endif

%endmacro

but when I write eg.
isereg eax
in my source file I get the error message "error: (isereg:2) symbol `eax' not defined before use".

Is there a way to make this work at all?

greetings,
BTM
Title: Re: Macros: Identify registers
Post by: Frank Kotler on May 26, 2007, 04:58:19 PM
I think "%ifidni %1, eax" will do what you want.

Best,
Frank
Title: Re: Macros: Identify registers
Post by: nobody on May 26, 2007, 06:05:54 PM
See SF #1582125.
Title: Re: Macros: Identify registers
Post by: nobody on May 27, 2007, 12:15:47 AM
Frank:
Works great. Thanks a bunch. :]

nobody:
???