flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid
you should read FAQ. you are using "If not defined then define" which is illogical contrusction (because FASM's "defined" operator has scope over whole file, not only before it's used)
|
|||
![]() |
|
c0d3z
thanks for reply, but any solution?
I only want to insert the extrn in this macro. |
|||
![]() |
|
UCM
It should be like this:
Code: format MS COFF macro invoke proc, [arg] { if ~ arg eq reverse push arg end if common if ~ defined proc | defined proc#_defined_here extrn proc: DWORD proc#_defined_here = 1 end if call proc } ;extrn MessageBoxA: dword ;extrn ExitProcess: dword section ".code" code readable executable public start start: invoke MessageBoxA, 0, szText, szInfo, 0 invoke ExitProcess, 0 section ".data" data readable writeable szInfo db "Hello",0 szText db "Hello,world!",0 because it sets a variable defining whether the procedure has been extrn'd yet, so it will continue to do it for all passes. I can't explain well, read the "Design Principles" in the Documentation section. Also, the extrn definition is in the 'common' section; you wouldn't want to do it multiple times for each procedure to call, would you? _________________ This calls for... Ultra CRUNCHY Man! Ta da!! *crunch* |
|||
![]() |
|
Vortex
Hi UCM,
Thanks for your macro, nice design. Now this invoke macro acts like GoAsm's invoke statement which doesn't require the extrn command. _________________ Code it... That's all... |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.