flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Match around include |
Author |
|
revolution 04 Jul 2020, 01:37
The macro is expanded before the stuff inside is processed. So the match will find-and-replace all !'s in the single line "include 'library.inc'". Since there are no instances of ! in that line then it has no effect.
|
|||
04 Jul 2020, 01:37 |
|
DimonSoft 04 Jul 2020, 07:59
And since it is processed line by line it is impossible to inject some symbolic value from outside the file being included, right? I mean, it’s impossible to expand include before the outer match gets processed, isn’t it?
The workaround might be to use equ for the symbol but I’m not quite sure if it is completely equivalent. Requires much more attention to restore it properly while match would make FASM check for balanced {}. |
|||
04 Jul 2020, 07:59 |
|
revolution 04 Jul 2020, 08:10
You can use equ
Code: ! equ int3
include 'test.inc' Code: ! Code: ~ fasm test.asm && hd test.bin flat assembler version 1.73.08 (4053744 kilobytes memory) 1 passes, 1 bytes. 00000000 cc |.| 00000001 ~ Code: macro my_include file, var, replacement { var equ replacement include file restore var } my_include 'test.inc', !, int3 |
|||
04 Jul 2020, 08:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.