flat assembler
Message board for the users of flat assembler.

Index > Main > Preferred way of handling different builds

Author
Thread Post new topic Reply to topic
Rick



Joined: 11 Jan 2022
Posts: 5
Rick
I'm currently learning assembly/fasm and what I am curious about is, what
would be the preferred way of handling different builds in fasm. Lets say for example I would have a debug built that contains logging and a release build where the logging is stripped out of. In c or c++ you would simply use statements like:

Code:
#ifdef DEBUG
printf("Logs only in debug build");
#endif
    


I did not find a way to pass arguments to the build that could be used in the preprocessor.
Should I just have different .asm files (debug.asm/release.asm) providing certain defines that includes my main asm file? or are there other better ways possible in fasm?
Post 11 Jan 2022, 14:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18461
Location: In your JS exploiting you and your system
revolution
Code:
> fasm -d DEBUG=1 myprog.asm    
Code:
if DEBUG = 1
 invoke printf, "Logs only in debug build"
end if    
Post 11 Jan 2022, 15:07
View user's profile Send private message Visit poster's website Reply with quote
Rick



Joined: 11 Jan 2022
Posts: 5
Rick
Thanks! That seems to work, I double checked and could not find the -d option described anywhere in the docs is there anywhere a description of possible arguments available? in section 1.1.2 only the -m argument is mentioned
Post 11 Jan 2022, 15:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18461
Location: In your JS exploiting you and your system
revolution
I just typed "fasm" and get the help. I didn't realise it isn't in the docs.
Code:
> fasm
flat assembler  version 1.73.08
usage: fasm <source> [output]
optional settings:
 -m <limit>         set the limit in kilobytes for the available memory
 -p <limit>         set the maximum allowed number of passes
 -d <name>=<value>  define symbolic variable
 -s <file>          dump symbolic information for debugging    
Post 11 Jan 2022, 15:34
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.