flat assembler
Message board for the users of flat assembler.

flat assembler > Macroinstructions > #ifndef problem

Author
Thread Post new topic Reply to topic
afw2004



Joined: 16 Jun 2005
Posts: 49
Location: Kharkov, Ukraine
How can I check if symbol is defined in FASM? (like #ifndef in C++)
Post 30 Jun 2005, 15:00
View user's profile Send private message ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7312
Location: Kraków, Poland
For the label or numerical constant (which are defined at assembly stage) it would be:
Code:
if defined symbol
 ; ...
end if    

This operator checks whether the symbol is defined anywhere in source (with prediction), not only whether it was defined earlier. Read part 4 of this article for more details about this specific problem.

For the symbolic constant (defined with EQU, processed at preprocessing stage), it can be something like this example from the manual:
Code:
match =TRUE, DEBUG { include 'debug.inc' }    

to check for specific value; or something like this:
Code:
match =DEBUG, DEBUG { }    

to check whether DEBUG constant was not defined at all.
Post 30 Jun 2005, 15:10
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.