Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Im trying to conditionally define some constant with equ directive by putting it in the if block, but it seems that even when this condition is false, the constant gets defined. Why?

0
Posted

Im trying to conditionally define some constant with equ directive by putting it in the if block, but it seems that even when this condition is false, the constant gets defined. Why?

0

That’s because all symbolic constants and macroinstruction (that means every symbol you define with equ, macro, or struc directive) are processed at the preprocessor stage, while directives like if or repeat are processed at assembly stage, when all macroinstructions and symbolic constants have already been replaced with corresponding values (generally structures which you have to end with the end directive followed by the name of structure are processed at assembly stage). On the other hand, the numerical constants (which you define with = symbol) are of the same kind as labels, and therefore are processed at assembly stage, so you can define and use them conditionally.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123