flat assembler
Message board for the users of flat assembler.
Index
> Main > Macro tips |
Author |
|
baldr 21 Feb 2013, 11:04
nmake,
Preprocessor operates with symbols (though it recognizes them as numbers when needs to). For simple cases it can help: rept 10 i:0 { dd 2#i#.0 } will generate equivalent of dd 20.0, 21.0, ..., 29.0. More generic cases probably will require assembly stage to perform compile-time floating point processing (preprocessor can join symbols but can't split them, at least directly, AFAIK). Explain your problem, maybe it can be solved. |
|||
21 Feb 2013, 11:04 |
|
nmake 21 Feb 2013, 11:32
My simple problem is that I need to add 2.0 to a floating point immediate parameter that I pass to a function. Thats the whole simple problem.
Code: invoke function,2.0 now, invoke the same function, but with 4.0 next time, then 6.0 next time, then 8.0 next time. Repeat this 20 times over. I used runtime floating point calculation to temporary solve it, it was just for testing purposes, building a very large stone corridor. http://i.imgur.com/tNvDPkC.jpg |
|||
21 Feb 2013, 11:32 |
|
baldr 21 Feb 2013, 13:21
nmake,
Preprocessor can perform compile-time calculations. Code: rept 20 % { rept 1 %%: %*2 \{ invoke function, %%\#f \} } |
|||
21 Feb 2013, 13:21 |
|
nmake 21 Feb 2013, 13:36
Yes, I forgot about the escape characters.
|
|||
21 Feb 2013, 13:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.