<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 17 Jul 2006 12:59:41 +0100 (BST)
From   : Steve Fewell <kranser@...>
Subject: Re: BBC BASIC bugs - DIM statement (heap crash into Stack)

[Resent message as first doesn't seem to have come
through]

--- 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.






               
____________________________________________________ 
 
Yahoo! Photos is now offering a quality print service from just 7p a photo.
http://uk.photos.yahoo.com
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>