Re: [cc65] Global register variables

Date view Thread view Subject view

From: Benjamin Bahnsen (bb_at_game64.de)
Date: 2004-01-24 01:59:16


>   1. Use a numeric address:
>
>         #define c       (*(unsigned char*)0xFF)
>
>   2. Define the variable in an assembler file, declare them as external in
>      your C file, and use #pragma zpsym("name") to import it as zeropage
>      symbol in the generated assembler module.
>

I used the second way you described, because i want to use the variables in
assembler, too. It works perfect, thanks. But i had to rewrite the
memory.cfg to increase the zero page size. The default size was 1ah. I am
not very familar with the kernal functions of the c64 and which zero page
addresses they use. I am wondering, if it is a problem to set the zero page
size to (for example) f0h. I am still able to use file-I/O-functions or the
standard-I/O-functions of CC65? Or do these function use kernal calls, which
change the zero page?

Benjamin


----------------------------------------------------------------------
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 : 2004-01-24 02:00:15 CET