[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.

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-.





Follow-Ups: