[A86] Re: Problem with free mem


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

[A86] Re: Problem with free mem





On Tue, 3 Sep 2002 17:15:17 +0300 =?iso-8859-1?Q?Leif_=C5strand?=
<leif.astrand@multi.fi> writes:
> 
> My problem is that when a program is run from the TI-OS the amount 
> of free ram is recalculated.
> 
> This doesn't happen when an [sqrt] program is run; calling _chkmem =
> returns 0 as free memory, and trying to create a var will give an 
> "error 15 memory" message.=20

What you're seeing is that while at the home screen, the '#' variable (or
is it the '!' variable?) is open for editing, so that all keys can be
inserted fairly quickly.  Any variable open for editing takes all free
memory.

When the enter key is pressed, the variable is closed and then executed,
this is why it works for normal asm progs.  You'll probably have to close
the open var yourself, or replace the contents with the correct sequence
to restart your shell and send a kEnter to the homescreen.

I think your best bet would be to do a context switch.  (ie, load your
own app)  Unfortunately, I don't think there's a lot of info on that, and
I'm in far too great a need of sleep to explain the details atm, and it
might require some annoying changes.  (I think Clem's done some examples
with 'em)  You could try just using _closeEditEqu, but then you'd
probably have to reopen the var before you quit and possibly some other
things.

Or you could do halfway in between:
_PPutAway                        equ            40BDh
_PutAway                         equ            40C1h
    call _PPutAway      ;put away homescreen cx
    call _PutAway
Now you should have free memory, but there's no app context set up, so I
don't think you can just return at this point.  (not sure about exec'ing
basic progs either)  _jForceCmdNoChar should work to exit back to the
homescreen.

I would love to see a shell done as a proper app tho.

-rabidcow




   

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.



Follow-Ups: