QLiberator decompiler

Anything QL Software or Programming Related.
EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: QLiberator decompiler

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


User avatar
RalfR
Aurora
Posts: 871
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Post 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 2809 times
Last edited by RalfR on Wed Jan 15, 2020 8:49 pm, edited 1 time in total.


4E75 7000
User avatar
RalfR
Aurora
Posts: 871
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

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


4E75 7000
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Post 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


User avatar
RalfR
Aurora
Posts: 871
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

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


4E75 7000
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Post 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.
Attachments
DeLibDocs.zip
(74.38 KiB) Downloaded 101 times
DeLibTechNotes.pdf
(52.49 KiB) Downloaded 103 times
DeLibManual.pdf
(126.49 KiB) Downloaded 90 times
DeLibKeys.pdf
(28.21 KiB) Downloaded 90 times
DeLib_bas.zip
(17.38 KiB) Downloaded 94 times


User avatar
RalfR
Aurora
Posts: 871
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Post by RalfR »

Thanks a lot for that, Martin!


4E75 7000
EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: QLiberator decompiler

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


User avatar
RalfR
Aurora
Posts: 871
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

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


4E75 7000
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Post 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
Attachments
QlibSourceReleaseImage1.zip
(89.6 KiB) Downloaded 87 times
QlibSourceReleaseFiles1.zip
(77.07 KiB) Downloaded 81 times


Post Reply