Page 11 of 18

Re: QLiberator decompiler

Posted: Wed Jan 15, 2020 8:36 pm
by EmmBee
Ralf R. wrote:QLiberator self compiling under QPC also takes 2 seconds. Just by the way ;)
That's a huge speedup, from 2 hours to just 2 seconds, when using Q-emuLator. I imagine Q-emuLator must have been running at QL Speed.
The version number comes from the compiler itself. The first _obj I made, was with the original QLiberator v3.35, then there is "3.35" in the compiled code, if compiled with v3.36, then there is "3.36" in the compiled code.
So where exactly does it appear? In v3.36 I can see 4 different places where these numbers appear.

Re: QLiberator decompiler

Posted: Wed Jan 15, 2020 8:42 pm
by RalfR
EmmBee wrote:
Ralf R. wrote:QLiberator self compiling under QPC also takes 2 seconds. Just by the way ;)
That's a huge speedup, from 2 hours to just 2 seconds, when using Q-emuLator. I imagine Q-emuLator must have been running at QL Speed.
The version number comes from the compiler itself. The first _obj I made, was with the original QLiberator v3.35, then there is "3.35" in the compiled code, if compiled with v3.36, then there is "3.36" in the compiled code.
So where exactly does it appear? In v3.36 I can see 4 different places where these numbers appear.
The number is from the QLib, which has compiled the program. If no runtimes there it is just after the string "Runtimes missing" when viewed the _obj in an editor.

In this case, QLib 3.35 was compiled with QLib 3.34:
version.JPG
version.JPG (35.2 KiB) Viewed 2814 times

Re: QLiberator decompiler

Posted: Wed Jan 15, 2020 8:48 pm
by RalfR
EmmBee wrote:
Ralf R. wrote:QLiberator self compiling under QPC also takes 2 seconds. Just by the way ;)
That's a huge speedup, from 2 hours to just 2 seconds, when using Q-emuLator. I imagine Q-emuLator must have been running at QL Speed.
Just remark, that SBASIC work very different to SuperBASIC in QDOS, it is (i think) a bit like the _obj files, a pre-compiler. Therefor, the speed is nearly identical, if compiled under SBASIC or executed.

Re: QLiberator decompiler

Posted: Thu Jan 16, 2020 10:11 am
by Martin_Head
Ralf R. wrote:If no runtimes there it is just after the string "Runtimes missing" when viewed the _obj in an editor.
I'm pretty sure that the version number is also there when the runtimes are included as well. (I'm not sitting at the right computer to check)

Also that 3.3x version number is just before the start of the compiled SuperBASIC. If you look at that screen dump. If I remember the decompiled QLIB correctly, that 3.35 just above OPEN_NEW, is assigning a string variable to "3.35". And the OPEN_NEW and OPEN_IN are Q_ERR_ON's

Re: QLiberator decompiler

Posted: Fri Jan 17, 2020 6:51 am
by RalfR
Martin_Head wrote:Also that 3.3x version number is just before the start of the compiled SuperBASIC. If you look at that screen dump. If I remember the decompiled QLIB correctly, that 3.35 just above OPEN_NEW, is assigning a string variable to "3.35". And the OPEN_NEW and OPEN_IN are Q_ERR_ON's
Yes, I forgot to mention this.

To be honest, one can't say, that QLIberator is able to compile "itself", compared to Supercharge or Turbo. These compilers always use the loaded Basic program, where QLiberator use a saved (_wrk or _sav) program in tokenised form. I always found that a big advantage. You are able to compile a program, which uses 90% of the QLs memory. Not possible with the other ones.

Re: QLiberator decompiler

Posted: Fri Jan 17, 2020 2:11 pm
by Martin_Head
I finally got around doing the manual for the QLiberator decompiler. So here it is.

DeLib_bas is the program. Developed on QPC2. I think it should run on any SMSQ/E system, but it would need some work to run it in QDOS.

DeLibManual, is instructions for running the program. Plus tips on getting the resultant code to load and run.

DeLibTechNotes, and DeLibKeys, are documents on the program and how the SuperBASIC program is compiled in QLiberator.

The DeLibDocs zip file is the same three documents on .odt file format. The forum did not like the .odt extension.

Re: QLiberator decompiler

Posted: Fri Jan 17, 2020 2:30 pm
by RalfR
Thanks a lot for that, Martin!

Re: QLiberator decompiler

Posted: Sat Jan 18, 2020 10:53 pm
by EmmBee
Martin has sent me his decompilation sources of QLiberator. Thank you, Martin. I have received the same files as he sent Ralf.
I have used the original QLIB_obj to compile and get a massive length of about 66,554 bytes, which is far greater than the 46,190 bytes of Martin's compile.
I've only tried this so far with QPC2, but I plan to try again using Minerva and Q-emuLator.

Re: QLiberator decompiler

Posted: Sun Jan 19, 2020 9:03 am
by RalfR
This makes me wonder, I have got 46,190 with Lines, Names, Winds and Run off, Auto on. The same, as Martin got. Compiled under QPC2. I have tried nearly every combination of these but can't get a result of 66,554.
QLib8_jpg.JPG
BTW: The window MOVE takes place in "procfun34401", if someone wants to investigate, "var0388" is true, if PE is available.

Re: QLiberator decompiler

Posted: Sun Jan 19, 2020 9:39 am
by Martin_Head
I've decided to release the decompiled QLIB_OBJ and QLIB_PATCH_OBJ files.

One zip file is a floppy disk image, and the other, is the files on the floppy image, all zipped up.

The files I have supplied are just what is required for QLIB and QLIB_PATCH. You will need to use the original LIBERATE command in QLiberator to create a _wrk, or a _sav file.

For the couple of people I have already supplied this to, There is an updated QlibPatch_bas file. The only difference is that it is more QDOS friendly.

This is the settings I used when compiling QLIB
Image23.png