home *** CD-ROM | disk | FTP | other *** search
- Program Multiple_Interupt_Handler;
- {Author: Steve Smith
- Please leave comments on Tom Vervaeke's
- bulletin board 796-1223 }
- {This program exists in a simpler and better commented form as SIH.LBR
- If you have trouble following it, try that one first.}
-
- (*$INewScrn.Inc *)
- Type
- RegisterSet=Record Case Integer Of
- 1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Integer);
- 2: (AL,AH,BL,BH,CL,CH,DL,DH : Byte);
- End;
- Var
- Setup : RegisterSet;
- IntAX,IntBX,IntCX,IntDX,IntBP,IntSI,IntDI,IntDS,IntES,
- IntFlags : Integer;
- Interupt_Registers : RegisterSet Absolute IntAX;
- {Interupt_Registers must be Global so that they will be in the data segment
- and can be accessed by any interupt handler or user procedure.
- Local variables are in the stack segment which is not preserved.
- Becuase they are global, however, it will be extra dangerous for one interupt
- handler to call another. To ensure that that will work,it may be necessary
- to declare a second global register set.}
- (*----------------------------------------------------------------------*)
- Procedure Interupt_42_Handler;
- Const
- Interupt_Number : Integer = $42;
- (*$Icall_41.inc*)
- (*$Isih.inc*)
- (*----------------------------------------------------------------------*)
- Procedure Interupt_41_Handler;
- Const
- Interupt_Number : Integer = $41;
- (*$Ishow_reg.inc*)
- (*$Isih.inc*)
- (*----------------------------------------------------------------------*)
- Begin {Main Program}
- Get_Screen_Address; {for later screen saves}
- Interupt_41_Handler;
- Interupt_42_Handler;
- Setup.DX := $800; {reserve 32K for program}
- Setup.Ah := $31; {end but stay resident}
- MsDos(Setup);
- End.