flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > simple "union" macro |
Author |
|
Foamplast 02 Sep 2004, 21:04
Can you explain using the '@' symbol?
|
|||
02 Sep 2004, 21:04 |
|
Tomasz Grysztar 02 Sep 2004, 21:12
It's just a character inside the label, it has no special meaning.
|
|||
02 Sep 2004, 21:12 |
|
vid 03 Sep 2004, 19:22
it's no preprocessor, parser or assembly time operator, so it's character just like any else.
|
|||
03 Sep 2004, 19:22 |
|
revolution 13 Sep 2004, 02:39
I tried the following (changing the macro to struc)
Code: struc union [def] { common size@union = 0 origin@union = $ forward virtual def if $-origin@union > size@union size@union = $-origin@union end if end virtual common rb size@union } struc uretin { .ddHelp dd ? .ddBegin dd ? } struc wimsad { .dwTest dd ? } struc kolp { .ddStart dd ? .ddStop dd ? .ddMode dd ? .data union .strUretin uretin,\ .strWimsad wimsad .lpszText dd ? } k kolp mov eax,[k.strUretin] ;This line should fail - but okay mov eax,[k.data.strUretin] ;This line should work - but fails The label ".data" seems to be forgotten. Fasm gives an error message if the union structure is put back to macro. Any way I can solve this? |
|||
13 Sep 2004, 02:39 |
|
S.T.A.S. 13 Sep 2004, 20:45
The problem is because of special meaning of dot symbol inside 'struc' statement.
The right code should be: Code: struc union [def] { common size@union = 0 origin@union = $ forward virtual .#def ; plase dot here if $-origin@union > size@union size@union = $-origin@union end if end virtual common rb size@union } struc kolp { .ddStart dd ? .ddStop dd ? .ddMode dd ? .data union strUretin uretin,\ ; note: there's no dot strWimsad wimsad .lpszText dd ? } |
|||
13 Sep 2004, 20:45 |
|
revolution 14 Sep 2004, 02:15
Aha, you got it. Thanks.
|
|||
14 Sep 2004, 02:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.