flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > macro1 -> macro2 -> macro1 |
Author |
|
dead_body 07 Mar 2006, 09:31
Example.
Code: format PE GUI 4.0 include "C:\fasm\INCLUDE\WIN32AX.INC";standart macro + standart include macro m1 vl1,w { display "enter the macros m1",13,10 if w = 5 push vl1 else m2 vl1 end if } macro m2 vl1 { display "enter the macros m2",13,10 m1 vl1,5 } .code __EntryPoint: m1 eax,0 ret .end __EntryPoint |
|||
07 Mar 2006, 09:31 |
|
vid 07 Mar 2006, 10:48
defining macro1 again in macro2 is only way to do it. And what makes you think it is slow?
btw, you don't need to purge it there... it is no more defined. |
|||
07 Mar 2006, 10:48 |
|
dead_body 07 Mar 2006, 11:42
vid wrote: defining macro1 again in macro2 is only way to do it. And what makes you think it is slow? i think that there can be more quick way. thank you. |
|||
07 Mar 2006, 11:42 |
|
dead_body 07 Mar 2006, 12:20
how can i know that macro is defined?
like "ifndef"? if push ` defined include "push.inc" end if |
|||
07 Mar 2006, 12:20 |
|
Tomasz Grysztar 07 Mar 2006, 13:31
There is no way to know it and it is intended.
The macros in fasm are stacking, that is the new macro when uses the same name inside of itself, uses the previous version of that instruction/macro. So you can redefine macros like in this classic fasm's sample: Code: macro mov arg1,arg2,arg3 { if arg3 eq mov arg1,arg2 else mov arg2,arg3 mov arg1,arg2 end if } where "mov" inside the macro is the original MOV instruction, but it can also be some previous "mov" macro that extended the syntax in different way. For this reason the only way to do a macro recursion in fasm is that constructor-macro technique. |
|||
07 Mar 2006, 13:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.