TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ALL
from: SAM IZZO
date: 1998-01-11 22:07:00
subject: PIC/ISRs

Hello All!
Ok, bear with me on this one if I make some completely ridiculous statements,
I'm still figuring it out :)
Now, as I see it, if you want to capture a software interrupt which is
generated by a hardware interrupt and write your own handler, before 
installing
your code you should change the output control word for PIC 1 or PIC 2,
depending on whether the IRQ you're servicing is 0-7 or 8-15.  Is this 
correct?
I never did that for my keyboard handler, and it always worked fine, but when 
I
started fiddling around with SoundBlaster code using DMA transfers, I found I
had to do this.  Also, I've noticed in some SoundBlaster code I found on
Creative's Web site that in their ISR, if the IRQ was greater than 8, they
signalled an EOI by outputting 20h to PIC 2 and also did the usual 20h to PIC 
1
Is this necessary?  Here's some pseudocode of what they did:
; This is part of their SetISR routine
; (various code not shown)
int_mask = 1 SHL IRQnum ; int_mask is a word
temp = in(0x21) ; PIC 1 mask register
temp = temp AND int_mask
out(0x21, temp)
temp = in(0xA1) ; PIC 2 mask register
temp = temp AND (int_mask SHR 8)
out(0xA1, temp)
Ok, is it necessary to do both, (I can see that if the IRQ is < 8 then the
second out will result in 0)?  Can you just do one or the other, based on
what the IRQ is?
Also, in their actual ISR:
; This is part of their DMAISR routine
; (various code not shown)
if IRQnum > 8 then out(0xA0, 0x20) ; PIC 2 EOI register
out(0x20, 0x20) ; PIC 1 EOI register
There was no else statement, they simply did both.  Is this necessary, or can
I also do one or the other, as before?
Thanks for any help!
Sam
... Do what you will with this tagline, just don't bother me about it!
--- FMail/386 1.20+
---------------
* Origin: Comms Barrier BBS +61.3.9585.1112, +61.3.9583.6119 (3:632/533)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.