flat assembler
Message board for the users of flat assembler.
Index
> Windows > conditional defines question |
Author |
|
UCM 12 Aug 2006, 15:03
This is because "if" is processed AFTER "define" and "equ" (which are processed in the preprocessing stage), so if your original code looked like
Code: define TIMERS 1 if ~ defined TIMERS define TIMERS 2 end if mov eax,TIMERS Code: if ~ defined TIMERS end if mov eax,2 To make this work, then you will have to use '=' instead of 'define', because '=' is processed in the assembling stage and is affected by 'if'. However, because FASM does multiple passes, you cannot use this simple code: Code: TIMERS = 1 if ~ defined TIMERS TIMERS = 2 end if mov eax,TIMERS Code: TIMERS = 1 if ~ defined TIMERS | defined TIMERS_DEFINED_HERE TIMERS = 2 TIMERS_DEFINED_HERE = 1 end if mov eax,TIMERS |
|||
12 Aug 2006, 15:03 |
|
Tomasz Grysztar 12 Aug 2006, 17:45
Also see the FAQ (fourth question), and this article (for a bit longer reading).
|
|||
12 Aug 2006, 17:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.