Fred could integrate it into PB after writing the ASM file. PB always outputs the ASM file, so PB itself could do the (optional) re-writing of the ASM before calling FAsm.c4s wrote:@Danilo
I was looking for a more "integrated" solution. Replacing files of the compiler just doesn't feel right
Doable as an optional optimization pass over the ASM output. Alternatively allow 3rd party compiler plugins (as DLL/Shared lib) to work on source and output files.
pbcompiler.exe outputs ASM, and it is given to FAsm - so an external ASM output optimizer must reside between pbcompiler and FAsm.
Let me know if you have a better idea than replacing FAsm with the optimizer.
Now: pbcompiler.exe -> FAsm.exe
New: pbcompiler.exe -> ASM optimizer -> FAsm.exe
That could be easily added with a macro in a resident. I'm not on Windows now, but something like the following should work:c4s wrote:plus the functionality cannot easily be enabled/disabled.
Code: Select all
Macro RemoveDeadProcedures
!define remove_dead_procedures
EndMacro
In the DeadProcedureRemover.pb file, add a line to detect the "define remove_dead_procedures" in the ASM,
and re-write the output only if this line was found.
I did something similar before, it is the following commented part in the code:
Code: Select all
;ElseIf LCase(trimmedLine$) = "define show_optimize_info"
; showResult = 1
; Continue