I wrote this macro:

__defdef macro const,value ifndef const const = value endif endm 

A macro defines a constant if it has not been defined previously. However, there is a problem: the compiler issues a warning that "Module is pass depending". How to get rid of it?

And also, is it possible to somehow determine: is this or that procedure used in the code or not? To write include with several procedures, and in the code to include only those that are actually used.

And how to check - which assembler is used: TASM, MASM or FASM? Maybe some characters are defined for this?

    1 answer 1

    The compiler produces a warning that "Module is pass depending"

    And then comes something like "compatibility pass was done"? This is a warning that in this case you need to do two passes for proper assembly. But the default is one, so he warns that he is forced to make a second round. Treated with a command line key /M2

    is it possible to somehow determine: is this or that procedure used in the code or not?

    No In general, this is not the best practice - to include procedures by directives INCLUDE . Separate compilation and selective linking is much more efficient.

    And how to check - which assembler is used: TASM, MASM or FASM?

    NASM has __NASM_VER__ , __NASM_VERSION_ID__ , etc. In MASM, EMNIP, macro @Version . Maybe in other things, there is a need to dig into the documentation. But it's a bad job, writing under several assemblers at once ...

    • Yes, the "compatibility pass was done" goes further. But / m2 does not help (the / m key is already there, replacing it with / m2 doesn’t change anything, but if you remove / m or / m2, more warning signs appear) - Jin X
    • @JinX, give a minimal but full-fledged example that you can put together and look at the output. - PinkTux
    • It’s impossible to make the minimum, so I’ll give you what is ... cloud.mail.ru/public/4fy5/sNjiiZKJh - Jin X