Re: [cc65] Changes in Interrupt Handling

From: Oliver Schmidt <>
Date: 2013-02-14 17:16:03
Hi Greg,

First all thanks for taking the time to review the change :-)

> 1) The actors' priorities are wrong.  They should be the same as they were
> when the code was in the start-up module:  "irq_init" should run _before_
> all other actors; and, "irq_done" should run _after_ all other actors. That
> order will guarantee that the IRQ trap will handle any IRQs that any other
> constructors create.  So -- "irq_init" could be set at 32, at least. And,
> "irq_done" should be set at 1.

That was my original intention too. However Uz explicitly asked me to
do it differently: Choosing a medium prio allowing each constructor /
destructor to choose if it wants to be executed before/after
hooking/unhooking the interrupts.

I roughly looked through the existing constructors / destructors for
dependencies on interrupts but didn't find any.

> 2)  In many cases, "initirq" can load the new interrupt pointer into the .XA
> pseudo-register, then jump into "doneirq".  That second subroutine can
> disable interrupts, store the pointer, and re-enable interrupts -- for both
> subroutines.

I see. Thanks for pointing out.

> P.S., I recommend that you create a macro that generates those Apple2
> byte-table text messages.  It would be similar to the CBM and Atari
> "scrcode" macroes.  It would reverse the text; and, set the high bit.

I personally dislike macros for purposes like this. I use macros only
for re-use purposes, which I don't see here.

> P.P.S., Does "libsrc/apple2/irq.s" really need to .include ""?

Nope, actually not. I'll remove it.

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Feb 14 17:16:27 2013

This archive was generated by hypermail 2.1.8 : 2013-02-14 17:16:30 CET