The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: Yuri on January 01, 2013, 03:51:16 PM

Title: Logical operators in conditional assembly
Post by: Yuri on January 01, 2013, 03:51:16 PM
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).
Title: Re: Logical operators in conditional assembly
Post by: wjr on January 06, 2013, 01:47:44 PM
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.
Title: Re: Logical operators in conditional assembly
Post by: Yuri on January 06, 2013, 02:37:30 PM
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.