Re: Compiling a SuperBasic program
Posted: Thu Jan 02, 2025 3:53 pm
It would have to pack the BASIC code together with any toolkits as a single unit. Just a probably stupid idea from me.
RIP Sir Clive Sinclair 1940 - 2021
https://theqlforum.com/
It would have to pack the BASIC code together with any toolkits as a single unit. Just a probably stupid idea from me.
Not at all stupid. It would be worth investigating how that might be done.Peter wrote: Thu Jan 02, 2025 3:53 pmIt would have to pack the BASIC code together with any toolkits as a single unit. Just a probably stupid idea from me.
No way, Derek. That just shows your lack of understanding of the issue. Making it open source would just increase support requests I can't handle. You must know how long it is since I last released any major program. Writing QL software is what I like to do, I just don't get time to do so nowadays.Derek_Stewart wrote: Thu Jan 02, 2025 2:35 pmWhy not make Q-Dock open source, maybe there other people how can help.
Right. But if true, such a scheme could still cause trouble with larger memory models. Perhaps I misremembered about the whole top byte being used as that would limit programs to run in no more than 16Mb of memory. Perhaps it was only a few bits. The nub of it, as I understood it, was that if the wiring to the complete address space was limited the CPU would simply ignore those bits and they could thus be used for other purposes.Peter wrote: Thu Jan 02, 2025 3:28 pm <>I'd say no, because the programs work fine, if data writes always go to external memory instead of being cached.pjw wrote: Thu Jan 02, 2025 2:26 pm I once overheard a discussion at some QL event about Qliberator using the upper byte of some addresses to store flags or codes, leaving only 24 bits
for addressing. I wasnt paying it much attention at the time, so I dont know any details. Could that have something to do with it?
(My emphasis.) Could there be a similar problem with Q_Liberator code?TurboPatch is a small utility to patch programs compiled with the last
official version of the Turbo SuperBASIC compiler. It alters the EXECutable
file by adding a public domain patch to the program which modifies the Turbo
startup code; this code was written by Davide Santachiara and later improved
by Mark Swift. Mark's additions include code to flush the data cache and
invalidate the instruction cache on later processors like the 68040 and
68060; without Mark's improvements Davide's code didn't work on these
processors.
I guess I may have mixed up Turbo and Qlib, or perhaps both have/had the sameIn addition Mark Swift provided some code used in TurboPatch that makes
patched programs 32-bit clean; without this Turbo compiled programs are only
24-bit clean and may not work on the latest hardware. Most old QL and
compatible systems had 24-bit addresses wrapping around ad infinitum
throughout memory, but the Q40 and some others now available use true 32-bit
addresses. After patching with TurboPatch programs will work on these new
systems.
Even DP were at it! Wouldve thunk they knew better!The startup code in Turbo makes an assumption in two places about where the
system variables are, and accesses them directly, which stops programs
working in Minerva two-screen mode. The patch makes the program check (using
the correct operating system trap) where the system variables actually are
before reading or altering them. Potentially this makes the Turbo compiled
program work on other systems that do or may in future put their system
variables at a different place from the normal location on a QL.
Poor you, Dilwyn, but with the title here of Mr QL, what do you expect! youre a celebrity, man!dilwyn wrote: Thu Jan 02, 2025 4:11 pmNo way, Derek. That just shows your lack of understanding of the issue. Making it open source would just increase <>Derek_Stewart wrote: Thu Jan 02, 2025 2:35 pmWhy not make Q-Dock open source, maybe there other people how can help.
Yes, likely. That is exactly the self-modifying code issue I suspect. Unfortunately for QLiberator is does not only seem to affect initial startup, but also later runtime (which is not 100% sure as it might be project specific).pjw wrote: Thu Jan 02, 2025 5:13 pm(My emphasis.) Could there be a similar problem with Q_Liberator code?Mark's additions include code to flush the data cache and invalidate the instruction cache on later processors like the 68040 and
68060; without Mark's improvements Davide's code didn't work on these processors.
Not knowing it, is that the reason, why QLib programs run without problems with a 68030 and Caches on?