BIOSIO.LST 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * BIOSIO.MOD - BIOS level i/o *
  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 (*%E *)
  15. 14 (*# module(implementation=>off) *)
  16. 15 (*# data(seg_name => null) *)
  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 BiosIO ;
  24. 23
  25. 24 IMPORT Lib,IO,SYSTEM;
  26. 25
  27. 26
  28. 27 PROCEDURE KeyPressed() : BOOLEAN ;
  29. 28 VAR R : SYSTEM.Registers;
  30. ***** ^ not supported yet
  31. 29 BEGIN
  32. 30 IF LastChar = CHR(0) THEN
  33. ***** ^ undeclared identifier
  34. ***** ^ undeclared identifier
  35. ***** ^ not supported yet
  36. 31 RETURN TRUE ;
  37. 32 ELSE
  38. 33 R.AH := 1;
  39. ***** ^ not supported yet
  40. ***** ^ not supported yet
  41. 34 IF EnhancedBIOS THEN R.AH := 11H END ;
  42. ***** ^ undeclared identifier
  43. ***** ^ not supported yet
  44. ***** ^ not supported yet
  45. 35 Lib.Intr(R,16H);
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. 36 RETURN NOT (SYSTEM.ZeroFlag IN R.Flags) ;
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. 37 END ;
  56. 38 END KeyPressed;
  57. ***** ^ not supported yet
  58. 39
  59. 40 PROCEDURE RdKey () : CHAR ;
  60. 41 VAR R : SYSTEM.Registers;
  61. ***** ^ not supported yet
  62. 42 BEGIN
  63. 43 IF LastChar = CHR(0) THEN
  64. ***** ^ undeclared identifier
  65. ***** ^ undeclared identifier
  66. ***** ^ not supported yet
  67. 44 LastChar := CHR(0FFH) ;
  68. ***** ^ undeclared identifier
  69. ***** ^ undeclared identifier
  70. ***** ^ not supported yet
  71. 45 RETURN CHR(LastScan) ;
  72. ***** ^ undeclared identifier
  73. ***** ^ undeclared identifier
  74. 46 ELSE
  75. 47 IF EnhancedBIOS THEN
  76. ***** ^ undeclared identifier
  77. 48 R.AH := 10H ;
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. 49 Lib.Intr(R,16H);
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. 50 IF (R.AL=0E0H)AND(R.AH<>0) THEN R.AL := 0 END ;
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. 51 ELSE
  93. 52 R.AH := 0 ;
  94. ***** ^ not supported yet
  95. ***** ^ not supported yet
  96. 53 Lib.Intr(R,16H);
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. 54 END ;
  102. 55 IF R.AX=0 THEN END ; (* break *)
  103. ***** ^ not supported yet
  104. ***** ^ not supported yet
  105. 56 LastChar := CHR(R.AL) ;
  106. ***** ^ undeclared identifier
  107. ***** ^ undeclared identifier
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. 57 LastScan := R.AH ;
  111. ***** ^ undeclared identifier
  112. ***** ^ not supported yet
  113. ***** ^ not supported yet
  114. 58 RETURN LastChar ;
  115. ***** ^ undeclared identifier
  116. 59 END;
  117. 60 END RdKey ;
  118. ***** ^ not supported yet
  119. 61
  120. 62
  121. 63
  122. 64 PROCEDURE RdChar () : CHAR ;
  123. 65 (* reads and echoes char (if not extended) *)
  124. 66 VAR C : CHAR ;
  125. 67 BEGIN
  126. 68 IF LastChar = CHR(0) THEN RETURN RdKey() END ;
  127. ***** ^ undeclared identifier
  128. ***** ^ undeclared identifier
  129. ***** ^ not supported yet
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. 69 C := RdKey() ;
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. 70 IF C<>CHR(0) THEN
  136. ***** ^ undeclared identifier
  137. ***** ^ not supported yet
  138. 71 IO.WrChar( C );
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. 72 END ;
  143. 73 RETURN C ;
  144. 74 END RdChar ;
  145. ***** ^ not supported yet
  146. 75
  147. 76 PROCEDURE KBFlags () : KBFlagSet ;
  148. ***** ^ undeclared identifier
  149. 77 VAR R : SYSTEM.Registers;
  150. ***** ^ not supported yet
  151. 78 BEGIN
  152. 79 R.AH := 2 ;
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. 80 Lib.Intr(R,16H);
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. ***** ^ not supported yet
  159. ***** ^ not supported yet
  160. 81 RETURN KBFlagSet(R.AL) ;
  161. ***** ^ undeclared identifier
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. 82 END KBFlags ;
  165. ***** ^ not supported yet
  166. 83
  167. 84 PROCEDURE Init ;
  168. 85 VAR R : SYSTEM.Registers ;
  169. ***** ^ not supported yet
  170. 86 i : CARDINAL ;
  171. 87 BEGIN
  172. 88 LastScan := 0 ;
  173. ***** ^ undeclared identifier
  174. 89 LastChar := CHR(0FFH) ;
  175. ***** ^ undeclared identifier
  176. ***** ^ undeclared identifier
  177. ***** ^ not supported yet
  178. 90 EnhancedBIOS := FALSE ;
  179. ***** ^ undeclared identifier
  180. 91 (* Check for enhanced BIOS *)
  181. 92 R.AX := 5FFH ;
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. 93 R.CX := 0FFFFH ;
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. 94 Lib.Intr(R,16H); (* Put FFFF into Kbd buffer *)
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. 95 IF R.AL=0 THEN
  193. ***** ^ not supported yet
  194. ***** ^ not supported yet
  195. 96 i := 256 ;
  196. 97 LOOP
  197. 98 R.AH := 11H ;
  198. ***** ^ not supported yet
  199. ***** ^ not supported yet
  200. 99 Lib.Intr(R,16H); (* And try and read it back *)
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. 100 IF SYSTEM.ZeroFlag IN R.Flags THEN EXIT END ;
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 101 R.AH := 10H ;
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. 102 Lib.Intr(R,16H); (* And try and read it back *)
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. 103 IF (R.AX=0FFFFH) OR (i=0) THEN EXIT END ;
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 104 DEC (i);
  222. ***** ^ undeclared identifier
  223. ***** ^ not supported yet
  224. 105 END ;
  225. 106 IF R.AX=0FFFFH THEN
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. 107 EnhancedBIOS := TRUE ;
  229. ***** ^ undeclared identifier
  230. 108 END ;
  231. 109 END ;
  232. 110 END Init ;
  233. ***** ^ not supported yet
  234. 111
  235. 112 BEGIN
  236. 113 Init ;
  237. ***** ^ not supported yet
  238. 114 END BiosIO.
  239. ***** ^ not supported yet
  240. 115
  241. 124 errors