home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / tpatch.lbr / NEWCHAI0.IZC / NEWCHAI0.INC
Encoding:
Text File  |  1993-06-07  |  4.6 KB  |  322 lines

  1. (*
  2.  * NewChain - Herbert Oppmann 1/93
  3.  * Replacement Chain/Execute. Turbo Pascal Version 3.00A only!
  4.  * Chain/Execute had to be removed from the run time library to make some
  5.  * badly needed room for the patches.
  6.  * Library support:
  7.  *   a) If NCLib is <>0, then the file is supposed to be already open.
  8.  *      NCLib sectors are read starting from the current position in the file.
  9.  *   b) If NCLib is =0, the file is opened and read in whole.
  10.  * Command line support:
  11.  *      NCCmdLine is converted to uppercase and put to address $0080.
  12.  *      The first two arguments are parsed and put in the DefaultFCB.
  13.  * Load / start address:
  14.  *      Chain: the file is always loaded behind the runtime library and
  15.  *      started at $0100.
  16.  *      Execute: load and start address are determined by NCStart. This
  17.  *      feature allows the execution of CIM (non-standard executable) files.
  18.  * ZCPR3 support:
  19.  *      COM or CIM files starting with a ZCPR3 header get the address of
  20.  *      the environment descriptor stored in the header.
  21.  * Version control:
  22.  *      The Turbo Pascal version used to create a CHN file is compared
  23.  *      against the version used to compile this program. If there is
  24.  *      no match, an I/O error CE is caused.
  25.  *)
  26.  
  27. CONST
  28.   NCLib : INTEGER = 0;
  29.   NCStart : INTEGER = $0100;
  30. VAR
  31.   IORes : BYTE ABSOLUTE $00D0;
  32.   NCCmdLine : STRING[127]; {only 126 characters usable!}
  33.  
  34. PROCEDURE ChkIORes; EXTERNAL $201B;
  35.  
  36. PROCEDURE Chain(VAR f); {any file}
  37. BEGIN
  38. InLine($18/$0A);
  39. END;
  40. {don't insert something here or your machine will probably crash!}
  41.  
  42. PROCEDURE Execute(VAR f); {any file}
  43. VAR
  44.   NCSecBuf : ARRAY[0..127] OF BYTE;
  45. BEGIN
  46. InLine (
  47. $3E
  48. /$AF
  49. /$32/*+$0088
  50. /$7E
  51. /$E6/$0F
  52. /$3E/$20
  53. /$20/$5E
  54. /$3A/$D8/$00
  55. /$A7
  56. /$3E/$21
  57. /$28/$56
  58. /$11/$0C/$00
  59. /$19
  60. /$22/*+$003A
  61. /$1E/$0D
  62. /$19
  63. /$E5
  64. /$2A/$06/$00
  65. /$11/$38/$FF
  66. /$19
  67. /$22/*+$01DA
  68. /$11/*+$022E
  69. /$A7
  70. /$ED/$52
  71. /$DA/$A8/$20
  72. /$3E/$FF
  73. /$CD/*+$0039
  74. /$32/*+$0203
  75. /$32/*+$0178
  76. /$32/*+$0185
  77. /$E1
  78. /$7E
  79. /$32/*+$001F
  80. /$E5
  81. /$CB/$7F
  82. /$CC/*+$0025
  83. /$2A/NCLIB
  84. /$7C
  85. /$B5
  86. /$20/$22
  87. /$11/$00/$00
  88. /$0E/$0F
  89. /$CD/$05/$00
  90. /$3C
  91. /$20/$17
  92. /$3E/$01
  93. /$E1
  94. /$F5
  95. /$36/$00
  96. /$3A/*+$01D7
  97. /$CD/*+$0007
  98. /$F1
  99. /$32/$D0/$00
  100. /$C9
  101. /$5F
  102. /$0E/$20
  103. /$C3/$05/$00
  104. /$11/NCSECBUF
  105. /$0E/$1A
  106. /$CD/$05/$00
  107. /$ED/$5B/*+$FFD5
  108. /$0E/$21
  109. /$CD/$05/$00
  110. /$B7
  111. /$3E/$99
  112. /$20/$D5
  113. /$3E/$00
  114. /$A7
  115. /$20/$34
  116. /$3E/$CE
  117. /$2A/NCSECBUF+0
  118. /$11/$31/$00
  119. /$ED/$52
  120. /$20/$C4
  121. /$2A/NCSECBUF+2
  122. /$11/$01/$21
  123. /$ED/$52
  124. /$20/$BA
  125. /$2A/NCSECBUF+10
  126. /$11/$64/$03
  127. /$ED/$52
  128. /$20/$B0
  129. /$18/$3C
  130. /$11/*+$000C
  131. /$06/$05
  132. /$1A
  133. /$BE
  134. /$C0
  135. /$23
  136. /$13
  137. /$10/$F9
  138. /$C9
  139. /$5A/$33/$45/$4E/$56
  140. /$21/$03/$01
  141. /$CD/*+$FFEA
  142. /$20/$22
  143. /$2A/$09/$01
  144. /$22/*+$0184
  145. /$21/NCSECBUF+3
  146. /$CD/*+$FFDC
  147. /$20/$14
  148. /$2A/$09/$01
  149. /$7C
  150. /$B5
  151. /$28/$0D
  152. /$7C
  153. /$32/*+$013C
  154. /$7D
  155. /$32/*+$0135
  156. /$3E/$01
  157. /$32/*+$0123
  158. /$AF
  159. /$32/$80/$00
  160. /$21/NCCMDLINE
  161. /$3E/$7E
  162. /$BE
  163. /$38/$01
  164. /$7E
  165. /$23
  166. /$EB
  167. /$6F
  168. /$26/$00
  169. /$19
  170. /$36/$1A
  171. /$CD/*+$0099
  172. /$28/$34
  173. /$D5
  174. /$21/$81/$00
  175. /$36/$20
  176. /$23
  177. /$06/$01
  178. /$1A
  179. /$FE/$1A
  180. /$28/$09
  181. /$CD/$A6/$04
  182. /$77
  183. /$13
  184. /$23
  185. /$04
  186. /$18/$F2
  187. /$74
  188. /$78
  189. /$32/$80/$00
  190. /$D1
  191. /$CD/*+$00A1
  192. /$D5
  193. /$11/*+$007D
  194. /$ED/$B0
  195. /$D1
  196. /$CD/*+$006D
  197. /$28/$08
  198. /$CD/*+$0092
  199. /$11/*+$007F
  200. /$ED/$B0
  201. /$11/$5C/$00
  202. /$21/*+$0067
  203. /$01/$20/$00
  204. /$ED/$B0
  205. /$2A/*+$00BA
  206. /$F9
  207. /$EB
  208. /$21/$80/$FF
  209. /$19
  210. /$22/*+$0088
  211. /$21/$21/$00
  212. /$19
  213. /$22/*+$00C9
  214. /$2A/*+$FEF9
  215. /$01/$24/$00
  216. /$ED/$B0
  217. /$D5
  218. /$21/$12/$00
  219. /$19
  220. /$22/*+$0078
  221. /$21/$37/$00
  222. /$19
  223. /$22/*+$00A6
  224. /$21/$74/$00
  225. /$19
  226. /$22/*+$00CE
  227. /$3A/*+$FF13
  228. /$A7
  229. /$21/$00/$01
  230. /$28/$03
  231. /$2A/NCSTART
  232. /$22/*+$00D2
  233. /$21/*+$0050
  234. /$01/$81/$00
  235. /$ED/$B0
  236. /$ED/$4B/NCLIB
  237. /$ED/$5B/$01/$01
  238. /$C8
  239. /$ED/$5B/NCSTART
  240. /$C9
  241. /$1A
  242. /$FE/$1A
  243. /$C8
  244. /$FE/$20
  245. /$C0
  246. /$13
  247. /$18/$F6
  248. /$00/$20/$20/$20/$20/$20/$20/$20/$20/$20/$20/$20/$00/$00/$00/$00
  249. /$00/$20/$20/$20/$20/$20/$20/$20/$20/$20/$20/$20/$00/$00/$00/$00
  250. /$CD/$EE/$03
  251. /$21/$5C/$00
  252. /$01/$10/$00
  253. /$3A/$69/$00
  254. /$3C
  255. /$C0
  256. /$0E/$0C
  257. /$C9
  258. /$21/$00/$00
  259. /$ED/$52
  260. /$30/$1B
  261. /$11/$00/$00
  262. /$0E/$09
  263. /$CD/$05/$00
  264. /$C3/$00/$00
  265. /$4F/$75/$74/$20/$6F/$66/$20/$6D/$65/$6D/$6F/$72/$79/$0D/$0A/$24
  266. /$C5
  267. /$D5
  268. /$0E/$1A
  269. /$CD/$05/$00
  270. /$11/$00/$00
  271. /$0E/$21
  272. /$CD/$05/$00
  273. /$D1
  274. /$C1
  275. /$B7
  276. /$20/$24
  277. /$3E/$00
  278. /$A7
  279. /$28/$0D
  280. /$AF
  281. /$32/$00/$00
  282. /$21/$09/$00
  283. /$19
  284. /$36/$00
  285. /$23
  286. /$36/$00
  287. /$21/$00/$00
  288. /$34
  289. /$20/$02
  290. /$23
  291. /$34
  292. /$21/$80/$00
  293. /$19
  294. /$EB
  295. /$0B
  296. /$78
  297. /$B1
  298. /$20/$A6
  299. /$D5
  300. /$11/$80/$00
  301. /$0E/$1A
  302. /$CD/$05/$00
  303. /$1E/$00
  304. /$0E/$20
  305. /$CD/$05/$00
  306. /$D1
  307. /$21/$00/$00
  308. /$A7
  309. /$ED/$52
  310. /$EB
  311. /$06/$FF
  312. /$70
  313. /$23
  314. /$1B
  315. /$7A
  316. /$B3
  317. /$20/$F9
  318. /$21/$00/$00
  319. /$C3/$00/$00
  320. )
  321. END;
  322.