flat assembler
Message board for the users of flat assembler.
Index
> Main > Conditional compiling |
Author |
|
revolution 05 Sep 2010, 00:08
You need to use 'equ'.
Code: DEBUG equ TRUE |
|||
05 Sep 2010, 00:08 |
|
mindcooler 05 Sep 2010, 00:49
All right.
How do I do the converse, do something when DEBUG is undefined for example? |
|||
05 Sep 2010, 00:49 |
|
revolution 05 Sep 2010, 01:01
If DEBUG has never been defined:
Code: match =DEBUG,DEBUG { ... } |
|||
05 Sep 2010, 01:01 |
|
mindcooler 05 Sep 2010, 09:08
Thanks. Can I use this inside macros to make them behave differently according to DEBUG? I tried with my import macro, but fasm didn't like it.
Code: macro import [dll,functions] { dd 0,0,0,dll#.name-imgbase,dll#.iat-imgbase common dd 5 dup 0 idata.size = $-idata match =TRUE, DEBUG { forward dll#.ilt: irp function,functions \{ dd function\#.name-imgbase \} dd 0 } forward dll#.iat: irp function,functions \{ function: dd function\#.name-imgbase \} dd 0 forward dll#.name: db `dll,0 forward irp function, functions \{ <--- Error: unexpected characters, or undefined symbols when i escape the brackets align 2 function\#.name: dw 0 db \`function,0 \} } |
|||
05 Sep 2010, 09:08 |
|
revolution 05 Sep 2010, 09:16
Remember to escape the {} used by match
Code: macro { match \{ irp \\{ ;... \\} \} } |
|||
05 Sep 2010, 09:16 |
|
mindcooler 05 Sep 2010, 23:38
Awesome, I forgot to escape the # in there.
It makes an awful clutter, perhaps it's best to make separate imports instead. |
|||
05 Sep 2010, 23:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.