Listing: 1 (* Release 3.10 *) 2 (*-------------------------------------------------------------------------* 3 * * 4 * LIM.MOD - LIM Expanded memory support * 5 * * 6 * COPYRIGHT (C) 1987..1992 Clarion Software Corporation. * 7 * All Rights Reserved * 8 * * 9 *--------------------------------------------------------------------------*) 10 11 (*%F _fdata *) 12 (*# call(seg_name => null) *) 13 (*# data(seg_name => null) *) 14 (*%E *) 15 (*# module(implementation=>off) *) 16 (*# check(stack=>off, 17 index=>off, 18 range=>off, 19 overflow=>off, 20 nil_ptr=>off) *) 21 22 IMPLEMENTATION MODULE LIM; (* LIM expanded memory *) 23 24 IMPORT SYSTEM,Str,Lib ; 25 26 PROCEDURE EMMError( e : SHORTCARD ); 27 28 VAR 29 str : ARRAY [0..79] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 30 err : ARRAY [0..79] OF CHAR ; ***** ^ not supported yet ***** ^ not supported yet 31 Done : BOOLEAN; 32 CONST 33 Errors = 'Internal EMS driver Error|'+ ***** ^ not supported yet 34 'Hardware failure|'+ ***** ^ not supported yet 35 'Busy|'+ ***** ^ not supported yet 36 'Invalid handle|'+ ***** ^ not supported yet 37 'Undefined function|'+ ***** ^ not supported yet 38 'No more EMS handles available|'+ ***** ^ not supported yet 39 'Error in save or restore of map context|'+ ***** ^ not supported yet 40 'Not enough logical pages physically available|'+ ***** ^ not supported yet 41 'Not enough pages available|'+ ***** ^ not supported yet 42 'Zero allocation|'+ ***** ^ not supported yet 43 'Logical page number out of range|'+ ***** ^ not supported yet 44 'Illegal physical page number|'+ ***** ^ not supported yet 45 'Mapping save area full|'+ ***** ^ not supported yet 46 'Mapping context save failed (already saved)|'+ ***** ^ not supported yet 47 'Mapping context restore failed (not saved)|'+ ***** ^ not supported yet 48 'Subfunction parameter undefined'; ***** ^ not supported yet 49 BEGIN 50 IF e # 0 THEN 51 str := 'LIM EMS error ' ; ***** ^ not supported yet ***** ^ not supported yet 52 Str.CardToStr( LONGCARD(e),err,16,Done ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 53 Str.Append(str,err) ; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 54 IF (e>=80H)AND(e<=8FH) THEN 55 Str.ItemS(err,Errors,'|',CARDINAL(e-80H)) ; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 56 Str.Append(str,' : '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 57 Str.Append(str,err); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 58 END ; 59 Lib.FatalError( str ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 60 END ; 61 END EMMError; ***** ^ not supported yet 62 63 PROCEDURE GetStatus() : SHORTCARD; 64 65 VAR 66 r : SYSTEM.Registers; ***** ^ not supported yet 67 BEGIN 68 WITH r DO ***** ^ not supported yet 69 AH := 40H; ***** ^ undeclared identifier 70 Lib.Intr(r,67H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 71 RETURN AH; ***** ^ undeclared identifier 72 END; ***** ^ not supported yet 73 END GetStatus; ***** ^ not supported yet 74 75 PROCEDURE GetPageFrame(): CARDINAL; 76 77 VAR 78 r : SYSTEM.Registers; ***** ^ not supported yet 79 BEGIN 80 WITH r DO ***** ^ not supported yet 81 AH := 41H; ***** ^ undeclared identifier 82 Lib.Intr(r,67H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 83 IF AH#0 THEN EMMError( AH ); END; ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 84 RETURN BX; ***** ^ undeclared identifier 85 END; ***** ^ not supported yet 86 END GetPageFrame; ***** ^ not supported yet 87 88 PROCEDURE AllocatePages( n : CARDINAL ) : CARDINAL; 89 90 VAR 91 r : SYSTEM.Registers; ***** ^ not supported yet 92 BEGIN 93 WITH r DO ***** ^ not supported yet 94 AH := 43H; ***** ^ undeclared identifier 95 BX := n; ***** ^ undeclared identifier 96 Lib.Intr(r,67H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 97 IF AH#0 THEN EMMError( AH ); END; ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 98 RETURN DX; ***** ^ undeclared identifier 99 END; ***** ^ not supported yet 100 END AllocatePages; ***** ^ not supported yet 101 102 PROCEDURE FreePages() : CARDINAL; 103 VAR 104 r : SYSTEM.Registers; ***** ^ not supported yet 105 BEGIN 106 WITH r DO ***** ^ not supported yet 107 AH := 42H; ***** ^ undeclared identifier 108 Lib.Intr(r,67H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 109 IF AH#0 THEN EMMError( AH ); END; ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 110 RETURN BX; ***** ^ undeclared identifier 111 END; ***** ^ not supported yet 112 END FreePages; ***** ^ not supported yet 113 114 PROCEDURE MapPage( PPage,LPage,Handle : CARDINAL ): CARDINAL; 115 116 VAR 117 r : SYSTEM.Registers; ***** ^ not supported yet 118 BEGIN 119 WITH r DO ***** ^ not supported yet 120 AH := 44H; ***** ^ undeclared identifier 121 AL := SHORTCARD(PPage); ***** ^ undeclared identifier ***** ^ not supported yet 122 BX := LPage; ***** ^ undeclared identifier 123 DX := Handle; ***** ^ undeclared identifier 124 Lib.Intr(r,67H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 125 IF AH#0 THEN EMMError( AH ); END; ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 126 RETURN PPage << 14; 127 END; ***** ^ not supported yet 128 END MapPage; ***** ^ not supported yet 129 130 PROCEDURE DeAllocatePages( Handle : CARDINAL ); 131 132 VAR 133 r : SYSTEM.Registers; ***** ^ not supported yet 134 BEGIN 135 WITH r DO ***** ^ not supported yet 136 AH := 45H; ***** ^ undeclared identifier 137 DX := Handle; ***** ^ undeclared identifier 138 Lib.Intr(r,67H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 139 IF AH#0 THEN EMMError( AH ); END; ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 140 END; ***** ^ not supported yet 141 END DeAllocatePages; ***** ^ not supported yet 142 143 VAR 144 Int67 [0:19CH] : FarADDRESS; ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 145 146 TYPE b8 = ARRAY [0..7] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 147 148 BEGIN 149 LIMPresent := FALSE; ***** ^ undeclared identifier 150 IF (Int67 # FarNIL) AND (b8([[0:19CH+2]^:0AH]^) = b8('EMMXXXX0')) THEN ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 151 LIMPresent := GetStatus()=0; ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 152 IF LIMPresent THEN PageFr := GetPageFrame(); END; ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 153 END; 154 END LIM. ***** ^ not supported yet 155 156 148 errors