flat assembler
Message board for the users of flat assembler.
Index
> Main > Count Enumeration |
Author |
|
aaro 07 Jan 2004, 09:22
Code: macro enum [rets] { common count = 1 forward rets = count count = count + 1 } enum RET_OK, RET_ERROR ; After this RET_OK = 1 and RET_ERROR = 2 macro enum lab, [rets] { common count = 1 forward lab#.#rets = count count = count + 1 } enum RETS, RET_OK, RET_ERROR ; After this RETS.RET_OK = 1 and RETS.RET_ERROR = 2 Don't know C so there's two versions, hope they'll do. |
|||
07 Jan 2004, 09:22 |
|
jInuQ 07 Jan 2004, 10:05
Thank you sir. They look okay ,but it is bed time. In C you never know what you enums are going to be unless you specify that starting point.
_________________ jInuQ "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint Exupery |
|||
07 Jan 2004, 10:05 |
|
Madis731 07 Jan 2004, 12:05
Here I can see that macros can be of fun too. They seem to be very helpful. But where on Earth can I find the "syntax" on macros. Again new macro that worked, but it again has some commands that I don't understand:(
Is there any possibility to "read" out of fASM's source, what is the possible syntax of macros in fASM Hey....anyone... |
|||
07 Jan 2004, 12:05 |
|
scientica 07 Jan 2004, 14:01
Madis731 wrote: But where on Earth can I find the "syntax" on macros Have you read fasm.txt (or fasm.pdf in the windows package)? _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
07 Jan 2004, 14:01 |
|
pelaillo 08 Jan 2004, 04:27
Or better the CHM help file prepared by IceStudent, look here:
http://board.flatassembler.net/topic.php?t=822 |
|||
08 Jan 2004, 04:27 |
|
aaro 08 Jan 2004, 05:38
Code: macro _enum [arg, arg2] { forward if ~ arg2 eq arg = arg2 count = arg2 else arg = count end if } macro enum start, step, [arg] { common count = start forward _enum arg count = count + step } enum 1, 2, foo, <bar, 7>, foobar ; foo=1 bar=7 foobar=9 Here's extended version of the enum macro |
|||
08 Jan 2004, 05:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.