[cc65] Zero page, C stack, and interrupts

From: Steve Davison <64subnet1gmail.com>
Date: 2010-04-25 16:21:11
Hey guys,

I'm starting my first project using the cc65 suite.  I've
figured out a lot on my own, but I think it's time to get some
help.

My program needs to co-exists with the ROM OS, and with BASIC
programs.  On the surface, this seems like a very Unnatural
Thing for cc65, requiring that I swap the cc65 ZP area every
time I transition into or out of cc65 code.  Also, it looks like
calling into any library code from an ISR would require separate
parameter stacks as well (except for maybe single-param fastcall
functions).

I haven't found any information on choosing a good location for
ZP.  It seems to be arbitrary?  Then if a kernal call is made
(for example, cbm_load), wouldn't the cc65 runtime vars corrupt
the Kernal's data area, and vice versa.  I tried to see what
cbm_load might do to deal with it, but I can't find where
cbm_k_load is defined.  (It's declared in cbm.h, and called by
cbm_load, but from there it falls off the radar.)

I guess that's what I really need to get nailed down first: how
do cc65 and the kernal coexist?

Thanks for any help!
// Steve
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Apr 25 16:21:15 2010

This archive was generated by hypermail 2.1.8 : 2010-04-25 16:21:18 CEST