flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > struct/union (small bug ?) |
Author |
|
revolution 09 Nov 2010, 13:16
toto.v2, toto.v3 and toto.v5 are not local labels. So the last one (toto.v2) will be the current global label that .x attaches to.
|
|||
09 Nov 2010, 13:16 |
|
ouadji 09 Nov 2010, 13:42
Quote: toto.v2, toto.v3 and toto.v5 are not local labels. their symbolic values are merged with "union" at the symbolic level, toto.v2 = toto.v3 = toto.v5 |
|||
09 Nov 2010, 13:42 |
|
revolution 09 Nov 2010, 13:45
union can't perform magic. How would you make three current global labels and have .x attach to them all?
|
|||
09 Nov 2010, 13:45 |
|
ouadji 09 Nov 2010, 14:02
three current global labels ... here is the problem ! toto.v2, toto.v3 and toto.v5 are not 3 global labels but only one, with three different names, because "union" mov [toto.v3],1 mov eax,[toto.v2] ;eax == 1 |
|||
09 Nov 2010, 14:02 |
|
revolution 09 Nov 2010, 14:08
ouadji wrote: toto.v2, toto.v3 and toto.v5 are not 3 global labels But even if they weren't, it is not possible for union make all three attach to .x simultaneously. |
|||
09 Nov 2010, 14:08 |
|
ouadji 09 Nov 2010, 14:18
obviously that is possible fasm is built in assembler and with assembler all is possible. In this case, the symbolic value of "union" is not respected. I think that should be fixed, Tomasz ? what do you think about that ? |
|||
09 Nov 2010, 14:18 |
|
revolution 09 Nov 2010, 14:27
Are you aware that union is a macro? Hence the assembler has no knowledge that union even exists.
|
|||
09 Nov 2010, 14:27 |
|
ouadji 09 Nov 2010, 14:33
one point edit: maybe create a new feature in the macro language to allow this ? |
|||
09 Nov 2010, 14:33 |
|
Fanael 09 Nov 2010, 16:11
The question is: what are you exactly trying to achieve and why?
|
|||
09 Nov 2010, 16:11 |
|
ouadji 09 Nov 2010, 17:12
no, it's not a question about "what" and "how", just a matter of theory ... a matter about compiler overall coherence. |
|||
09 Nov 2010, 17:12 |
|
Tomasz Grysztar 09 Nov 2010, 23:36
As "struct" is just a macro, the only real view of "compiler coherence" would be when looking at what is processed after the macro is expanded. And when you look at preprocessed source, everything works exactly as it should.
Macros may be changed and improved over time (you can even have various "struct" alternatives provided, so that you can simply include the one of your choice, but still have some other available) and it has nothing to do with compiler itself. As it seems that using parser-stage locals mechanism with "struct" macros bothers you much, I modified the "struct" (which before had undefined behavior with respect to what global label context it leaves for the code that follows) to define context of its own name. So now: Code: toto X
.x: |
|||
09 Nov 2010, 23:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.