[A83] Re: Turning calc off


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

[A83] Re: Turning calc off



On Thu, 16 Jan 2003 20:27:14 -0600, Grant Miller wrote:

> Any interrupt will re-enable them (actually, I think they might be 
> re-enabled in the interrupt handler)  At any rate, when you press on, 
> they get re-enabled.

Things are slightly more complicated than that.

You can only turn off interrupts with "di". Without a "di" every
interrupt is caught and an interrupt routine is called. What you can
change though (in case of maskable interrupts, which all interrupts are
on these calcs) is the interrupt mask, or in other words, change the
ability of the TIOS to know what sort of interrupt happened.

What you do with "out(3),1" is setting this mask (and turning off the
lcd (bit 3)), allowing on key interrupts to be detected, but not timer
interrupts. So when a timer interrupt occurs, the interrupt routine does
nothing (keys, cursor, busy indicator, apd timer...) and just returns to
the main program flow. When an on key interrupt occurs the state of port
3 will be reset, turning on the lcd and timer interrupts.




Follow-Ups: References: