[BBC-Micro] New BASIC bugs

John Kortink kortink at inter.nl.net
Sun Feb 7 13:23:17 GMT 2010

By the way, new BASIC bugs discovered on my recent foray
into HiBASIC 4r32 (well, the major ones) :

1) Present in HiBASIC 4.30/(Hi)BASIC 4r32/BASIC 5 :
inaccuracy in calculations for ^. See below for a fix.
E.g. try 'PRINT 2.11^7.33' (correct answer '238.22668').

2) Present in BASIC 4/HiBASIC '84 : empty indirected
strings are not restored correctly over PROC/FN (i.e.
as formal parameter or LOCAL), but end up as '<first
character of recently assigned value><CR>'.

I added these two to the BeebWiki.

In case anyone wants to fix bug 1 'in situ' in the ROM
image (it is due to an overflow in the FP constant table
cursor), replace :

CLC:.blah ADC #10:DEY:BPL blah:ADC #256-15

with :

SEC:SBC #15+1:.blah ADC #10:DEY:BPL blah

Bug 2 (due to <CR> being placed at offset 1 instead of
0 due to failure to zero Y) is left as an exercise for
the reader (hint : note the glaring suboptimality in
the copy loop).

There are more bugs, especially in DIM, but these seem
rather universally present due to general laxities in
the code. For example, 'DIM Q% &FFFE' does not cause
an error (because of unchecked overflow). Or, any DIM
causing 'DIM space' leaves a half-constructed variable
behind (which can then be accessed as if it was okay).

Most of these bugs (including some major suboptimalities)
are fixed in my 65816 version of 4r32, but I suppose one
could defend not bothering with all the other versions
of BASIC that are around ...

John Kortink


Email    : kortink at inter.nl.net
Homepage : http://www.inter.nl.net/users/J.Kortink

More information about the bbc-micro mailing list