[comp.sys.apple2] Interrupts

unknown@ucscb.UCSC.EDU (The Unknown User) (12/16/90)

In article <2496@unsvax.NEVADA.EDU> alfter@uns-helios.nevada.edu (SCOTT ALFTER) writes:
>Only four interrupt drivers are supported, though; when you no longer
>need a particular daemon, DEALLOC_INTERRUPT will get rid of it for
>you.

	What are the interrupts available on the //? I guess a better
way to say that is what causes the interrupts which you can create vectors
for?

>More comprehensive information is in _Beneath_Apple_ProDOS_.
>
BTW, note that this example is for 8-bit IIs as well as the GS; I
figure this information would be of more interest than GS-specific
info.  Besides, I don't have a GS and couldn't help you with interrupt
questions on that machine.
-- 
/Apple II(GS) Forever! unknown@ucscb.ucsc.edu MAIL ME FOR INFO ABOUT CHEAP CDs\
|WRITE TO ORIGIN ABOUT ULTIMA VI //e and IIGS! Mail me for addresses, & info. | 
\   "Dammit Bev, is it you inside or is it the clown?" -IT by Stephen King    /

alfter@uns-helios.nevada.edu (SCOTT ALFTER) (12/17/90)

In article <10152@darkstar.ucsc.edu> unknown@ucscb.UCSC.EDU (The Unknown User) writes:
>	What are the interrupts available on the //? I guess a better
>way to say that is what causes the interrupts which you can create vectors
>for?

I'm not sure I understand what you're trying to say.  When something
(such as a serial card) generates an interrupt, it pulls the IRQ' line
on the processor low.  It also usually sets a flag somewhere in the
card's I/O space to say that the interrupt was caused by that card.
ProDOS checks with each interrupt daemon installed.  The daemon is
supposed to look for the flag on the card that signals the interrupt
it's looking for.  If an interrupt daemon decides it can't do anything
with the interrupt, it passes it back to ProDOS, which then checks the
next daemon installed.  If none of the daemons claim the interrupt as
theirs, ProDOS stops somewhat unceremoniously with a system error.

Example:  I have interrupts enabled on my modem card for telecomm and
on my clock card for some preemptive multitasking (this is only
hypothetical).  A character comes in off the phone line.  This sets
the high bit of the modem card's status byte at $C0A9.  ProDOS gets
the interrupt and passes it to the telecomm daemon.  The telecomm
daemon sees that the high bit of $C0A9 is set, so it grabs the
character, stuffs it into a ring buffer, and hands control back to
ProDOS with a CLC to say that the interrupt has been dealt with.

What if the clock card is the source of the interrupt?  It sets bit 5
at $C0C0.  ProDOS first passes control to the telecomm daemon.  It
sees that the high bit of $C0A9 is still clear, so it goes back to
ProDOS with an SEC to say the interrupt hasn't been claimed yet.
ProDOS then goes to the multitasking daemon, which sees that bit 5 at
$C0C0 is set.  It then clears the interrupt and does whatever it
should do (probably switch to another process).

There's always the possibility of a spurious interrupt (ack!) getting
into the system.  The flags at $C0A9 and $C0C0 aren't going to be set,
so both the telecomm and multitasking daemons won't accept it.  Since
they're the only interrupt daemons in the system, ProDOS puts a nice
message on the bottom of the screen asking you to reboot the system.

Scott Alfter-----------------------------_/_----------------------------
                                        / v \ Apple II:
Internet: alfter@uns-helios.nevada.edu (    ( the power to be your best!
   GEnie: S.ALFTER                      \_^_/