flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > How cast new macro from another macros !? |
Author |
|
evk1 09 Sep 2014, 18:47
Hi Roman,
If I understand you correctly, you needs something like it: Code: macro CastNewMacro name,[arg]{ common macro name\{ forward arg common \}} But this macro has a bit different syntax: Code: CastNewMacro NameNewMacro,<SumFloat 10.9,11.2>,<DoProc FloatToTxt>,<Msg FloatNum> If you want to use macro which can accept your syntax, you should use more complex solution: Code: macro CastNewMacro name,[arg]{ common macro name\{ forward arg common \}} macro CastNewMacro name,[arg]{ common CastNewMacro@actions equ forward match macroname firstarg,arg\{ CastNewMacro@actions equ CastNewMacro@actions>,<macroname firstarg CastNewMacro@argIsHandled equ\} match =CastNewMacro@argIsHandled,CastNewMacro@argIsHandled\{ CastNewMacro@actions equ CastNewMacro@actions,arg\} restore CastNewMacro@argIsHandled common match >=,args,CastNewMacro@actions>\{CastNewMacro <name>,args\} match ,CastNewMacro@actions\{macro name\\{\\}\}} But your variant has one serious shortcoming. You can not use macros which takes no arguments in macro definitions. By the way you can define macros which takes some arguments in your code using these macros. Code: macro DisplaySomething anything{display anything,13,10} CastNewMacro <DisplaySomethingTwice any>,DisplaySomething any,DisplaySomething any _________________ Sorry for my English |
|||
09 Sep 2014, 18:47 |
|
Roman 10 Sep 2014, 04:56
Thank you evk1
Cool macro ! |
|||
10 Sep 2014, 04:56 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.