Aw: Re: [stella] Why do we use the SEI instruction???

Subject: Aw: Re: [stella] Why do we use the SEI instruction???
From: cybergoth@xxxxxxxx
Date: Mon, 4 Aug 2003 17:53:00 +0200 (CEST)
Hi there!

> Although the 6507 doesn't have NMI or IRQ pins, it's good programming
> practice to have those vectors point somewhere, either the same as RESET or
> an RTI instruction. (And to include an SEI instruction in your
> initialization section.) That way if the 6507 flakes out it won't crash
> horribly.
> And Thomas's addendum:
> Yes, but IRQ can also be triggered by BRK.

Which is wrong. BRK causes an NMI and is so totally disregarding the Interrupt-Flag.

> Some games (Parker Bros) even use BRK to call subroutines (I have explained
> that on [stella], it's quite strange and definitely not for newbies).

It should still work. You only have to keep in mind that when using RTI after the BRK, the BRK is implicitely treated as a 2-Byte instruction, so you'll return to BRK+2
> And you can use BRK for debugging. E.g. you can check if a branch is always
> taken by adding a BRK just behind it and point the IRQ vector to a special
> routine or simply to the RESET address.

Correct, but any SEI instruction would still be a wasted byte.


Archives (includes files) at
Unsub & more at

Current Thread