Re: [cc65] Disable KERNAL ROM ?

From: Oliver Schmidt <>
Date: 2013-02-13 15:00:35

>> Note that by this usage scenario there's no problem with code banking
>> out itself as the thunks
> What are "thunks" in this context?

You're right, the term isn't actually well defined...

I'm thinking of routines like this

  lda #??
  sta $01
  jsr $FFD2
  lda #??
  sta $01

If a certain routine isn't known to not use A, X or Y as parameter
then of course the code can be optimized. The code shown above is the
generic one that preserves "everything" accross the banking.

>> I understand that the C64 would additionally require the setup of an
>> IRQ thunk handler...

> I am not 100% sure if I understand but IRQ and NMI vectors are on the top of KERNAL ROM. If this is banked out at least NMI should be covered but IRQ preferably as well. This can be done by placing appropriate values in the RAM but the values has to be "appropriate" as original ones point to ROM locations.

The vectors in RAM have to point to routines that switch to ROM, call
the original handler, switch back to RAM and return from the

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Feb 13 15:00:54 2013

This archive was generated by hypermail 2.1.8 : 2013-02-13 15:00:57 CET