{ interrup.inc by Kari Lammassaari } Var OldInt :Array[0..2] Of Byte; DosInt :Array[0..2] Of Byte Absolute $0038; IntervalCounter :Integer; Procedure Interrupt; { This procedure is NEVER called by Pascal. It's the code where the interrupt is redirected to. } Begin Inline ( $F3/ $F5/$C5/$D5/$E5/$D9/$F5/$C5/$D5/$E5/$DD/$E5/$FD/$E5/ $DD/$21/$00/$00/ $DD/$7E/$0/$3C/$DD/$77/$0/$DD/$BE/$1/$20/$7/$AF/$DD/$77/$0/ $CD/$00/$00/ $FD/$E1/$DD/$E1/$E1/$D1/$C1/$F1/$D9/$E1/$D1/ $C1/$F1/ $00/ $c3/0/0 {Here comes orig addr from ($0038) } ); End; Procedure RemoveInterrupt; Begin Inline($f3); Move(OldInt,DosInt,3); Inline($fb); End; Procedure SetInterrupt(IntProcAddr:Integer;IntervalValue:Byte); Var IntAddr :Integer; i :Byte; Begin ErrorPtr := Addr(RemoveInterrupt); IntervalCounter := IntervalValue*256; IntAddr := Addr(Interrupt); Move(DosInt,Oldint,3); {Save Original Interrupt Addr}; For i := 0 to 2 Do Mem[IntAddr+51+i] := Mem[$38+i]; Mem[IntAddr+35] := Lo(IntProcAddr); Mem[IntAddr+36] := Hi(IntProcAddr); Mem[IntAddr + 16] := Lo(Addr(IntervalCounter)); Mem[IntAddr + 17] := Hi(Addr(IntervalCounter)); Inline($f3); Mem[$39] := Lo(IntAddr); Mem[$3a] := Hi(IntAddr); Inline($fb); End;