Re: [cc65] STACKSIZE - What's the right size?

From: Karri Kaksonen <karri1sipo.fi>
Date: 2009-02-06 00:10:36
steve-cc65 wrote:
>    SYMBOLS {
>        __STACKSIZE__    = $800;        # 2K stack
>    }
>
>    MEMORY {
>        RAM:     start = %S,    size = $BC20 - __STACKSIZE__ - %S, file 
> = %O;


Thank you for this code snippet! I forgot that __STACKSIZE__ has to be 
allocated from the main ram segment. A few months ago I spent hours 
debugging an overwrite because of this. By defining it like you have 
done above it saves a lot of trouble.

I had no idea that the config files had an option %S. This will help me 
a lot!

Is it also possible to calculate segments relative to another segment?

       RAM:              start = %S,    size = $BC20 - __STACKSIZE__ - 
%S, file = %O;
       MUSIC:           start = %S,    size = RAM_START - %S, file = %O;
       GRAPHICS:     start = %S,    size = MUSIC_START - %S, file = %O;

--
Karri

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Feb 6 00:10:52 2009

This archive was generated by hypermail 2.1.8 : 2009-02-06 00:10:54 CET