Re: [cc65] Stack location question

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-08-07 23:11:54
Hi!

On Sat, Aug 07, 2010 at 10:21:44PM +0300, Karri Kaksonen wrote:
> In the old version I assumed that the segment RAM should be made
> larger by __STACKSIZE__ as the crt0.s would set the stack pointer to
> top of the RAM segment.

This is still true, at least for the other platforms.

> Another way would be to define __STACKSTART__ and __STACKSIZE__ to
> allow the programmer to place the stack somewhere.
>
> What is the intended way of doing this?

Since every platform is different, it is the job of the startup code to set
the stack in a way that works on the platform. When compiled with stack checks
enabled, the compiler will insert a call to a check routine into each function
entry code. This check routine compares the actual stack pointer value against
the intial stack minus __STACKSIZE__ as defined in the linker config.

So anything is ok as it is.

> PS. Uz, thanks for the tgi-comments. Now I have my code running again.

Glad to hear that. I feared it was something more serious.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Aug 7 23:12:00 2010

This archive was generated by hypermail 2.1.8 : 2010-08-07 23:12:04 CEST