Next Previous Contents

## 3. Memory layout

cc65 generated programs with the default setup run with the I/O area and the kernal ROM enabled. Note that this is a non standard memory layout, and that there is no "memory configuration index" for this layout. This means that special care has to be taken when changing the configuration, or calling any code that does this. The memory configuration register at $FF00 should be saved and restored instead of relying on the memory configuration index stored in the zero page.

The setup gives a usable memory range of $1C00 - $BFFF. Having just the kernal ROM mapped in means, that kernal entry points may be called directly, but using the BASIC ROM is not possible without additional code.

Special locations:

Text screen

  The text screen is located at $400 (as in the standard setup).

Stack

  The C runtime stack is located at $CFFF and growing downwards.

Heap

  The C heap is located at the end of the program and grows towards the C runtime stack.

Next Previous Contents