<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 31 Oct 2004 14:24:31 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: Re: Dimensioned area space

> > > However if I type:
> > > DIM A%-1
> > > P.A%-TOP
> > > DIM GH% 0
> > > P.A%-TOP
> > > I get '10'
> > > where is the memory going?
> >
> > The variable GH% has to be created, whereas the variable G% is already
> > allocated space.
 
DIM GH% 0 will use memory in the heap as follows:
 
old VARTOP+0 'H'
old VARTOP+1 '%'
old VARTOP+2 &00
old VARTOP+3 link address low
old VARTOP+4 link address high
old VARTOP+5 byte 1 of value of 'GH%'
old VARTOP+6 byte 2 of value of 'GH%'
old VARTOP+7 byte 3 of value of 'GH%'
old VARTOP+8 byte 4 of value of 'GH%'
old VARTOP+9 first byte of reserved memory, GH% points to here
old VARTOP+10 new VARTOP
 
Which shows how 10 bytes of heap are used. So, incidently,
in 8-bit BASIC GH%!-4 will equal GH%.
 
(32-bit BASIC pads the address of the link address to a word
address, has a 32-bit link address, ensures the reserved
memory starts on a word address, and pads the new VARTOP to
the next word address.)
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
Badly formed email is deleted unseen as spam
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>