[cc65] Changes in Interrupt Handling

From: Oliver Schmidt <ol.sc1web.de>
Date: 2013-02-13 13:36:34
Hi,

This is to inform you about changes in cc65 interrupt handling applied recently.

Up to now it was the responsibility of the target-specific startup
code to hook and unhook a cc65 interrupt handler which calls the
function 'callirq' which in turn calls the interruptors defined.

In the (quite usual) case of no interruptors defined at all there was
no interrupt handler hooked. While this avoided the CPU overhead there
was still the RAM overhead for the code mentioned above.

But now the interruptors import a symbol (a new feature added by Uz
for this purpose: http://www.cc65.org/snapshot-doc/ld65-5.html#ss5.9)
which is exported by 'callirq'. And 'callirq' in turn defines a
constructor and destructor. The symbols for those are aliased to
target-specific code that hooks the cc65 interrupt handler in the
constructor and unhooks it in the destructor.

The benefit of this new approach is that the startup code for most
targets is now totally free of interrupt handling code (and the call
to 'callirq'). Thus there's no RAM overhead at all for programs
without any interruptors.

I.e. C64 programs without interruptors (which is very common) are now
nearly 120 bytes smaller - both on disk and in memory :-)

I implemented this change for (almost) all targets but tested it only
Apple2, C64 and C128. So if you are familiar with the startup code of
a certain target it would be great if you could check if I didn't
break anything (the new constructors/destructors are implemented in
'irq.s' files in the target directories).

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 13:36:47 2013

This archive was generated by hypermail 2.1.8 : 2013-02-13 13:36:51 CET