NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: nobody on February 01, 2009, 07:27:49 AM
-
Hi,
Is there a way in nasm to use or/and in ifidn macro?
E.g.
%ifidn %1,rax || %1,rbx
....
%endif
Thanks,
Csaba
-
I don't think so (I'm not a very sophisticated macro user). I think you'll have to do:
%ifidn %1, rax
; some code
%endif
%ifidn %1, ebx
; same code
%endif
Nest 'em for "and", of course. You might want %ifidni to catch uppercase, too.
Best,
Frank
-
Thanks,
Actually I did what you have written but I was curious if it is possible to do it as in other languages (usually).
Thanks,
Csaba
-
why not do like this
%macro some_macro
; some code
%endif
%ifidn this, that
some_macro
%elsifidn other_this, other_that
some macro
%endif