flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > When do FIX start working? |
Author |
|
l4m2 24 Jan 2019, 08:00
Code: match =0,0 { include "a.asm" P } ; a.asm P fix display "LOL" |
|||
24 Jan 2019, 08:00 |
|
ProMiNick 24 Jan 2019, 08:33
Stupid post removed.
I knew that Tomasz will explain this better then I. Last edited by ProMiNick on 24 Jan 2019, 20:31; edited 1 time in total |
|||
24 Jan 2019, 08:33 |
|
Tomasz Grysztar 24 Jan 2019, 18:45
As mentioned in Understanding fasm article, fasm's preprocessor has two different "line makers" - engines that prepare line of source to be further preprocessed. Any tokenized line that is preprocessed comes from one of these engines. There is a "source reader" and "macro processor", and each of them has a set of additional commands that can alter the text of tokenized line that is then passed to preprocessing.
The commands of "macro processor" are things like concatenation with # (this is why you cannot use # outside of macros). And interpretation of FIX and replacements defined with FIX are done by "source reader" - therefore they are not applied to lines produced by "macro processor". Any block that uses { } syntax in fasm's preprocessor is a macro. Directives like REPT or IRP are so called "instantaneous-use macros", they do not have a name and are used immediately after they are defined. MATCH is also such kind of macro, it is a "single-use macro", defined and then immediately called or not (depending whether the expression is matched). So when you have a code that looks like this: Code: match =0,0 { include "a.asm" P } After a single-use macro has been defined, it is evaluated - if the MATCH condition is fulfilled. The macro then generates a new set of lines for preprocessing, this time these lines are created by "macro processor" and not "source reader". And "macro processor" does not process things like FIX and related replacements, it only cares about things like #. |
|||
24 Jan 2019, 18:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.