A83: Re: _insertmem (2) [83]


[Prev][Next][Index][Thread]

A83: Re: _insertmem (2) [83]




More or less you're right.  There are just a couple of clarifications that
could be made.
"If there is a variable already at the pointer, it starts shuffeling the
variables till there is enough room there"
...I wouldn't call it "shuffling" around.  The RAM space is not like the 83
Plus archive space.  All variables are stored sequentially in memory
starting at $9D95 (or $9327 on the 83); there are no holes.  When you insert
memory, it doesn't have to rearrange the order of variables or anything, it
just lddr's all the RAM data after the insertion point (and before the
floating point stack) forward a certain amount.  Also note that it doesn't
do any initialization of the data it moves, it literally just runs a single
lddr.

One other note about organization of variables in memory.  They're all
located starting at $9D95/$9327 *only* when no edit buffers are open, and no
assembly programs are loaded.  On the homescreen (or when editing a BASIC
program) all available memory is allocated (InsertMem'ed) into the beginning
of RAM ($9D95/$9327).  In these cases, variable data will start after this.
When assembly programs are running, it's the same idea (except only some of
the available memory is allocated, not all of it).

Moral of the story: Don't try to InsertMem while an edit buffer is open.

"then the VAT and a sort of table where the free/used memory is noted are
updated."
...The VAT is updated with new data locations for variables that were
shifted forwards.  What you should be aware of, however, is that InsertMem
does not update the size bytes of the variable you are inserting into.  You
must do this manually.


-Dan Englender

----- Original Message -----
From: "Henk Poley" <HPoley@DDS.nl>
To: <assembly-83@lists.ticalc.org>
Sent: Wednesday, November 01, 2000 1:42 PM
Subject: A83: _insertmem (2) [83]


>
> Now I know how to invoke _insertmem (and _deletemem)...
>
> But what does it 'exactly' do? What I think it does:
>
> If there is a variable already at the pointer, it starts shuffeling the
> variables till there is enough room there, then the VAT and a sort of
table
> where the free/used memory is noted are updated.
> Can somebody prove my right or wrong?
>




References: