flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Nested macro calls |
Author |
|
LocoDelAssembly 08 May 2006, 21:59
In FASM 1.66 I get illegal instruction 'Parse+1' and it's OK because there is no previous macro definition named "Parse"
|
|||
08 May 2006, 21:59 |
|
Smile 08 May 2006, 22:56
so i can not use recursion at all?
|
|||
08 May 2006, 22:56 |
|
LocoDelAssembly 08 May 2006, 23:12
In that way not, if you call a macro with the same name that the current macro you will call the previous definition.
2.3.3 Macroinstructions wrote: macro mov op1,op2 "mov op1, op2" is not a recursive call, it calls the previous definition of that macro and since there is not one the MOV instruction is assembled. Recursion is posible with some tricks, but, I can't remember... [edit]Maybe you can get some info in win32ax.inc with the allow_nesting macro[/edit] |
|||
08 May 2006, 23:12 |
|
dead_body 09 May 2006, 07:21
Code: macro Parse string { match char tail, string \{ ;here you must include macro Parse(it must be in another file) Parse tail ; extra characters on line 'parse+1' ;here purge it \} } Parse 1+1 read about this in documentation. it is one of the way to do recursion. |
|||
09 May 2006, 07:21 |
|
Tomasz Grysztar 09 May 2006, 07:32
See the PARSECOND macro in the MACRO/IF.INC in fasmw package. It does some parsing without recursion, it uses IRPS instead.
As for sample recursion, you can find some in the JNCONDEL and other similar macros in the same file. |
|||
09 May 2006, 07:32 |
|
vid 09 May 2006, 09:48
Code: macro Define_Parse { macro Parse \{ Define_Parse Parse \} } Define_Parse this is the idea Last edited by vid on 09 May 2006, 12:31; edited 1 time in total |
|||
09 May 2006, 09:48 |
|
Tomasz Grysztar 09 May 2006, 12:14
vid: well said.
|
|||
09 May 2006, 12:14 |
|
vid 09 May 2006, 12:30
thanks, anyway it's stolen from your nested call macros
|
|||
09 May 2006, 12:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.