Re: [cc65] Atari stack pointer?

Date view Thread view Subject view

From: Shawn Jefferson (shawnjefferson_at_24fightingchickens.com)
Date: 2003-09-16 01:30:08


On Tue, 16 Sep 2003 00:38:44 +0200, you wrote:

>
>On Mon, Sep 15, 2003 at 03:26:42PM -0700, Shawn Jefferson wrote:
>> How is the atari stack pointer (sp) calculated, I took a look in the
>> source and I can't really figure it out.  Shouldn't it somehow be
>> calculating the end of RAM ?
>                   
>APPMHI is set to MEMTOP. The library constructors may decrease the value in
>APPMHI, if they need more memory. One of the last constructors is initsp,
>which initializes the stack from the value in APPMHI. So sp is set to MEMTOP
>minus "what is needed by the library".

Ok, so MEMTOP is set by the machine, which means that if I do this in
a configuration file:

    RAM: start = $2E00, size = $7BFF, file = %O;    # $7BFF: matches
upper bound $A7FF

and try to reserve the memory above A800 for some stuff, then the
stack is going to be right in the middle of that stuff ?

Should I be avoiding the memory used by the stack, or should the stack
be placed differently (at the end of the RAM from the config file?)

--
Shawn Jefferson

--
Shawn Jefferson
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-09-16 01:32:00 CEST