flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > saving result of preprocessing |
Author |
|
Tomasz Grysztar 07 Dec 2005, 14:51
The FASMW has the code that converts single line from preprocessed code back into text form (it goes from "error_in_preprocessed" label in FASM.INC file) to display it in the error report box - but it displays only those lines, that after preprocessing go to the parser/assembler. In other types of lines (that got interpreted by preprocessor and don't go into parser), there are still some cases, when some of the symbols get altered/destroyed, like the invocation of structure macroinstruction.
|
|||
07 Dec 2005, 14:51 |
|
vid 07 Dec 2005, 16:20
could you make executable which just outputs data that go to parser as normal text? Or guide how to alter FASM, but standalone utility looks better to me, because of many uses it could have.
Maybe it could be command-line switch, but as i know you, you wouldn't like it :] |
|||
07 Dec 2005, 16:20 |
|
Tomasz Grysztar 07 Dec 2005, 17:28
OK, here you are - this is the Win32 console version of fasm reduced to preprocessor only and extended to convert preprocessed source back to text and write it into output file.
The output is in the form that can be then also assembled using fasm.
|
|||||||||||
07 Dec 2005, 17:28 |
|
decard 07 Dec 2005, 17:49
wow I preprocessed Fresh and got 13mb file.
Could you write how to change it to generate output without comments (just pure code that goes to parser)? Why it generates so many empty lines? |
|||
07 Dec 2005, 17:49 |
|
Tomasz Grysztar 07 Dec 2005, 17:56
The lines that have only comments inside become the empty ones. The parser then strips them out.
|
|||
07 Dec 2005, 17:56 |
|
decard 07 Dec 2005, 19:00
Here's my version (actually I wrote it for fun ), that generates output without preprocessor stuff in comments and without empty lines. My addition is terrible (when you look at source), but it took me only 5 minutes to write and test it, and it does its job well.
|
|||||||||||
07 Dec 2005, 19:00 |
|
vid 07 Dec 2005, 21:23
great job. i thought symbols containing "?" are split during pre-preprocessing, so they can't be used directly. btw, about 3Mb is generated only by win32axp.
|
|||
07 Dec 2005, 21:23 |
|
Tomasz Grysztar 07 Dec 2005, 22:41
And to go into opposite direction than decard here's the version that additionally indents the lines generated by macroinstruction, so you can see the overall structure better (each next level of macro causes deeper indent).
|
|||||||||||
07 Dec 2005, 22:41 |
|
vid 07 Dec 2005, 23:07
i have 2 ideas
1. Make these things adjustable, i mean mode without macro line, with them, and with them indented. (well, second one doesn't have to be there). You would choose with some command line parameter. Or just command line parameter to remove macrolines from output. 2. put the code into some module (like "PREWRITE") and just call some write_preprossed_file after call preprocess. It fills more into source logic (i think) and is nicer to much work with. |
|||
07 Dec 2005, 23:07 |
|
aq83326 10 Jan 2012, 10:58
Tomasz Grysztar wrote: And to go into opposite direction than decard here's the version that additionally indents the lines generated by macroinstruction, so you can see the overall structure better (each next level of macro causes deeper indent). I can compile with both fasm and fasmw but fasmpre gives me an 'out of memory' error. |
|||
10 Jan 2012, 10:58 |
|
Tomasz Grysztar 10 Jan 2012, 11:04
This is an obsolete thread. In modern versions of fasm you can get preprocessed source with "prepsrc" program from TOOLS subdirectory.
|
|||
10 Jan 2012, 11:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.