flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > struct (does not compile ?) |
Author |
|
Tomasz Grysztar 09 Nov 2010, 23:09
Yes, this macro was unfinished in this aspect and I forgot about it. Here's the corrected "define@struct" macro:
Code: macro define@struct name,[field,type,def] { common local list list equ forward if ~ field eq . name#field type def sizeof.#name#field = $ - name#field else label name#.#type rb sizeof.#type end if local value match any, list \{ list equ list, \} list equ list <value> common sizeof.#name = $ restruc name match values, list \{ struc name value \\{ match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\} match , fields@struct \\\{ label . forward match , value \\\\{ field type def \\\\} match any, value \\\\{ field type value if ~ field eq . rb sizeof.#name#field - ($-field) end if \\\\} common \\\} \\} macro name value \\{ match any, fields@struct \\\{ \\\local anonymous fields@struct equ fields@struct,anonymous,name,<values> \\\} match , fields@struct \\\{ label . forward match , value \\\\{ type def \\\\} match any, value \\\\{ \\\\local ..field ..field = $ type value if ~ field eq . rb sizeof.#name#field - ($-..field) end if \\\\} common \\\} \\} \} } |
|||
09 Nov 2010, 23:09 |
|
Tomasz Grysztar 09 Nov 2010, 23:28
OK, I'm uploading the package with finished (I hope) corrections.
|
|||
09 Nov 2010, 23:28 |
|
ouadji 10 Nov 2010, 01:02
flat assembler 1.69.25 for Windows size: 891 kilobytes last update: 09 Nov 2010 now, with this last update, this below does not compile ??? (with the previous version of "struct", it compiled without problem.) Code: include 'win32a.inc' struct BB v1 dd ? v2 dd ? ends mov eax,dword[toto.v2.x] toto BB .x : |
|||
10 Nov 2010, 01:02 |
|
revolution 10 Nov 2010, 01:07
Code: mov eax,dword[toto.x] |
|||
10 Nov 2010, 01:07 |
|
ouadji 10 Nov 2010, 01:11
no, with the prévious version of "struct" mov eax,dword[toto.v2.x] compiled without problem I develop a full highlighting of struct macro ! (for next Wink) I absolutely need a reference. Last edited by ouadji on 10 Nov 2010, 01:25; edited 2 times in total |
|||
10 Nov 2010, 01:11 |
|
revolution 10 Nov 2010, 01:20
ouadji wrote:
|
|||
10 Nov 2010, 01:20 |
|
ouadji 10 Nov 2010, 01:31
Tomasz, why this is no longer allowed? This new version greatly limits the possibilities of "struct". Is this really your wish? Code: include 'win32a.inc' struct BB v1 dd ? v2 dd ? ends mov eax,dword[toto.v2.x] toto BB .x : |
|||
10 Nov 2010, 01:31 |
|
baldr 10 Nov 2010, 23:57
Tomasz Grysztar,
Probably label should explicitly declare whether it wants to have following local labels to be attached to it. Something like Code: hello.: … goodbye: … .world: jmp hello.world |
|||
10 Nov 2010, 23:57 |
|
ouadji 11 Nov 2010, 01:35
it is true that your idea is interesting baldr, but I do not see the interest on a practical level. I do not think it would bring much more possibilities. That said, once again, it's a original idea. |
|||
11 Nov 2010, 01:35 |
|
Tomasz Grysztar 11 Nov 2010, 07:45
baldr wrote: Probably label should explicitly declare whether it wants to have following local labels to be attached to it. |
|||
11 Nov 2010, 07:45 |
|
bitRAKE 11 Nov 2010, 08:21
Tomasz, what method do you use to avoid name collision under SSSO principal? Please, don't remove dot labels - not all labels need some_descriptive_long_text.
|
|||
11 Nov 2010, 08:21 |
|
Tomasz Grysztar 11 Nov 2010, 09:35
Did I say I was going to remove them?
|
|||
11 Nov 2010, 09:35 |
|
ouadji 11 Nov 2010, 09:55
200% agree with baldr. dot label are very useful. Without them, fasm lose much of its interest. |
|||
11 Nov 2010, 09:55 |
|
Tomasz Grysztar 11 Nov 2010, 10:18
If it was not for NASM compatibility I would go for something more fitting the overall fasm's design, like nested local namespaces closed with "end" directive. But being compatible with NASM at least in this aspect doesn't usually hurt - though you have to be careful with macro design to take it into consideration. But this is all academic discussion - this feature is to well-established in fasm's 1.x architecture to change it now.
|
|||
11 Nov 2010, 10:18 |
|
ouadji 11 Nov 2010, 11:23
Quote:
don't touch anything, it's perfect like that fasm does not have to be like this or like that ... fasm can be simply himself. |
|||
11 Nov 2010, 11:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.