Re: [cc65] Global register variables

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2004-01-24 10:44:37


Hi!

On Sat, Jan 24, 2004 at 01:59:16AM +0100, Benjamin Bahnsen wrote:
> 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?

You cannot just increase the zero page size in the memory configuration. While
this works as far as the linker is concerned, you will 

  - overwrite the current contents of these variables (something the kernal 
    will not like), and

  - since the runtime communicates with the kernal via these variables, you
    may break runtime routines.

As a general rule, you cannot use memory that you don't own (at least not
without some precautions). This is a common rule when coding in assembler, and
it is also true when coding in C.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
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 10:45:04 CET