How to write an interrupt service routine for interrupt # 15 ? 
Author Message
 How to write an interrupt service routine for interrupt # 15 ?

I have a digitizer plug-in baord that generates an
interrupt on # 15.  I want to write an ISR for that in Pascal. I've
written an ISR for interrupt #7 for other applications (parallel port)
that work, but trying to do a similar thing for #15 does not, perhaps
because it involves the second interrupt controller ?  I've included
code below with possibilities for both interrupt #7 and # 15:

Steve

-----------------------------------------------------
var
 intr_num : byte;
 old_interrupt_addrs : pointer;

procedure new_interrupt; interrupt;
begin
{ do something }

{
 Signal end of interrupt (EOI) to the interrupt controller.
 Send EIO to both to slave PIC at $A0 and master at $20 .

Quote:
}

port[$a0] := $20;
port[$20] := $20;

end;
begin  { MAIN Program }

{ for interrupt #'s <= 7, intr_num = interrupt# + 8
example: for parallel port interrput #7, intr_num = 15 decimal  which
is interrupt #7  + 8

for interrupt numbers > 7, do 70 hex + (interrupt#-8)
   example: for interrupt #15, intr_num = $70 + (15-8) = $77

Quote:
}

intr_num := $77;

getintvec(intr_num, old_interrupt_15_addrs);

{ Unmask the desired IRQ in the interrupt controller.
  For example, for IRQ7, do  AND 01111111  which =  AND $7f

Quote:
}

{ for interrupt #7, do   port[$21] := port[$21] and $7f; }

{ for interrupt # 15, is this next line correct: ?}
{  do I also have to unmask something (the interrupt #2) in port[$21]
? }
port[$a1] := port[$a1] and $7f;

{ clear pending interrupts }
port[$a0] := $20;
port[$20] := $20;

{
 do main program here

Quote:
}

setintvec(intr_num, old_interrupt_addrs);
{ also set mask in IRQ controller back to its original value...}
end.




Mon, 28 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to write interrupt service routine for interrupt # 15 ?

2. hook on interrupt routine

3. Interrupt routine

4. joystick routine with out interrupts

5. interrupt-based coppering routines in protected mode?

6. Runtime checking in interrupt routines possible ??

7. Interrupt Clock (Can't WRITE to disk)

8. Interrupt Clock (Can't WRITE to disk)

9. Writing a VXD or DLL for Hardware interrupts?

10. How to modify interrupt vector table so pgm sees interrupt before WIN grabs it ?

11. BIOS Interrupts

12. Dos Unit - bug in Intr() combined with user-interrupt

 

 
Powered by phpBB® Forum Software