Re: [cc65] Zeropage and cc65

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-08-03 17:59:18
On Tue, Aug 03, 2010 at 02:17:58PM +0200, Carlos wrote:
> I know what ZP is, first of all don't understand why in the cc65 default
> configuration file for c64 the ZP is defined as:
> ZP:  start = $0002, size = $001A, type = rw, define = yes;

You are mixing two things that are somewhat related but not identical: 

  1. The "zeropage" as a concept of the 6502 CPU.

  2. A memory area called "ZP".

As a matter of coincidence, the memory area called ZP is located in the
zeropage of the 6502. But that's all about it.

[sp, sreg, regsave, regbank, tmp1, ptr1, ptr2]
> Can these symbols be freely used in any own asm module? (for instance to
> store temp values, ...) and are completely 'safe' for use for my own purposes
> without risking a crash?

As a general rule: No. Some of them may be used, others may not be used, and
some may be used with special precautions.

> Have each symbol a special function according to its name? Can i change
> symbol names and/or add new ZP symbols?

You cannot change the names of these symbols, since they're used by the
runtime and by code generated by the compiler. You can add your own zeropage
variables. The libraries for the CBM610, CBM510 or the Lynx do this, so please
have a look at them.

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 Tue Aug 3 17:59:27 2010

This archive was generated by hypermail 2.1.8 : 2010-08-03 17:59:30 CEST