QLiberator v3.42

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

QLiberator v3.42

Post by EmmBee »

Here is the latest QLiberator with Per Witte's update to the NEXT_TOKEN m/c routine
Enjoy ...
Qlib_3.42.zip
(98.4 KiB) Downloaded 90 times


User avatar
pjw
QL Wafer Drive
Posts: 1297
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QLiberator v3.42

Post by pjw »

Very nice, EmmBee :) Thank you!

I havent tried it properly yet, so I may get back to you.. ;)

A couple of questions, though, for anyone able to answer:

What is the status of the QLib user toolkits? Are the source code/disassemblies for them available anywhere?
The qlib_bin supplied with V3.4x appears to be a cut-down version of the full toolkit: With the last official release (V3.36) there was also a Qlib_sys with 24 commands, as opposed qlib_bin's 10. Qlib_sys has the text "3.36" in the toolkit code, while qlib_bin has the text "QLIB_obj3.32".

PS: I only use the Qlib_sys (v3.36) toolkit with QLib (and SMSQ/E). So anyone experiencing crashes or other problems (which I havent so far) may wish to try that instead. It can be found with the last official Qlib release, available from Dilwyn's ginormous repository. The latest manual is also available there. Anyone who hasnt looked at the manual for a while may find the latest update enlightening. I know I did.


Per
dont be happy. worry
- ?
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator v3.42

Post by RalfR »

pjw wrote:Are the source code/disassemblies for them available anywhere?
The part of the pointer things are disassembled from MK for me plus a little SB demo prgram.

If there is demand, I can put in here.


4E75 7000
User avatar
pjw
QL Wafer Drive
Posts: 1297
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QLiberator v3.42

Post by pjw »

RalfR wrote:
pjw wrote:Are the source code/disassemblies for them available anywhere?
The part of the pointer things are disassembled from MK for me plus a little SB demo prgram.

If there is demand, I can put in here.
Im not quite sure what you mean, Ralf, but if they are part of Q-Liberator I, for one, am interested.


Per
dont be happy. worry
- ?
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator v3.42

Post by RalfR »

These are QLib's own extensions for moving the pointer and to find the little "loose menu items" (no real ones). Also to display the compiled line number.

Here you can also see the connection with the heap that QLib takes for this at the beginning (seen in EmmBee's QLib_bas and in the detached Demo program here).

These extensions are found in "Qlib6_bin" from EmmBee's ZIP.
Attachments
QLib_exts.zip
(3.51 KiB) Downloaded 65 times


4E75 7000
User avatar
pjw
QL Wafer Drive
Posts: 1297
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QLiberator v3.42

Post by pjw »

Thanks Ralf. Interesting, but not really what Im looking for. I was
hoping for the source code for, or disassembly of, QLib_sys, qlib_bin,
and/or Qlib_run. Thought it might be nice to tidy and/or update those
too.


Per
dont be happy. worry
- ?
User avatar
pjw
QL Wafer Drive
Posts: 1297
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QLiberator v3.42

Post by pjw »

On closer inspection, there is little point to disassembling Qlib_sys
as the toolkit consists of a post-assembly concatenation of all the
other user-side toolkits: Qlib_run, Qlib_ext, Qlib_bin, and Qlib_ovl,
and therefore it can easily be recreated from those components.

My guess is that Qlib_run could be tough to unravel, as thats where
some of Qlib's internal technology lies hidden. But most of the other
toolkits could probably be disassembled in a rainy afternoon.

The question then is What to do with them? One super idea is: Nothing!
Any better?


Per
dont be happy. worry
- ?
Martin_Head
Aurora
Posts: 851
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator v3.42

Post by Martin_Head »

pjw wrote:On closer inspection, there is little point to disassembling Qlib_sys
as the toolkit consists of a post-assembly concatenation of all the
other user-side toolkits: Qlib_run, Qlib_ext, Qlib_bin, and Qlib_ovl,
and therefore it can easily be recreated from those components.

My guess is that Qlib_run could be tough to unravel, as thats where
some of Qlib's internal technology lies hidden. But most of the other
toolkits could probably be disassembled in a rainy afternoon.

The question then is What to do with them? One super idea is: Nothing!
Any better?
Back when I was doing the Qlib decompiler, I started disassembling 'run336mod' to try to work out what SuperBASIC functions it did.

I did not do a lot of work on it. And it's not much more than the original disassembly. But here it is.
run336mod.zip
(59.87 KiB) Downloaded 63 times
Probably of most use will be the table around Lab10620

In the example of key code $2C, Which is LOG10(). It shows you how to work out that it is handled at Lab10A12
I have included a list of what the key code mean in the DelibKeys documents


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

Re: QLiberator v3.42

Post by RalfR »

It would be interesting to see, if QLib with the runtimes do a similar thing than SBASIC.


4E75 7000
User avatar
pjw
QL Wafer Drive
Posts: 1297
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QLiberator v3.42

Post by pjw »

Martin_Head wrote:<>
Back when I was doing the Qlib decompiler, I started disassembling 'run336mod' to try to work out what SuperBASIC functions it did.

I did not do a lot of work on it. And it's not much more than the original disassembly. But here it is.
run336mod.zip
Probably of most use will be the table around Lab10620

In the example of key code $2C, Which is LOG10(). It shows you how to work out that it is handled at Lab10A12
I have included a list of what the key code mean in the DelibKeys documents
Thanks, Martin,

That is very helpful.

While looking into this, it turns out that there have been a number of
patches by different people over the years to both Qlib itself, its
various toolkits, and related utilities. Perhaps it might be a good
idea to consolidate this hodgepodge of patched programs into a new,
clean set, that clearly belongs together?

For starters, Qlib_run - this is the most important Qlib toolkit as it
contains Qlib's runtime library. The latest official version is V3.36.
It, and the previous version, V3.35, contains two bugs. These have
been patched out by Thierry Godefroy. The patched versions are widely
dispersed and usually found as qlib_run335mod and qlib_run336mod.

With the event of SMSQ/E further patches were needed. A collection of
patch utilities, presumably by Tony Tebby, came with early versions of
SMSQ/E. I no longer recall the details, but I found them in a file
called utilities.zip in my SMSQ/E file collection. I tried but couldnt
find them online. Im happy to attach them here unless someone can
point to an obvious place to find them.

Most of Qlib works with SMSQ/E without problems (Tony Tebby clearly
went to a lot of trouble to ensure that!) One of the patchers,
qlib_run_bas, contains the following legend:

"This patch allows QLiberator externals to be used with SBASIC Job 0.
There seems a possibility of having externals work with SBASIC
daughter Jobs but not only does QLiberator (at least up to V3.36)
assume that all Jobs other than Job 0 are compiled, the external
procedures fetch their parameters from Job 0 regardless of the calling
job. This patch tries to correct that."

An earlier(?) version of the patcher described above, qlibrun_bas, does
not appear to deal with SBASIC daughter job externals, but since I
wasnt interested in externals and never used them, I dont know what it
all means.

My point is, that if applying some or all of these patches simply
updates Qlib_run, whilst maintaining backward compatibility, then they
should be applied and the resulting code disassembled and re-
assembled into a new, universal toolkit called, eg Qlib342_run.

This I have now done, and am currently testing it out. Naturally, I'll
share this when it is in a fit state to be shared. I dont intend to offer
a detailed analysis of how everything works, although Ive added back
some of Martin's remarks. Further commentary can be added over time
by different actors as and when the need arises.

The next patcher, qlib_obj_bas from TT says:

"This patch allows QLiberator externals to be used with SBASIC. It
removes the address sensitivity and allows externals to be LRESPRed
from any SBASIC Job (the check for Job 0 is replaced by a check for
'NOT EXECUTED' - (a6).b = $00 or $ff. The patch can be used on
QLIB_OBJ so that all future externals be less fussy, or it can be used
on externals which have already compiled."


I guess this should be of interest to EmmBee: Can he see what the
patch does and just replicate its results in the Q-Liberator source
code? Then its in there for all time and the patcher becomes
redundant, except for updating other programs already compiled.

Watch this space!


Per
dont be happy. worry
- ?
Post Reply