home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MADTRB33.ZIP / MAIN1.INC < prev    next >
Encoding:
Text File  |  1986-02-10  |  1.5 KB  |  38 lines

  1.  
  2.   CONST
  3.     {set these values based on the size of the MAIN program}
  4.     MaxNumProcs = 10;         {maximum number of procedures available for Far calls}
  5.     MaxProcNameLength = 20;   {maximum name length of such procedures}
  6.  
  7.   TYPE
  8.     ProcNameArray = ARRAY[1..MaxNumProcs] OF STRING[MaxProcNameLength];
  9.     ProcOffsetArray = ARRAY[1..MaxNumProcs] OF Integer;
  10.     BigTurboString = STRING[64];
  11.     JumpRecord = RECORD
  12.                    offset, segment : Integer;
  13.                  END;
  14.  
  15.   CONST
  16.     {these need to be adjusted based on the value in MaxNumProcs}
  17.     {no literal values need be filled in here}
  18.     pnames : ProcNameArray = ('', '', '', '', '', '', '', '', '', '');
  19.     poffsets : ProcOffsetArray = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  20.  
  21.   VAR
  22.     FarCodePtr : ^integer;    {will hold pointer to where far code is stored}
  23.     MainHand : JumpRecord;    {holds pointer to MainCallHandler in this code segment}
  24.     FarJumpSet : JumpRecord;  {holds pointer to SetupJumpTable in Far code segment}
  25.     FarHand : JumpRecord;     {holds pointer to FarCallHandler in Far code segment}
  26.  
  27.   PROCEDURE MakeLongCall(FarProcName : BigTurboString);
  28.       {-pass control to the call handler in the Far code}
  29.     BEGIN
  30.       INLINE(
  31.         $8C/$D0/              {MOV    AX,SS}
  32.         $8E/$C0/              {MOV    ES,AX}
  33.         $8B/$F5/              {MOV    SI,BP}
  34.         $81/$C6/$04/$00/      {ADD    SI,0004}
  35.         $FF/$1E/FarHand       {CALL   FAR FarHand}
  36.         );
  37.     END;                      {MakeLongCall}
  38.