flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Macro names with dot need escaping when used in struc |
Author |
|
Tomasz Grysztar 25 Mar 2014, 09:28
revolution wrote: I can't see any reason why the name with a dot is special. fasm's manual, section 2.3.4 wrote: This label will be also attached at the beginning of every name starting with dot in the contents of macroinstruction. revolution wrote: What label name is defined by "y bar2 2" if it is not "y.foo"? |
|||
25 Mar 2014, 09:28 |
|
revolution 25 Mar 2014, 09:38
Oh, so macro names are not processed first for expansion. The struc processor applies the label prefix before subsequently scanning macro names. So it is not just the contents of the macro but also the macro name itself that gets the label attached. This differs from the normal processing of label attachment outside of a struc:
Code: macro .foo { .bar db 1 } lab: .foo ;assembles "db 1" and doesn't create lab.foo label x = lab.bar ;Okay x = lab.foo ;<--- error: undefined symbol 'lab.foo'. |
|||
25 Mar 2014, 09:38 |
|
Tomasz Grysztar 25 Mar 2014, 11:05
revolution wrote: This differs from the normal processing of label attachment outside of a struc: The processing of dot-prefixed symbols in STRUC is performed by one of the two fasm's "line makers" (as explained in the Understanding fasm), which are the modules that brew the new lines that are then preprocessed using standard rules. All the operations specific to macroinstruction context (like concatenation with #, replacement of local names and macro parameters, etc.) are performed by the macroinstruction processor in order to generate a line that is then preprocessed normally. And thus all these operation are finished before fasm starts to look for the macroinstruction name in the line. |
|||
25 Mar 2014, 11:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.