Date : Mon, 17 Jul 2006 13:01:05 +0100 (BST)
From : Steve Fewell <kranser@...>
Subject: Re: BBC BASIC bugs - DIM statement (heap crash into Stack)
--- Steve Fewell <kranser@...> wrote:
> Can anyone give an example of the DIM command that
> caused the BASIC heap to crash into the Stack
> because
> it wasn't checked correctly in BASIC 4 (and BASIC
> 2)?
>
I have found the following example which causes BASIC
4 to forget line numbers!:
>L.
10 DIM K(1582,127)
20 FOR I% =1 TO1582
30 FOR J%=1TO127
40 K(I%,J%)=56.77777
50 NEXT J%
60 NEXT I%
>RUN
Array at line 40
>L.
0 DIM K(1582,127)
0 FOR I% =1 TO1582
0 FOR J%=1TO127
0 K(I%,J%)=56.77777
0 NEXT J%
0 NEXT I%
>
The DIM statement is allowed (but it shouldn't be
because it would have 200914 elements - the maximum is
65535 (&FFFF)).
I don't know what causes BASIC to forget the line
numbers though. <BREAK> gives a * prompt instead of a
language, and <CTRL>+<BREAK> restarts BASIC, and
typing OLD proves that the program is there (with
correct line numbers!).
By the way, this bug has been fixed in 'BASIC4 r32'
[version 32 of the BASIC IV ROM].
I cannot remember an example of the DIM command that
causes BASIC to hang though (even before trying to
assign anything to the array), can anyone help?
Additionally, I still cannot find the book or manual
that mentioned this bug in BBC BASIC, anyone?
Thanks,
Steve.
___________________________________________________________
Inbox full of spam? Get leading spam protection and 1GB storage with All
New Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html