LIM.LST 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * LIM.MOD - LIM Expanded memory support *
  6. 5 * *
  7. 6 * COPYRIGHT (C) 1987..1992 Clarion Software Corporation. *
  8. 7 * All Rights Reserved *
  9. 8 * *
  10. 9 *--------------------------------------------------------------------------*)
  11. 10
  12. 11 (*%F _fdata *)
  13. 12 (*# call(seg_name => null) *)
  14. 13 (*# data(seg_name => null) *)
  15. 14 (*%E *)
  16. 15 (*# module(implementation=>off) *)
  17. 16 (*# check(stack=>off,
  18. 17 index=>off,
  19. 18 range=>off,
  20. 19 overflow=>off,
  21. 20 nil_ptr=>off) *)
  22. 21
  23. 22 IMPLEMENTATION MODULE LIM; (* LIM expanded memory *)
  24. 23
  25. 24 IMPORT SYSTEM,Str,Lib ;
  26. 25
  27. 26 PROCEDURE EMMError( e : SHORTCARD );
  28. 27
  29. 28 VAR
  30. 29 str : ARRAY [0..79] OF CHAR;
  31. ***** ^ not supported yet
  32. ***** ^ not supported yet
  33. 30 err : ARRAY [0..79] OF CHAR ;
  34. ***** ^ not supported yet
  35. ***** ^ not supported yet
  36. 31 Done : BOOLEAN;
  37. 32 CONST
  38. 33 Errors = 'Internal EMS driver Error|'+
  39. ***** ^ not supported yet
  40. 34 'Hardware failure|'+
  41. ***** ^ not supported yet
  42. 35 'Busy|'+
  43. ***** ^ not supported yet
  44. 36 'Invalid handle|'+
  45. ***** ^ not supported yet
  46. 37 'Undefined function|'+
  47. ***** ^ not supported yet
  48. 38 'No more EMS handles available|'+
  49. ***** ^ not supported yet
  50. 39 'Error in save or restore of map context|'+
  51. ***** ^ not supported yet
  52. 40 'Not enough logical pages physically available|'+
  53. ***** ^ not supported yet
  54. 41 'Not enough pages available|'+
  55. ***** ^ not supported yet
  56. 42 'Zero allocation|'+
  57. ***** ^ not supported yet
  58. 43 'Logical page number out of range|'+
  59. ***** ^ not supported yet
  60. 44 'Illegal physical page number|'+
  61. ***** ^ not supported yet
  62. 45 'Mapping save area full|'+
  63. ***** ^ not supported yet
  64. 46 'Mapping context save failed (already saved)|'+
  65. ***** ^ not supported yet
  66. 47 'Mapping context restore failed (not saved)|'+
  67. ***** ^ not supported yet
  68. 48 'Subfunction parameter undefined';
  69. ***** ^ not supported yet
  70. 49 BEGIN
  71. 50 IF e # 0 THEN
  72. 51 str := 'LIM EMS error ' ;
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. 52 Str.CardToStr( LONGCARD(e),err,16,Done );
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ undeclared identifier
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. 53 Str.Append(str,err) ;
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. 54 IF (e>=80H)AND(e<=8FH) THEN
  88. 55 Str.ItemS(err,Errors,'|',CARDINAL(e-80H)) ;
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. 56 Str.Append(str,' : ');
  94. ***** ^ not supported yet
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. 57 Str.Append(str,err);
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. ***** ^ not supported yet
  103. 58 END ;
  104. 59 Lib.FatalError( str );
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 60 END ;
  109. 61 END EMMError;
  110. ***** ^ not supported yet
  111. 62
  112. 63 PROCEDURE GetStatus() : SHORTCARD;
  113. 64
  114. 65 VAR
  115. 66 r : SYSTEM.Registers;
  116. ***** ^ not supported yet
  117. 67 BEGIN
  118. 68 WITH r DO
  119. ***** ^ not supported yet
  120. 69 AH := 40H;
  121. ***** ^ undeclared identifier
  122. 70 Lib.Intr(r,67H);
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. 71 RETURN AH;
  128. ***** ^ undeclared identifier
  129. 72 END;
  130. ***** ^ not supported yet
  131. 73 END GetStatus;
  132. ***** ^ not supported yet
  133. 74
  134. 75 PROCEDURE GetPageFrame(): CARDINAL;
  135. 76
  136. 77 VAR
  137. 78 r : SYSTEM.Registers;
  138. ***** ^ not supported yet
  139. 79 BEGIN
  140. 80 WITH r DO
  141. ***** ^ not supported yet
  142. 81 AH := 41H;
  143. ***** ^ undeclared identifier
  144. 82 Lib.Intr(r,67H);
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. 83 IF AH#0 THEN EMMError( AH ); END;
  150. ***** ^ undeclared identifier
  151. ***** ^ not supported yet
  152. ***** ^ undeclared identifier
  153. 84 RETURN BX;
  154. ***** ^ undeclared identifier
  155. 85 END;
  156. ***** ^ not supported yet
  157. 86 END GetPageFrame;
  158. ***** ^ not supported yet
  159. 87
  160. 88 PROCEDURE AllocatePages( n : CARDINAL ) : CARDINAL;
  161. 89
  162. 90 VAR
  163. 91 r : SYSTEM.Registers;
  164. ***** ^ not supported yet
  165. 92 BEGIN
  166. 93 WITH r DO
  167. ***** ^ not supported yet
  168. 94 AH := 43H;
  169. ***** ^ undeclared identifier
  170. 95 BX := n;
  171. ***** ^ undeclared identifier
  172. 96 Lib.Intr(r,67H);
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. 97 IF AH#0 THEN EMMError( AH ); END;
  178. ***** ^ undeclared identifier
  179. ***** ^ not supported yet
  180. ***** ^ undeclared identifier
  181. 98 RETURN DX;
  182. ***** ^ undeclared identifier
  183. 99 END;
  184. ***** ^ not supported yet
  185. 100 END AllocatePages;
  186. ***** ^ not supported yet
  187. 101
  188. 102 PROCEDURE FreePages() : CARDINAL;
  189. 103 VAR
  190. 104 r : SYSTEM.Registers;
  191. ***** ^ not supported yet
  192. 105 BEGIN
  193. 106 WITH r DO
  194. ***** ^ not supported yet
  195. 107 AH := 42H;
  196. ***** ^ undeclared identifier
  197. 108 Lib.Intr(r,67H);
  198. ***** ^ not supported yet
  199. ***** ^ not supported yet
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. 109 IF AH#0 THEN EMMError( AH ); END;
  203. ***** ^ undeclared identifier
  204. ***** ^ not supported yet
  205. ***** ^ undeclared identifier
  206. 110 RETURN BX;
  207. ***** ^ undeclared identifier
  208. 111 END;
  209. ***** ^ not supported yet
  210. 112 END FreePages;
  211. ***** ^ not supported yet
  212. 113
  213. 114 PROCEDURE MapPage( PPage,LPage,Handle : CARDINAL ): CARDINAL;
  214. 115
  215. 116 VAR
  216. 117 r : SYSTEM.Registers;
  217. ***** ^ not supported yet
  218. 118 BEGIN
  219. 119 WITH r DO
  220. ***** ^ not supported yet
  221. 120 AH := 44H;
  222. ***** ^ undeclared identifier
  223. 121 AL := SHORTCARD(PPage);
  224. ***** ^ undeclared identifier
  225. ***** ^ not supported yet
  226. 122 BX := LPage;
  227. ***** ^ undeclared identifier
  228. 123 DX := Handle;
  229. ***** ^ undeclared identifier
  230. 124 Lib.Intr(r,67H);
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. 125 IF AH#0 THEN EMMError( AH ); END;
  236. ***** ^ undeclared identifier
  237. ***** ^ not supported yet
  238. ***** ^ undeclared identifier
  239. 126 RETURN PPage << 14;
  240. 127 END;
  241. ***** ^ not supported yet
  242. 128 END MapPage;
  243. ***** ^ not supported yet
  244. 129
  245. 130 PROCEDURE DeAllocatePages( Handle : CARDINAL );
  246. 131
  247. 132 VAR
  248. 133 r : SYSTEM.Registers;
  249. ***** ^ not supported yet
  250. 134 BEGIN
  251. 135 WITH r DO
  252. ***** ^ not supported yet
  253. 136 AH := 45H;
  254. ***** ^ undeclared identifier
  255. 137 DX := Handle;
  256. ***** ^ undeclared identifier
  257. 138 Lib.Intr(r,67H);
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. ***** ^ not supported yet
  262. 139 IF AH#0 THEN EMMError( AH ); END;
  263. ***** ^ undeclared identifier
  264. ***** ^ not supported yet
  265. ***** ^ undeclared identifier
  266. 140 END;
  267. ***** ^ not supported yet
  268. 141 END DeAllocatePages;
  269. ***** ^ not supported yet
  270. 142
  271. 143 VAR
  272. 144 Int67 [0:19CH] : FarADDRESS;
  273. ***** ^ not supported yet
  274. ***** ^ not supported yet
  275. ***** ^ undeclared identifier
  276. 145
  277. 146 TYPE b8 = ARRAY [0..7] OF CHAR;
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. 147
  281. 148 BEGIN
  282. 149 LIMPresent := FALSE;
  283. ***** ^ undeclared identifier
  284. 150 IF (Int67 # FarNIL) AND (b8([[0:19CH+2]^:0AH]^) = b8('EMMXXXX0')) THEN
  285. ***** ^ not supported yet
  286. ***** ^ undeclared identifier
  287. ***** ^ not supported yet
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. 151 LIMPresent := GetStatus()=0;
  293. ***** ^ undeclared identifier
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. 152 IF LIMPresent THEN PageFr := GetPageFrame(); END;
  297. ***** ^ undeclared identifier
  298. ***** ^ undeclared identifier
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. 153 END;
  302. 154 END LIM.
  303. ***** ^ not supported yet
  304. 155
  305. 156
  306. 148 errors