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

  1.  
  2.   CONST
  3.     {set these values based on the size of the FAR program}
  4.     {see comments in MAIN1.INC}
  5.     MaxNumProcs = 10;
  6.     MaxProcNameLength = 20;
  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.   CONST
  15.     {these need to be adjusted based on the value in MaxNumProcs}
  16.     {no literal values need be filled in here}
  17.     pnames : ProcNameArray = ('', '', '', '', '', '', '', '', '', '');
  18.     poffsets : ProcOffsetArray = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  19.   VAR
  20.     FarCodePtr : ^integer;    {will hold pointer to where far code is stored}
  21.     MainHand : JumpRecord;    {holds pointer to MainCallHandler in the other code segment}
  22.     FarJumpSet : JumpRecord;  {holds pointer to SetupJumpTable in this code segment}
  23.     FarHand : JumpRecord;     {holds pointer to FarCallHandler in this code segment}
  24.  
  25.   PROCEDURE MakeLongCall(FarProcName : BigTurboString);
  26.       {-pass control to the call handler in the Far code}
  27.     BEGIN
  28.       INLINE(
  29.         $8C/$D0/              {MOV    AX,SS}
  30.         $8E/$C0/              {MOV    ES,AX}
  31.         $8B/$F5/              {MOV    SI,BP}
  32.         $81/$C6/$04/$00/      {ADD    SI,0004}
  33.         $FF/$1E/MainHand      {CALL   FAR MainHand}
  34.         );
  35.     END;                      {MakeLongCall}
  36.