flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > equ trick |
Author |
|
Tomasz Grysztar 18 Dec 2007, 21:27
Code: define counter@mymacro 0 macro mymacro name { match c,counter@mymacro \{ rept 2 x:c \\{ define counter@mymacro x \\} \} match c,counter@mymacro \{ name equ anothermacro c \} } First line of the macro increases the counter@mymacro by 1, the second one does the assignment you requested. |
|||
18 Dec 2007, 21:27 |
|
Tomasz Grysztar 18 Dec 2007, 21:31
You can also make it as one-liner
Code: macro mymacro name { match c,counter@mymacro \{ rept 2 x:c \\{ define counter@mymacro x \\} \} match c,counter@mymacro \{ name equ anothermacro c \} } define counter@mymacro 0 |
|||
18 Dec 2007, 21:31 |
|
Madis731 19 Dec 2007, 09:04
If really feels like what we're looking for here is ENUM, maybe try that one out.
|
|||
19 Dec 2007, 09:04 |
|
pps05 19 Dec 2007, 16:05
Thank you, it's the thing that I need. Is it impossible to do that without 'match' and 'rept'? Madis731, I need to place 'mymacro' anywhere in source, so ENUM doesn't look like a good idea.
|
|||
19 Dec 2007, 16:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.