Page 1 of 1

postprocessing function for altering the .asm

Posted: Thu Nov 26, 2015 4:05 pm
by Keya
In a previous thread I mentioned it'd be great if we could make the code section writeable for dynamic & self-mod code, and to do that is simply a matter of changing the ASM (changing "section '.code' code readable executable align 4096" by inserting the word "writeable")

And while I suggested something like a "EnableWriteCode" statement, the exact same could be achieved and with much greater flexibility by a global string replace post-processing capability.

Something along the lines of this:

Code: Select all

PostProcessReplace "code readable executable align 4096", "code readable writeable executable align 4096"
perhaps MACRO could even be involved, but im not thinking that far ahead and if kept simple like the above i'd imagine it wouldnt be too hard to incorporate, literally just Read asm file, Replace StringA with StringB, Save asm file.

of course it is already possibly to write our own postprocessor for this, but I wanted to put the idea forward for possible native inclusion
Feedback negative and positive welcome