home *** CD-ROM | disk | FTP | other *** search
-
- CONST
- {set these values based on the size of the MAIN program}
- MaxNumProcs = 10; {maximum number of procedures available for Far calls}
- MaxProcNameLength = 20; {maximum name length of such procedures}
-
- TYPE
- ProcNameArray = ARRAY[1..MaxNumProcs] OF STRING[MaxProcNameLength];
- ProcOffsetArray = ARRAY[1..MaxNumProcs] OF Integer;
- BigTurboString = STRING[64];
- JumpRecord = RECORD
- offset, segment : Integer;
- END;
-
- CONST
- {these need to be adjusted based on the value in MaxNumProcs}
- {no literal values need be filled in here}
- pnames : ProcNameArray = ('', '', '', '', '', '', '', '', '', '');
- poffsets : ProcOffsetArray = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
-
- VAR
- FarCodePtr : ^integer; {will hold pointer to where far code is stored}
- MainHand : JumpRecord; {holds pointer to MainCallHandler in this code segment}
- FarJumpSet : JumpRecord; {holds pointer to SetupJumpTable in Far code segment}
- FarHand : JumpRecord; {holds pointer to FarCallHandler in Far code segment}
-
- PROCEDURE MakeLongCall(FarProcName : BigTurboString);
- {-pass control to the call handler in the Far code}
- BEGIN
- INLINE(
- $8C/$D0/ {MOV AX,SS}
- $8E/$C0/ {MOV ES,AX}
- $8B/$F5/ {MOV SI,BP}
- $81/$C6/$04/$00/ {ADD SI,0004}
- $FF/$1E/FarHand {CALL FAR FarHand}
- );
- END; {MakeLongCall}