Author Topic: unclosed %if in macros...?  (Read 8366 times)

nobody

  • Guest
unclosed %if in macros...?
« on: March 03, 2005, 10:58:33 PM »
Hallo,

I want to write 2 macros: in the first one a %if-block should start and with the other one this block should be close, i.e.

%macro inn 1
  %ifdef %1
%endmacro

%macro outt 1
  %endif
%endmacro

inn helpppp
    mov ax,1
  outt

This should be result "mov ax,1" the case that helpppp is defined. The %ifdef has to be hided from the macro so that it won't be expanded when the macro is expanded.

Is it possible to do anything like that with the nasm-preprocessor? If so, how???

Thanks a lot!

nasm64developer

  • Guest
Re: unclosed %if in macros...?
« Reply #1 on: March 04, 2005, 06:17:17 PM »
> Is it possible...?

Nope. This is not how NASM's preprocessor works.

nobody

  • Guest
Re: unclosed %if in macros...?
« Reply #2 on: March 04, 2005, 07:21:15 PM »
what a pitty...

nasm64developer

  • Guest
Re: unclosed %if in macros...?
« Reply #3 on: March 05, 2005, 12:10:20 AM »
In essence you would like an invocation of a
multi-line macro to emit all the lines of the
expansion, but not process them, followed by
another preprocessor run over the entire input
stream. Sorry, but that's just not how NASM's
preprocessor was designed to work.

As for the particular example you gave -- how
is that anything but syntactic eye candy?