Date : Wed, 02 Feb 2005 19:43:13 +0000 (GMT)
From : "A.Weston" <a.weston2@...>
Subject: Re: ON...
In <URL:news:local.misc> on Mon 31 Jan, Jonathan Graham Harston wrote:
> > Message-ID: <41FCCA24.1000907@...>
> ARM BASIC manages entries in the heap slightly differently. This isn't
> gospel[1], but it's something like this:
>
> When a PROC or FN is called (maybe also for variables), a search is made
> of a table of addresses of the location *in the program* of that call, to
> see if it has been called already. Is much faster to do compares of
> fixed-sized words, than it is for arbitarily-long strings.
>
> This means that program that self-modify the calling name of a procedure
> will not work as expected:
>
> FORa=1TO3:PROCa:NEXT:END
> DEFPROCa:PRINT"A";:?(PAGE+12)=ASC"b":ENDPROC
> DEFPROCb:PRINT"B";:ENDPROC
>
> This will print AAA, not ABB as expected, as on the second and later
> passes of the loop, BASIC V searches the FN/PROC table for the address of
> the PROC in the first line, ignoing it's actual name.
>
Is PAGE+12 where the 'b' of DEF PROCb is stored?
Is the FN/PROC table stored below PAGE on BASIC V and is there any
reference on what BASIC V uses below PAGE workspace for and how?
A.Weston
--
Staffordshire, UK of GB&NI.