QLiberator decompiler

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

Re: QLiberator decompiler

Postby EmmBee » Wed Jan 15, 2020 8:36 pm

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
Gold Card
Posts: 446
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Postby RalfR » Wed Jan 15, 2020 8:42 pm

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


User avatar
RalfR
Gold Card
Posts: 446
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Postby RalfR » Wed Jan 15, 2020 8:48 pm

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.


Martin_Head
Super Gold Card
Posts: 530
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Postby Martin_Head » Thu Jan 16, 2020 10:11 am

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
Gold Card
Posts: 446
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Postby RalfR » Fri Jan 17, 2020 6:51 am

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.


Martin_Head
Super Gold Card
Posts: 530
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Postby Martin_Head » Fri Jan 17, 2020 2:11 pm

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 29 times
DeLibTechNotes.pdf
(52.49 KiB) Downloaded 38 times
DeLibManual.pdf
(126.49 KiB) Downloaded 38 times
DeLibKeys.pdf
(28.21 KiB) Downloaded 31 times
DeLib_bas.zip
(17.38 KiB) Downloaded 37 times


User avatar
RalfR
Gold Card
Posts: 446
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Postby RalfR » Fri Jan 17, 2020 2:30 pm

Thanks a lot for that, Martin!


EmmBee
Trump Card
Posts: 187
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: QLiberator decompiler

Postby EmmBee » Sat Jan 18, 2020 10:53 pm

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
Gold Card
Posts: 446
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Postby RalfR » Sun Jan 19, 2020 9:03 am

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.


Martin_Head
Super Gold Card
Posts: 530
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Postby Martin_Head » Sun Jan 19, 2020 9:39 am

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 22 times
QlibSourceReleaseFiles1.zip
(77.07 KiB) Downloaded 24 times



Who is online

Users browsing this forum: No registered users and 9 guests