flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > undesdending of local (not macro)... |
Author |
|
revolution 23 Jul 2005, 17:26
Inside fasm "local some_label" will make the label "some_label?01234567" where 01234567 is a unique count value each time the macro is used.
Code: macro onTest data,_exit { local ..end ;<-- becomes ..end?00000000 cmp data,0 ;only for example jz _exit ;only for example invoke SendMessage,[MainForm],WM_DESTROY,0,0 ;only for example ..end: ;<-- becomes ..end?00000000: } macro doTest data,_exit { local ..end ;<-- becomes ..end?00000001 ;invoke MoveToEx,ebx,esi,0,0 ;but work true, if this is uncomments !!! onTest data,__end ..end: ;<-- becomes ..end?00000001: } ; any codes... doTest dword[ebx],entry_loop Actually my notes above are not truly correct, the labels and made each time the macro is used not when it is declared, but I hope you get the idea. BTW: you never used the ..end labels in your example. |
|||
23 Jul 2005, 17:26 |
|
Galkov 23 Jul 2005, 19:55
revolution,
I was thinking at the same way But I have error message (symbol already defined) after compiling example above And I have no error ( ), after uncomments line, as noted above. That was a really reason of this topic BTW: That was simplified (very much) version of complex system of macros _________________ sorry for my bad english |
|||
23 Jul 2005, 19:55 |
|
revolution 24 Jul 2005, 00:54
Your macros can be minimised like this:
Code: macro a {local z z:} macro b {local z a z:} b I think this may be a bug in FASM. It gives symbol already defined error. |
|||
24 Jul 2005, 00:54 |
|
Galkov 24 Jul 2005, 02:52
And what can we do, for fixing this BUG
At present time, I have no adequate erudition for this assertion _________________ sorry for my bad english |
|||
24 Jul 2005, 02:52 |
|
revolution 24 Jul 2005, 05:29
I'm not sure if this is intended or a bug, either way we will have to wait for the author to comment and/or fix.
|
|||
24 Jul 2005, 05:29 |
|
decard 24 Jul 2005, 05:44
unfortunately author is on holidays now, but he should be back in a few days.
|
|||
24 Jul 2005, 05:44 |
|
Galkov 24 Jul 2005, 07:12
BTW: It's good idea... About holidays
|
|||
24 Jul 2005, 07:12 |
|
Galkov 25 Jul 2005, 14:30
Nevertheless, I decide to look at the source-code, before my own holidays :
1) Function increase_counter (it is just text-counter for local labels) is called only from close_macro_block-function And close_macro_block is called at the each repeates of macro_block, and at the and of macro. 2) Consequently, there are no close_macro_block call's between two local-macro_directives in above example 3) As indirectly test, null-macro (for example) before <local> macro_directive, or at the begining of each macro - remove error message in above example (I was checked up it) 4) Removing this code: Code: push ecx
mov eax,locals_counter
call increase_counter
pop ecx from close_macro_block-function to the begining of local_symbols-blok, fixed the BUG too... For example: Code: local_symbols: ;line 1917 of PREPROCE.INC (I have v1.62-sources) push ecx ;this code is removed from close_macro_block mov eax,locals_counter ;it seems, ebx is free for scratch this call increase_counter ;may be inlining ? pop ecx ;if eax is free, xchg eax,ecx should be faster lods byte [esi] cmp al,1Ah jne invalid_argument mov byte [edi-1],3Bh xor al,al stos byte [edi] make_local_symbol: ................... But it may be not correct at all cases (although, I don't see in what - now I am only beginer in Fasm) All of that, was for additional notes fom Author _________________ sorry for my bad english |
|||
25 Jul 2005, 14:30 |
|
revolution 26 Jul 2005, 01:06
Good job, Galkov. Nice work in tracking down the problem.
|
|||
26 Jul 2005, 01:06 |
|
Tomasz Grysztar 26 Jul 2005, 08:56
Thanks for the report. Will be fixed soon.
|
|||
26 Jul 2005, 08:56 |
|
MCD 26 Jul 2005, 14:11
Back from holiday? Or even working on Fasm IN holidays??
|
|||
26 Jul 2005, 14:11 |
|
vid 27 Jul 2005, 13:35
heh, whis is whati call support.
|
|||
27 Jul 2005, 13:35 |
|
Tomasz Grysztar 28 Jul 2005, 15:18
For such a small fixes it's not much of a trouble.
|
|||
28 Jul 2005, 15:18 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.