[A83] Re: MirageOS user installable interrupt


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

[A83] Re: MirageOS user installable interrupt




A plain old RET is fine.  You don't need to preserve any registers or use
the shadow registers (in fact, you shouldn't use the shadow registers).  In
case you're curious as to what's going on, here's the code used for the
MirageOS interrupt:

realint:
    di
    ex af,af'
    exx
    ld hl,flags+mirflags
    bit haveapd2,(hl)
    res haveapd2,(hl)
    jr nz,goto3A
ntdelay  = $-realint+$8a8a+1
    ld b,1
intdelayloop:
    bcall(_cphlde)
    djnz intdelayloop
timerintloc  = $-realint+$8a8a
    nop \ nop \ nop
getkeyintloc = $-realint+$8a8a
    nop \ nop \ nop
apdintloc  = $-realint+$8a8a
    nop \ nop \ nop
taskintloc  = $-realint+$8a8a
    nop \ nop \ nop
keydelayintloc = $-realint+$8a8a
    nop \ nop \ nop
customintloc = $-realint+$8a8a
    nop \ nop \ nop
goto3A:
    jp $3A

When you use setupint, MirageOS puts calls to actual addresses in place of
the nops.  (This routine could probably be rewritten a bit, but that's a
different story altogether).  So when you enable a custom interrupt routine
(which you see has the lowest priority in the list) your routine is just a
subroutine of the real interrupt routine.

-Dan Englender


----- Original Message -----
From: "Henk Poley" <HPoley@DDS.nl>
To: <assembly-83@lists.ticalc.org>
Sent: Friday, May 18, 2001 12:40 PM
Subject: [A83] MirageOS user installable interrupt


>
> When using the MirageOS user installable interrupt in a program, do you
> need to do a RET or a RETI after the interrupt??? What's the difference?
(I
> know it has something to do with some Z80 built-in flip-flop-switches,
> but...)
>
> And do you need to exx \ ex hl,hl'? Do you need to preserve any register
> when using the MiragOS user interrupt?
>
> Henk Poley
>
>




References: