PTR_GEN source code available?

Anything QL Software or Programming Related.
prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

Re: PTR_GEN source code available?

Post by prime »

tofro wrote:That's interesting.
I have used the following line to include the QLIB extension code (as per the manual on Dilwyn's site, have mislaid my own, like a lot of other things QL....)

Code: Select all

105 REMark $$asmb=win1_ql_qlib_ext,0,10
Does anyone know what might be wrong with that line?

Or could it be your browser picked the binary from some cache? No idea.
I tried downloading again using Chrome (I normally use Firefox), same result.

Just so people know I'm working on QPC 4.02, SMSQ/E 3.19 booting from the standard demo win file I commented out the welcome sound and loading up the help file in the editor but boot is otherwise unchanged.

I unpacked the downloaded zip file to ram1_ :

data_use ram1_
ex win1_progs_utils_unzip;dos1_software_make_obj.zip
ex ram1_make_obj

So I dunno what if anything I'm doing wrong....

Cheers.

Phill.


User avatar
tofro
Font of All Knowledge
Posts: 3090
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: PTR_GEN source code available?

Post by tofro »

Phill,
you're not doing anything wrong. I am, apparently (but I don't know what.....)

I have now changed my BOOT file to not LRESPR qlib_ext and get the same results you see.

Apparently, the $$asmb directive given in the Manual for including QLIB_EXT is wrong or at least wrong for my version of QLIB.

Will try and find a solution.
Any hints from anyone? QLIB is not exactly my home turf.

Regards,
Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 3060
Joined: Wed Dec 01, 2010 10:39 pm

Re: PTR_GEN source code available?

Post by dilwyn »

tofro wrote:That's interesting.
I have used the following line to include the QLIB extension code (as per the manual on Dilwyn's site, have mislaid my own, like a lot of other things QL....)

Code: Select all

105 REMark $$asmb=win1_ql_qlib_ext,0,10
Does anyone know what might be wrong with that line?

Or could it be your browser picked the binary from some cache? No idea.

Tobias
I use QLiberator 3.36 to compile my programs and that version seems to need $$asmb=win1_ql_qlib_ext,0,12

The first number (0) is address of initialisation routine, no offset required for qlib_ext as it's at the start of the code.
The second number is extensions table address. This is usually 10 or 12, if it uses code like my example below, depending on whether the link-in routine ends with JMP bp.init (in which case 10) or JSR bp.init : RTS (in which case 12).

You can usually see by disassembling the first 10 or 12 bytes whichis needed, it will look like this:

Code: Select all

* $$amb...,0,10
lea exts,a1    ; point to list of extensions
move.w $110,a2 ; bp.init vector
jmp (a2)       ; link extensions+retrun to BASIC
* table defining extension here
exts
or

Code: Select all

* $$amb...,0,12
lea exts,a1    ; point to list of extensions
move.w $110,a2 ; bp.init vector
jsr (a2)       ; link extensions
rts            ; back to BASIC
* table defining extension here
exts
The other possible issue may be that IIRC the $$asmb statements can be case sensitive in some versions of QLiberator, although I can't recall ATM if this just referred to the asmb letters or the filename, i.e. QLiberator may not see $$asmb=win1_ql_qlib_ext,0,12 as being the same as $$ASMB=WIN1_QL_QLIB_EXT,0,12

However. from what I can see by far the likeliest is that you have a version of QLiberator which prefers ...0,12 (rather than ...0,10) for the version of extensions you are using. Disassembling the first 12 bytes would tell you for certain.

As an interesting aside, most programmers of BASIC extensions put the table of extension names and offsets just after the initialisation code. Some DIY toolkit extensions have the table further into the code, then it becomes a bit more of a challenge what to put instead of 10 or 12! I think this arose when programmers of BASIC extensions used Turbo instead of QLib, before George adapted Turbo to allow linked extensions. So the offset was never an issue until you tried to link them to a program with QLib or a George Gwilt version of Turbo!

And a 13K or so difference in file size MAY indicate whether or not the compiler runtimes have been linked into the program or not (i.e. length of QLIB_RUN).


User avatar
tofro
Font of All Knowledge
Posts: 3090
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: PTR_GEN source code available?

Post by tofro »

Thanks Dilwyn, that apparently worked!
Attachments
make.zip
Now with $$asmb,...,0,12
(24.35 KiB) Downloaded 143 times


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

Re: PTR_GEN source code available?

Post by prime »

Thanks guys that seems to be working files being assembled right now :)

Phill.


User avatar
ppe
Trump Card
Posts: 171
Joined: Tue Dec 14, 2010 10:48 am
Location: Espoo, Finland

Re: PTR_GEN source code available?

Post by ppe »

Many thanks to everybody for help! I was also able to compile SMSQ/E on QPC II with the new make binary.

Cheers,
Petri


Post Reply