Re: [cc65] Atari stack pointer?

Date view Thread view Subject view

From: Shawn Jefferson (shawnjefferson_at_24fightingchickens.com)
Date: 2003-09-16 18:04:09


On Tue, 16 Sep 2003 11:30:18 +0200 (CEST), you wrote:

>The values in the config file are the maximum possible values. The startup
>code then tries to adapt to the graphics mode used by the program and to
>the installed memory size. (Original 800s could have anything in 8k steps
>from 8k to 48k, and there are 400 and 600xl with 16k). So the spack
>pointer is determined from the MEMTOP ($2e5) system variable.

Ah, ok.  You are doing it this way to support the various memory
configurations of the Atari computer, and possibly any graphics modes
in operation or cartridges (that would have changed MEMTOP.)

>There is currently no easy way to reserve memory from use by cc65, short
>of setting MEMTOP to a lower value before running the program. Or bumping
>up the load address and use low memory.

This may be a better option.  I didn't think about it, but the way my
application is coded now it will only work on an XL/XE with 64k of
RAM, although this isn't as much of a problem as it may seem I
think...

>What do you want to do with the memory? Maybe a malloc() could work too?

I'm wanting to reserve various parts of memory like this:

 * Memory map:
 *
 * BFFF +----------
 *      | pmeditor dlist (78 bytes) 
 * BDB8 +----------
 *      | options bitmap (336 bytes)
 * BC68 +----------
 *      | status bitmap (40 bytes)
 * BC40 +----------
 *      | gr.0 dlist
 * BC20 +----------
 *      | grid bitmap (2560 bytes)
 * B220 +----------
 *      | pmarea (2048 bytes)
 * AA00 +----------
 *      | code/data
 * 2E00 +----------

So I guess what is happening is that the stack is right in the middle
of my grid bitmap.  Maybe I can move it lower down in memory. (How
much memory can the stack take up?)

I wanted to just assign pointers instead of using malloc since malloc
is expensive.  I thought that changing the config file would make cc65
only use the amount of RAM that I told it I had and leave the rest
alone.  That isn't the case.

I guess this problem comes down to whether or not you want the system
to automatically size to a different graphics mode or memory
configuration, or let the programmer set all that up via the config
file.  It would be nice to have some docs for each platform's
idiosyncracies wouldn't it?

--
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 18:06:03 CEST