home *** CD-ROM | disk | FTP | other *** search
- Unit IntXX;
-
- INTERFACE
-
- Uses
- DOS;
-
- IMPLEMENTATION
-
- Var
- OldExitProc,
- SaveIntXX : pointer;
-
- Procedure JmpOldISR(OldISR: Pointer);
- { An inline macro procedure. The code for this will be inserted at the }
- { point that it is called. The purpose of this macro is to jump to the }
- { Interrupt Service Routine at the address passed in. }
- Inline($5B/$58/$87/$5E/$0E/$87/$46/$10/$89/
- $EC/$5D/$07/$1F/$5F/$5E/$5A/$59/$CB);
-
- {$F+}
- Procedure ISR( Flags,CS,IP,AX,BX,CX,DX,SI,DI,DS,ES,BP:word ); Interrupt;
- { This interrupt procedure is the new ISR for Interrupt XX. }
- Begin
- JmpOldISR( SaveIntXX );
- End;
-
- Procedure IntXXExitProc;
- { This procedure will be called upon exit of the program. Its purpose }
- { is to restore the interrupt that was stolen at startup. }
- Begin
- ExitProc := OldExitProc;
- SetIntVec( <XX>, SaveIntXX ); { Restore the old ISR }
- end;
- {$F-}
-
- Begin
- OldExitProc := ExitProc; { Set up exit procedure }
- ExitProc := @IntXXExitProc; { " }
- GetIntVec( <XX>, SaveIntXX ); { Save old ISR value }
- SetIntVec( <XX>, @Key_ISR ); { Set up new ISR }
- end.
-