Re: [cc65] char-copy and interrupts (C64)

Date view Thread view Subject view

From: Spiro Trikaliotis (
Date: 2003-03-14 12:08:58


MagerValp wrote:

> TS> My question is: which is the best method to do this
> TS> interrupt-thing in CC65? Should i use inline-assembler or the
> TS> POKE-sequence above (which disables the CIA-timer)?
> Either way works. SEI/CLI makes for shorter code though, and at least
> I think that's more readable.

SEI/CLI is not more readable, it is also more reliable!

Think of the possibility that another interrupt source might
be active (for example, someone is using the raster IRQ). The BASIC
way does not disable that IRQ, so you have a chance of crashing your

The only possibility to crash your machine (well, the only with respect
to sporadic interrupts, I mean) is that something generates an NMI while
you're inside of your copying. This could be from CIA2 or from someone
pressing the RESTORE key. If you want to be sure this does not happen,
overwrite the NMI vector in RAM and let it point to another routine of
your choice (for example, to a byte just containing the IRET).


To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-03-14 12:20:47 CET