QD SBASIC Parser Thing

Anything QL Software or Programming Related.
Tinyfpga
ROM Dongle
Posts: 10
Joined: Thu Sep 27, 2018 1:59 am

Re: QD SBASIC Parser Thing

Postby Tinyfpga » Sun May 24, 2020 7:07 pm

Some time ago I bought a number of Q68s from Mr Stewart's second batch. I have spent what little spare time I have to configure
a user interface suitable for learning to write SBASIC programs. To do this, I have downloaded close to 2000 pages of instuctions from
the dilwyn.me website and various others.

I am not a software writer but am enjoying the struggle to understand the instruction manuals that I have downloaded.
The development environment I am using comes from SMS2. I use it because it forces one to develop windowing programs as standard and is,
in my opinion, easier to use.

The main difference between SMS2 and SMSQE is the inclusion of a BASIC interpreter as a user interface in SMSQE. This was added to satisfy
QL users. SMS2 was provided with an independant BASIC parser which is not included with SMSQE. The main advantage of the SMS2 parser
is being able to run an application whilst editing its code simultaneously. Amazingly the SMS2 parser seems to work well in SMSQE.

As an unskilled software writer I have found the SMS2 parser invaluable. Most of the time my code does not run, or is faulty or makes no sense.
I have been able to use some crude techniques to step through my code whilst looking at the results in an other window.

All the test programs I have written (over 100 so far) run in fixed or movable windows. I found it much harder to debug moveable
window programs but finally got to grips with the concepts with the help of some articles pulished in QL Today by Monsieur Lenerz.

(Note to M.Lenerz. Although hard to understand your articles helped me with to write QPTR code. So thank you for your hard work)

Although I have been fiddling around with my Q68s, on and off, for a year I still have much to learn. Part of the problem is that most of the
documentation and sample code is written as if one is going use the SMSQE interpreter. It has taken some time for me to understand what needs
to be done to write code without line numbers such that the code can be compiled without line numbers.

Having to eliminate the use of the RESTORE instruction is example of this. It took me a few hours and many tests to eliminate this instruction
from sample QPTR code I found, where it was widely used. Once I understood what it did, I found it entirely unnecessary.

Finally, whilst reading the Q_Liberator manual I notice that a TRACE option was added to the compiler and that this would allow code to be single
stepped. Now that Q_Liberator exists as source code might it not be possible to add this facility?


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

Re: QD SBASIC Parser Thing

Postby EmmBee » Mon May 25, 2020 8:12 am

Tinyfpga wrote:Finally, whilst reading the Q_Liberator manual I notice that a TRACE option was added to the compiler and that this would allow code to be single stepped. Now that Q_Liberator exists as source code might it not be possible to add this facility?

There is already a trace mode with Minerva. This has the commands TRON TROFF and SSTEP, which allow turning on and off the trace mode. SSTEP allows single-stepping of the code. This is an excellent way to learn how the code works. Minerva is available with QemuLator - freeware - See here ... http://www.terdina.net/ql/q-emulator.html

There is also SuperTrace which additionally displays the line being executed. See here ... http://www.dilwyn.me.uk/program/strace.zip

About Q_Liberator, in theory, a trace mode could be added but would require someone with a detailed knowledge of how to implement this. It would need to be done on the machine code side.



Who is online

Users browsing this forum: Google [Bot] and 2 guests