Re: [cc65] Disable KERNAL ROM ?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2013-02-13 15:00:35
Hi,

>> 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

BSOUT:
  pha
  lda #??
  sta $01
  pla
  jsr $FFD2
  pha
  lda #??
  sta $01
  pla
  rts

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
interrupt.

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de 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