Under masm I can define a value on the command line and pass it to the assembler.
for example
Thus when I have a conditional directive like this:
Could it be possible to add the ability to define equates on the command line of fasm? something like:
for release
and
for debug
so we can have directives like
without need to mantain 2 separate sources or edit the source every time one needs to change between debug and release versions
for example
ml /c /Cp /DDEBUG myasm.asm
Thus when I have a conditional directive like this:
ifdef DEBUG
; do some debug things
else
; do some release things
endif
Could it be possible to add the ability to define equates on the command line of fasm? something like:
fasm source.asm target.exe -DDEBUG=0
for release
and
fasm source.asm target.exe -DDEBUG=1
for debug
so we can have directives like
if DEBUG > 0
; do debug stuff
else
; do release stuff
endif
without need to mantain 2 separate sources or edit the source every time one needs to change between debug and release versions
I wont like a compiler switch because on of the main advantages of FASM is the avability to set such options in the source file itself :)
But IIRC there is a conditional assembly function, isnt it? (you read the docs? )
But IIRC there is a conditional assembly function, isnt it? (you read the docs? )
I agree with dxantos that such a feature would be useful. Bazik, it wouldn't be compulsory to use it, if you don't find it useful. ;)
bazik yes I have read the docs, and the conditional assembly exist like this:
Problem is that you must edit the file every time you change from one mode to another. But if one can define it as a command line option if will improve FASM usability for make files. (since you will not need to edit the sourcecode for conditional compilation).
DEBUG=0
if DEBUG > 0
; do debug stuff
else
; do release stuff
endif
Problem is that you must edit the file every time you change from one mode to another. But if one can define it as a command line option if will improve FASM usability for make files. (since you will not need to edit the sourcecode for conditional compilation).
Is it possible to use Env Vars? %DEBUG%
or include a file in your source which is generated by a batch file that takes the parameters your want and calls the real fasm after...
It may not be the most elegant solution and it is a bit tricky, but it actually works...
Note: the use of '>' or '<' or '>>' and '<<' characters in the line to be outputed may be problematic here (maybe there is a workaround using some features of batch files I don't remember...)
@Echo DEBUG=0 > DbgConf.inc
@Echo if DEBUG == 0 >> DbgConf.inc
It may not be the most elegant solution and it is a bit tricky, but it actually works...
Note: the use of '>' or '<' or '>>' and '<<' characters in the line to be outputed may be problematic here (maybe there is a workaround using some features of batch files I don't remember...)