flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Strange local labels... |
Author |
|
Tomasz Grysztar 30 Oct 2012, 10:48
There are two different mechanisms mixed here, the dotted label in "struc" definition is processed by preprocessor and so it's a completely separate thing. Look at the preprocessed source (with PREPSRC tools from the official package, for example) to see what's going on here.
|
|||
30 Oct 2012, 10:48 |
|
JohnFound 30 Oct 2012, 11:21
Yes, I understand what happens and checked it in the preprocessed source. But is it normal? I mean one probably would expect .p2 to be defined as a local label of n2, not of n2.f2;
Now the preprocessor creates following: Code: n2: n2.f1 db 1 n2.f2 db 1 .p2 db 1 What if the preprocessor does not put the name of the structure at the front of its members. This way, there will be: Code: n2: .f1 db 1 .f2 db 1 .p2 db 1 Do you think some incompatibility can be introduced this way? Or other problems... |
|||
30 Oct 2012, 11:21 |
|
Tomasz Grysztar 30 Oct 2012, 16:05
JohnFound wrote: Do you think some incompatibility can be introduced this way? Or other problems... |
|||
30 Oct 2012, 16:05 |
|
JohnFound 30 Oct 2012, 16:32
I see. IMHO, this behavior of the structures should be documented somehow. Of course conflicts as described above are very uncommon.
Regards |
|||
30 Oct 2012, 16:32 |
|
Tomasz Grysztar 30 Oct 2012, 18:46
This is just another case where it is important to understand the separation of the preprocessor's language from the later stages. I planned to elaborate on this in the Understanding fasm article, nevertheless the manual already covers it all quite completely (though in compact form). It may only need cleaning up of terminology in a few places (for example, it often uses "symbol" or "name" meaning the same thing that I now usually call "token").
|
|||
30 Oct 2012, 18:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.