ASM - PB code - and /COMMENTED switch

Everything else that doesn't fall into one of the other PB categories.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

ASM - PB code - and /COMMENTED switch

Post 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?
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
@}--`--,-- A rose by any other name ..
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: ASM - PB code - and /COMMENTED switch

Post 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).
Good programmers don't comment their code. It was hard to write, should be hard to read.
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post 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
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: ASM - PB code - and /COMMENTED switch

Post 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).
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
Post Reply