News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Logical operators in conditional assembly

Started by Yuri, January 01, 2013, 03:51:16 PM

Previous topic - Next topic

Yuri

It seems GoAsm currently doesn't support them. I mean things like

#if defined(A) || defined(B)

or

#if A && B


Is there any chance they could be implemented?

I now use a workaround for the first example:

#if defined(A)
    x = 1
#elif defined(B)
    x = 1
#else
    x = 0
#endif

#if x == 1
    some code
#endif
#undef x


But it's way too long and the readability of code suffers from this (I need about 80 such wrappings throughout the code).

wjr

For "any chance really soon" I would have to say probably not, for me at least - enough on the Go with remaining 64-bit issues that need to be resolved.

For "any chance", I could go with maybe, as I took a quick look and it seems like the current simple "expression1 relational-operator expression2" format could be extended to include logical-operators, as in the examples that you have shown. Actually, this looks much easier than what I am working on above, so in some spare time may dig a bit further into this one...

However, if you were expecting to create more complex conditional expressions including multiple logical-operators with multiple relational-operator expressions (as sometimes seen in the header files), that would be a bit too much, for me at least.

Yuri

Thanks for the reply, Wayne. Personally I would be happy with just two operands, like in my examples above. I think more complex conditions are a rare case.