Page 1 of 1
ASM - PB code - and /COMMENTED switch
Posted: Tue May 09, 2006 2:02 pm
by SFSxOI
OK, I learned something this morning (thanks traumatic), even tho it was staring me right in the face all this time but I haven't been interested in ASM until lately.
I now know that using the /COMMENTED switch will provide FASM for the PB code being compiled. But...is it possible to take FASM code and get the PB code for the FASM?
Posted: Tue May 09, 2006 2:09 pm
by Dare2
* confused *
If it was produced via PureBasic, you have the commented output.
If it was produced via anything else (eg, a human being) it is unlikely there would be a correlation between the two.
Re: ASM - PB code - and /COMMENTED switch
Posted: Tue May 09, 2006 2:21 pm
by traumatic
You mean like a reverse compilation? "ASM-to-PureBasic"? No.
I also doubt it would make much sense (but that's just me).
The /COMMENTED switch was introduced to let the programmer
manualy optimize the generated ASM code (and - as a positive
side effect - to be able to learn from the code).
Posted: Tue May 09, 2006 2:34 pm
by josku_x
ASM-toPureBasic isn't hard. Open the PureBasic.asm file, modify it a little and add a '!' in front of each line, open up in PB and you can usethe ASM with the rest of your code
Posted: Tue May 09, 2006 7:33 pm
by thefool
As josku_x says you can "port" fasm code to pb, sort of. Of course a lot of things will need to be changed, some might not work etc etc.
If you mean to dissasemble an exe and get runnable fasm output, no thats not possible.
Re: ASM - PB code - and /COMMENTED switch
Posted: Tue May 09, 2006 7:42 pm
by SFSxOI
Yes! thats exactly what I mean - reverse compilation (or would it be de-compilation?). Just thought i'd ask. Thanks folks
traumatic wrote:You mean like a reverse compilation? "ASM-to-PureBasic"? No.
I also doubt it would make much sense (but that's just me).
The /COMMENTED switch was introduced to let the programmer
manualy optimize the generated ASM code (and - as a positive
side effect - to be able to learn from the code).
Posted: Tue May 09, 2006 8:27 pm
by Trond
thefool wrote:If you mean to dissasemble an exe and get runnable fasm output, no thats not possible.
That should be possible, but you won't be able to convert that back to PB code.