Greg DeMent Asked
I've recently noticed that all of the demos and examples I've seen use the "sei" instruction before initializing the 7800. This disables interrupts. None of the examples use "cli" to restore them. I'm doing the same thing in my code, but I'm not sure why.
Why is it necessary to disable interrupts at this stage?
Is it safe to leave them disabled forever? This causes instability on x86 PCs, but granted the 7800 is a simpler machine.
Will the "brk" instruction be affected by this setting?
Is there any source of maskable interrupts in the 7800 besides the "brk" instruction? If so, then what are they? If not, then what's the point of calling "sei"?
Thanks for any information on this. I'd like to make sure my initialization is in proper form.
Dan Boris Answered
The only place where the hardware IRQ is connected in the 7800 is to a pin on the cartridge connector which no existing cartridge uses. The IRQ signal has a pullup resistor on it so it shouldn't ever activate, but it's probably a good idea to keep the interrupt disabled anyway. As far as I know the BRK instruction is not effected by the SEI which only inhibits hardware interrupts.Â