Page 3 of 3

Re: How to start a SBASIC from other languages (e. g. C, ASM)

Posted: Wed Apr 15, 2020 6:06 pm
by stevepoole
Hi Norm,
I have simplified the KEYHOLE method : Now I just RESPR(buffer) in my BOOT program, and open a keyhole file to print the base address to.

Then any job can open the RAM keyhole file and input the buffer base address, which it can then use as required... So NoTHING required !

The deQuirked 'waves' now run fine on QPC2 and Qemulator, both as _bas and _task or _job files. They all also work on SGC with SMSQ/E, and SGC QDOS, albeit very slowly with the latter, because of the heavy graphics calculations involved. (Either EXEC or EX are used there).

I could test for inkey$ in the inner loop, which would make keyboard input much faster, and had to write my own PEEK_$ and POKE_$ for QDOS. The advantage with RESPR(), is that you can LRUN anything, without losing the buffer.

The KEYHOLE method is easy to code, as long as you don't overflow the buffer ! (Easy to monitor the string_$ length...). The learning curve is not steep !

Regards,
Steve.

Re: How to start a SBASIC from other languages (e. g. C, ASM)

Posted: Wed Apr 15, 2020 10:21 pm
by NormanDunbar
Even simpler than before Steve, nice work.

Cheers,
Norm.

Re: How to start a SBASIC from other languages (e. g. C, ASM)

Posted: Wed Apr 15, 2020 10:58 pm
by stevepoole
Hi again,

The latest 'waves' program has inkey$ testing within the inner loops, as fast as we can get.

But the Qlib compiled jobs are much too slow under QDOS, because of heavy wave calculations.

What's more, the QDOS task_switching is so slow you have to wait seconds for jobs to switch, before they pass the poked keys !

So no instantaneous keying between QDOS jobs, but OK under SMSQ/E with _bas files.... how very strange.

Maybe someone has the explanation for this ?

Steve.

Re: How to start a SBASIC from other languages (e. g. C, ASM)

Posted: Wed Apr 15, 2020 11:17 pm
by tofro
QLiberated jobs on SMSQ/E run at about the same speed as "native" interpreted SBASIC programs - SBASIC is thus way faster than original SuperBASIC (or, put the other way round, compiling an SBASC program on SMSQ/E doesn't make it any (at least not much) faster).
On the QL with SuperBASIC, however, QLiberated jobs run much faster than the equivalent SuperBASIC program - SUperBASIC is slow. So, when you compare something running in interpreted SBASIC on SMSQ/E on, say, QPC2 to the same program QLiberated on a QL, you're basically comparing the same program running on two machines fith like 100-fold (or more) speed difference. No wonder it looks slow on a QL.....

The reason for the relatively slow job re-schedule is that when QDOS comes under heavy load, it will first slow down timeslicing in the scheduler (it wants to avoid the additional load caused by a task switch if not absolutely necessary). Because you're not using a system call that enters the scheduler for your communication (but rather write to shared memory), the rescheduling is delayed even more.

You can compile your program using the Turbo compiler - should give you considerable speed-up over Liberated programs on the QL.

Tobias

Re: How to start a SBASIC from other languages (e. g. C, ASM)

Posted: Thu Apr 16, 2020 8:01 am
by stevepoole
Hi Tofro,

Thanks. Yes, These wave sub-programs compile OK under Turbo, but there are issues :

With EX, EXEC, EXECUTE or EXECUTE...TO..., the KEYHOLE method does transfer keypresses as usual instantly.

But, only the last task executed dsiplays its screen output... which is not true when the sub-programs_bas are EXed....

The KEYHOLE method will kill executed tasks in any order, but only the last remaining ones show on screen !

This means that the waves program has full backward compatibility, but not in terms of simultaneous screen outputs.

I am beginning to doubt if there is any workaround for this...

Regards, Steve.