NASM Forum > Using NASM

unclosed %if in macros...?

(1/1)

nobody:
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:
> Is it possible...?

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

nobody:
what a pitty...

nasm64developer:
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?

Navigation

[0] Message Index

Go to full version