flat assembler
Message board for the users of flat assembler.
Index
> Main > Out of memory when a lot of local (stack) variables declared |
Author |
|
Tomasz Grysztar 31 Mar 2018, 17:11
The standard "proc" with "local" are defined as quite complex macros, and if you use these macros so many times, the source text grows quickly to large sizes (the assembler only starts processing the source text after it has gone through preprocessing in its entirety).
You could try using some customized macros with smaller implementation, so that the source text would not grow so large. Alternatively, you could try fasmg with its set of fasm-compatibility Win32/Win64 macros. Because fasmg has no separate preprocessor/assembler layers like fasm 1, its macros use less memory. Your sample assembles easily with fasmg (with only problem being that "local" has to be replaced with uppercase "LOCAL" in current implementation of these compatibility macros), even though in that case even all the instructions are implemented as macros. |
|||
31 Mar 2018, 17:11 |
|
Tomasz Grysztar 31 Mar 2018, 19:49
I have updated fasmg with a new experimental feature which I had in mind since quite a long ago and it allows me to finally implement "proc" for fasmg with case-insensitive "local" without causing any problems with usage of "local" directive inside instruction set macros. I may update the Windows headers to use this new feature soon, but then they are going to need the latest fasmg to work.
|
|||
31 Mar 2018, 19:49 |
|
6a05 01 Apr 2018, 13:50
Tomasz Grysztar wrote: The standard "proc" with "local" are defined as quite complex macros, and if you use these macros so many times, the source text grows quickly to large sizes (...) I understand. Thanks for quick reply. Tomasz Grysztar wrote: Alternatively, you could try fasmg I already switched to local .tmp[8191]:QWORD like constructon and calculate var offset manually while generating code in compiler. It's sufficient to go on with my current work. Result code is little less readable for human, but it's not a big issue for now. I'll check out fasmg when earlier stages will be more stable. Thanks. |
|||
01 Apr 2018, 13:50 |
|
Tomasz Grysztar 01 Apr 2018, 14:03
If this is a code generated by your own compiler, the best solution for you might be to make custom macro package, best suited to the code that your compiler is able to produce. fasm's "proc" is a large macro mainly because it implements many syntax variants for the manual use. In case of compiler output the macros may support just one simplified syntax generated by compiler and nothing else.
|
|||
01 Apr 2018, 14:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.