Re: [cc65] Strange problem

Date view Thread view Subject view

From: Christian Groessler (
Date: 2002-07-18 17:30:30

On 07/18/2002 12:50:00 PM ZE2 Ullrich von Bassewitz wrote:

> On Wed, Jul 17, 2002 at 02:51:28PM -0700, Shawn Jefferson wrote:

> > 3. Anybody know the general layout of memory with a cc65 program on the
> > Atari?  I wonder if I am running low on memory or something...

> For platforms with fixed upper memory bounds, the linker will check that the
> program does not use too much memory. In case of the Atari, the linker config
> specifies a maximum value which may be decreased at runtime depending on the
> graphics mode your program uses (Christian will probably be able to explain
> that in more detail), so memory consumption may not be checked by the linker
> (at least not exactly). It may be helpful to generate a map file (specify
> "--mapfile name" on the linker command line) and have a look at it.

Since the ROM routines use the memory needed for different graphics
modes from the top of free ram, the Atari cc65 startup code needs to
know which graphics modes will be used, so it can adjust the stack
pointer accordingly (the cc65 stack grows downwards from top of ram).

One can tell cc65 which grahics mode is used by defining a variable

char _graphmode_used = <whatever>;

somewhere in your program. The graphics mode numbers are the same as
in BASIC. The default value is 9, (one of) the largest mode(s). If
your program uses the text display only, set it to 0 to get some more
ram (about 7k).


To unsubscribe from the list send mail to 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 : 2002-07-18 17:31:42 CEST