[A83] Re: interrupt with shutdown


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

[A83] Re: interrupt with shutdown





>Hmm, I tried out the following two interrupt routines.
>
>     ex     af,af'
>     bit    0,(iy+33)
>     ret    nz
>     set    0,(iy+33)
>     ex     af,af'
>     halt
>     res    0,(iy+33)
>     jp     0039h
>
>-------------------------------------
>
>     ex     af,af'
>     bit    0,(iy+33)
>     ret    nz
>     set    0,(iy+33)
>     ex     af,af'
>     ei
>     halt
>     res    0,(iy+33)
>     jp     0039h
>
>The first time the routine is called, it sets a bit and waits for an
>interrupt to happen (HALT). If that interrupt happens, it will return
>immediately (the bit is set), reset the bit and call the standard
>interrupt handler.
>
>The difference between the two routines is that the second one has an EI
>before the HALT and first one doesn't. Thus the second one always works
>and is merely meant to verify that the test works.
>
>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.

But with my interrupt routine I posted earlier, If I don't
disable interrupts before I jump to 38h, the calc freezes.
That's also the correction I posted afterwards.

But with the current interrupt routine, when the calc
shuts down with that 2nd+on, it immediately get's back
on if I hold on to the <ON> and release it after a few
seconds (sometimes), or I press 2nd and a short push
on <ON> it also get's back on. (also only sometimes)
I do not know why that happens, but it shouldn't do that
in the final program. Like when you shut the calc down
like normal and then it's suddenly back on.
We do not want that to happen, do we?

With the password program I have right now, this piece
of code works fine for shutting the calc down. But not
in an interrupt. I don't get it! It's just a standard
way of shutting it down, I guess.

ld a,1
out (3),a
halt

        SUCKER



>
>Tijl Coosemans
>http://tijl.studentenweb.org/
>
>
> > From: "Michael Vincent" <hookman@worldnet.att.net>
> >
> > A DI is good practice, because if your interrupt routine takes a long
> > time to run, another interrupt might be called before it's exited, and 
>then
> > it will start again...going into a loop of sorts.
> >
> > Michael Vincent
> > Detached Solutions - www.detacheds.com
> > Radical Software - www.radicalsoft.org
> >
>
> > > From: "Tijl Coosemans" <tijl@ulyssis.org>
> > >
> > >
> > > I just tested it out and a DI at the start of an interrupt routine is
> > > not necessary, at least not on the TI83-.
>
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





Follow-Ups: