This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to manually map c64+ interrupt service routines

I know that DSP/BIOS has a handy interrupt dispatcher, but I was wondering how to manually map interrupt service routines (c or assembly) in the c64+ families.  In SPRU732, it appears that there is an interrupt service table that could contain jump vectors or maybe even an entire ISR if it was small enough.  How do I get access to this space with the compiler/linker to accomplish this?

  • Assuming you mean to operate without using BIOS to manage interrupts at all I would certainly advise against this, particularly in the DM6437 case, it is just so much easier to just let BIOS handle it and I am not sure if the software collateral is out there to easily do this with the DM6437, you may have to either make the interrupt table yourself (typically in assembly or mixed code) or bring this in from a much older processor.

    I would start with section 5.1.2 (or chapter 5 in general) of SPRU732 to get a better understanding of what is happening underneath the BIOS GUI and APIs, this roughly explains what needs to happen to use interrupts on a C6x CPU and gives the details on the table you mention (you probably read this already but I wanted to point it out anyway). What you end up doing is making the table described in 5.1.2 in a code file, typically a small assembly file, such that you can lay out the spacing of the instructions in it to match what the interrupt hardware will be expecting and map it to a space that you can later point the interrupt hardware to (via the ISTP register), you would put code in the table to branch to the ISR code you want to execute. If the ISR code is in C than you will want to use the interrupt keyword so that the compiler can put in state save and restore code around the function.

    If you mean to continue to use BIOS for interrupt management and you just want to manually plug in ISRs into the BIOS managed table than you can do so with some simple BIOS APIs, in particular you could use C64_plug for direct interrupt service table modifications or HWI_dispatchPlug to put entries into the dispatcher table, both of these are discussed in the DSP/BIOS API Guide.