Hi Marcel,

On 10 April 2017 at 00:28, Marcel Kilgus <ql-us...@mail.kilgus.net> wrote:

> Wolf wrote:
> > Marcel has done it again - SMSQE 3.31 is out now.
> >
> > Marcel has fixed the LRESPR bug. LRESPRing sbasic extensions in a
> > procedure no longer crashes the machine.
> Thank you Wolfgang. I have actually written down part of the journey
> in fixing this bug, so if this sort of technical thing interests you,
> here it is:
> https://www.kilgus.net/2017/04/10/sbasic-bug-boogie/
> It includes a rough description of how SBasic works internally, partly
> so I can read it myself if I ever need it again. The rest I still
> consider pure Voodoo ;-)

I've been doing a lot of disassembling on the original QL ROM but
understanding the SuperBASIC parser was a bridge too far for me, so I found
it a very interesting read. It raises one question though - is SBASIC an
interpreter or a real-time compiler?

I'm still working on BASICODE and hit upon another 'feature' which works
differently in SBASIC: the vector at $138 can be used to LIST a number of
lines (from D4 to D6), but in the original ROMs and Minerva it can also be
used to execute a DLINE when called with D7<>0 (I believe the TK2 ED
command makes extensive use of this). However in SBASIC the DLINE feature
doesn't work, and from examining the code I could deduce that D7 isn't
being tested at all!

I discovered this when I testing my BCLOAD extension which should delete
all lines from 1000 to the end and then read in a BASICODE program,
translating it to S*BASIC on the fly so it heavily depends on the S*BASIC
vectors. On JM/JS/Minerva it worked as expected but in SBASIC it actually
merged the old and new programs! It looks like I have to write this code
myself now (which is not too difficult as it's merely scanning the program
for line 1000 and then set BV.PFP to the end of the line just before it).

regards, Jan.

*Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net
QL-Users Mailing List

Reply via email to