home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / WIH.ZIP / MIH.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-02-01  |  1.9 KB  |  46 lines

  1. Program Multiple_Interupt_Handler;
  2.   {Author: Steve Smith
  3.            Please leave comments on Tom Vervaeke's
  4.            bulletin board 796-1223 }
  5.   {This program exists in a simpler and better commented form as SIH.LBR
  6.    If you have trouble following it, try that one first.}
  7.  
  8. (*$INewScrn.Inc *)
  9. Type
  10.    RegisterSet=Record Case Integer Of
  11.                   1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Integer);
  12.                   2: (AL,AH,BL,BH,CL,CH,DL,DH         : Byte);
  13.                 End;
  14. Var
  15.    Setup                : RegisterSet;
  16.    IntAX,IntBX,IntCX,IntDX,IntBP,IntSI,IntDI,IntDS,IntES,
  17.    IntFlags             : Integer;
  18.    Interupt_Registers   : RegisterSet Absolute IntAX;
  19. {Interupt_Registers must be Global so that they will be in the data segment
  20.  and can be accessed by any interupt handler or user procedure.
  21.  Local variables are in the stack segment which is not preserved.
  22.  Becuase they are global, however, it will be extra dangerous for one interupt
  23.  handler to call another.  To ensure that that will work,it may be necessary
  24.  to declare a second global register set.}
  25. (*----------------------------------------------------------------------*)
  26. Procedure Interupt_42_Handler;
  27. Const
  28.    Interupt_Number      : Integer = $42;
  29. (*$Icall_41.inc*)
  30. (*$Isih.inc*)
  31. (*----------------------------------------------------------------------*)
  32. Procedure Interupt_41_Handler;
  33. Const
  34.    Interupt_Number      : Integer = $41;
  35. (*$Ishow_reg.inc*)
  36. (*$Isih.inc*)
  37. (*----------------------------------------------------------------------*)
  38. Begin {Main Program}
  39.      Get_Screen_Address; {for later screen saves}
  40.      Interupt_41_Handler;
  41.      Interupt_42_Handler;
  42.      Setup.DX := $800;    {reserve 32K for program}
  43.      Setup.Ah := $31;     {end but stay resident}
  44.      MsDos(Setup);
  45. End.
  46.