[A83] Re: interrupt with shutdown


[Prev][Next][Index][Thread]

[A83] Re: interrupt with shutdown




This has been known for a long time :)  It's actually far easier to test
using the opposite method.  The "reti" instruction on the z80 does not
enable interrupts.  The reason I mention this is because on the Game Boy
cpu, which is close to z80, it is use to atomically enable interrupts and
return (it enables them on the instruction following the return).  If there
was no atomic way to enable interrupts, then you'd have a once cyle race
condition, that if repeatedly triggered, would cause the stack to fill up.
I have source written a long time ago for the 86 that uses an IM 2 grayscale
handler.  There is no "ei" in the routine (and, of course, no "di").  If
interrupts were disabled, then the handler would be called exactly once.

> The first routine however, will only work if interrupts are not disabled
> when an interrupt is accepted. If interrupts are disabled at the start of
> an interrupt, the HALT will cause the calculator to freeze.
>
> And that's what happened when I ran the first routine. The calc simply
> locked up. So I guess it's safe to remove the DI from the start of a
> custom interrupt routine.






References: