Page 1 of 1
Unmasking IRQs
Posted: Mon Jul 05, 2004 5:27 am
by Larry
to unmask an IRQ I use
outbyte(MASTER + 1, IRQ & 0xFF);
That means that I set the bit for the IRQ I want to unmask to '1'. But the FAQ says that
outb(0x21,0xfd);
unmaskes the keyboard..here all bits are set to 1, except for the one I?d like to unmask? Should I set a bit to 1 och 0 if I wanna mask/unmask the IRQ?
And how do I unmask an IRQ on the slave? And how do I mask the IRQs
Re:Unmasking IRQs
Posted: Mon Jul 05, 2004 6:08 am
by pkd
hi,
to unmask an irq you set the bit to zero
and to use the slave irqs you unmask bit 2 (cascade) and then unmask the irq on the slave (port 0xa1);
bye
pkd
Re:Unmasking IRQs
Posted: Mon Jul 05, 2004 7:10 am
by Larry
Do I have to rewrite the entire mask-byte? If it?s something like this:
11101010
and I wanna change the first bit.. do I have to read the bit, OR it with 0x1 and the rewrite it?
Re:Unmasking IRQs
Posted: Mon Jul 05, 2004 8:44 am
by DennisCGc
Larry wrote:
Do I have to rewrite the entire mask-byte? If it?s something like this:
11101010
and I wanna change the first bit.. do I have to read the bit, OR it with 0x1 and the rewrite it?
Yes...
Re:Unmasking IRQs
Posted: Wed Jul 07, 2004 10:53 pm
by Brendan
Hi,
Larry wrote:
Do I have to rewrite the entire mask-byte? If it?s something like this:
11101010
and I wanna change the first bit.. do I have to read the bit, OR it with 0x1 and the rewrite it?
IO port access is
slow. It's possible to cache the PIC mask value in RAM, e.g.:
Code: Select all
mov al,[currentPIC1maskValue]
or al,1
mov [currentPIC1maskValue],al
out PIC1+1,al
Instead of:
Code: Select all
in al,PIC1+1
or al,1
out PIC1+1,al
Cheers,
Brendan