home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / DRI-archive / roche / AFTER8A.TXT next >
Internet Message Format  |  2009-12-11  |  13KB

  1. From: "French Luser" <Bill.Ga...@microsoft.com>
  2. Newsgroups: comp.os.cpm
  3. Subject: AFTER8 File Format
  4. Date: Sat, 20 Nov 2004 11:14:52 +0100
  5. X-Priority: 3
  6. X-MSMail-Priority: Normal
  7. X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
  8. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
  9. Lines: 293
  10. Message-ID: <419f187a$0$7241$8fcfb975@news.wanadoo.fr>
  11. Organization: les newsgroups par Wanadoo
  12. NNTP-Posting-Host: APoitiers-106-2-3-133.w81-248.abo.wanadoo.fr
  13. X-Trace: 1100945531 news.wanadoo.fr 7241 81.248.43.133:21796
  14. X-Complaints-To: abuse@wanadoo.fr
  15.  
  16. AFTER8A.TXT
  17. -----------
  18.  
  19. Looking after 8 segments, again...
  20.  
  21. Back  home,  after  discovering  that  I  was not  the only  one
  22. (surprisingly) thinking about CP/M-86  (Plus) CMD  files with  8
  23. segments, I decided to automate the process of creating them, in
  24. order to play with them in the near future.
  25.  
  26. The big advantage of the AFTER8  file format  is that  no change
  27. need  to  be  done  to  any  CP/M-86 (Plus)  system or  utility,
  28. contrary to the Large Memory Model, which obliged DRI to  make a
  29. RUN.CMD utility just to load those files in  the TPA  of CP/M-86
  30. v1.x or Concurrent CP/M 1.0.
  31.  
  32. After more than one hour of  play, I  got the  following on  the
  33. screen of my CP/M-86 Plus system:
  34.  
  35. A>mbasic after8
  36. BASIC-86 Rev. 5.22
  37. [CP/M-86 Plus]
  38. Copyright 1977-1982 (C) by Microsoft
  39. Created:  5-Mar-82
  40. 62390 Bytes free
  41.  
  42. AFTER8> Enter 1st CMD File Name: ? CMDX4
  43.         Enter 2nd CMD File Name: ? CMDY4
  44.  
  45. Enter Destination CMD File Name: ? AFTER8
  46.  
  47. Pass 1
  48. Pass 2
  49.  
  50. Ok
  51.  
  52. Not very impressive, isn't it?
  53.  
  54. But let us have a look to the file AFTER8.CMD produced:
  55.  
  56. A>sid after8
  57. SID86 1.01   1/4/83
  58.      START      END
  59. CS 1CC1:0000 1CC1:007F
  60. DS 1CC9:0000 1CC9:017F
  61. ES 1CE1:0000 1CE1:007F
  62. SS 1CE9:0000 1CE9:007F
  63. X1 1CF1:0000 1CF1:007F
  64. X2 1CF9:0000 1CF9:007F
  65. X3 1D01:0000 1D01:007F
  66. X4 1D09:0000 1D09:007F
  67. #dcs:0
  68. 1CC1:0000 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  69. 1CC1:0010 20 43 6F 64 65 20 53 65 67 6D 65 6E 74 20 20 20  Code Segment
  70. 1CC1:0020 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  71. 1CC1:0030 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  72. 1CC1:0040 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  73. 1CC1:0050 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  74. 1CC1:0060 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  75. 1CC1:0070 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  76. 1CC1:0080 7F 00 00 C1 1C 00 7F 01 00 C9 1C 00 7F 00 00 E1 ................
  77. 1CC1:0090 1C 00 7F 00 00 E9 1C 00 7F 00 00 F1 1C 00 7F 00 ................
  78. 1CC1:00A0 00 F9 1C 00 7F 00 00 01 1D 00 7F 00 00 09 1D 00 ................
  79. 1CC1:00B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  80.  
  81. By the  way, if  you remember  the BASEPAGE.BAS  program that  I
  82. published  in  the  comp.os.cpm  Newsgroup many  years ago,  you
  83. should remember  that the  DS starts  with 8  areas holding  the
  84. Segments characteristics, each 6 bytes long.  Each area contains
  85. the length of the segment (3 bytes), then its base in the TPA (2
  86. bytes), then either the M80 Byte for the  CS or  an unused  byte
  87. for the other segments.
  88.  
  89. Since  then,  I did  not make  an assembly  language version  of
  90. BASEPAGE, but I hope that it is obvious that:
  91.  
  92. 1CC1:0080| 7F 00 00 C1 1C 00 = CS (1CC1)
  93. 1CC1:0086| 7F 01 00 C9 1C 00 = DS (1CC9)
  94. 1CC1:008C| 7F 00 00 E1 1C 00 = ES (1CE1)
  95. 1CC1:0092| 7F 00 00 E9 1C 00 = SS (1CE9)
  96. 1CC1:0088| 7F 00 00 F1 1C 00 = X1 (1CF1)
  97. 1CC1:008E| 7F 00 00 F9 1C 00 = X2 (1CF9)
  98. 1CC1:0094| 7F 00 00 01 1D 00 = X3 (1D01)
  99. 1CC1:009A| 7F 00 00 09 1D 00 = X4 (1D09)
  100.  
  101. as displayed  by  SID-86.   This  could be  useful to  an AFTER8
  102. program wanting to pass control to code in one of  the Auxiliary
  103. Segments...
  104.  
  105. (Those  Auxiliary  Segments  would  be perfect  to put  Run-Time
  106. System subroutines. This way, we would  have the  64K of  the CS
  107. available for the program. In fact, since there are 4  Auxiliary
  108. Segments but only one Code Segment,  it would  probably be  more
  109. reasonable to do the reverse: place the RTS in the CS, and  have
  110. the four X-Segments (4 * 64k = 256k!!!) contain the program...)
  111.  
  112. You  will  note  that  several Internet  programs running  under
  113. MS-DOS are smaller than 256K...
  114.  
  115. Stop dreaming. Back to our demo.
  116.  
  117. #d
  118. 1CC1:00C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  119. 1CC1:00D0 00 00 00 00 00 00 00 00 00 00 00 00 00 20 20 20 .............
  120. 1CC1:00E0 20 20 20 20 20 20 20 20 00 00 00 00 00 20 20 20         .....
  121. 1CC1:00F0 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00         ........
  122. 1CC1:0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  123. 1CC1:0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  124. 1CC1:0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  125. 1CC1:0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  126. 1CC1:0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  127. 1CC1:0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  128. 1CC1:0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  129. 1CC1:0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  130. #d
  131. 1CC1:0180 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  132. 1CC1:0190 20 44 61 74 61 20 53 65 67 6D 65 6E 74 20 20 20  Data Segment
  133. 1CC1:01A0 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  134. 1CC1:01B0 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  135. 1CC1:01C0 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  136. 1CC1:01D0 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  137. 1CC1:01E0 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  138. 1CC1:01F0 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  139. 1CC1:0200 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  140. 1CC1:0210 20 45 78 74 72 61 20 53 65 67 6D 65 6E 74 20 20  Extra Segment
  141. 1CC1:0220 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  142. 1CC1:0230 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  143. #d
  144. 1CC1:0240 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  145. 1CC1:0250 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  146. 1CC1:0260 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  147. 1CC1:0270 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  148. 1CC1:0280 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  149. 1CC1:0290 20 53 74 61 63 6B 20 53 65 67 6D 65 6E 74 20 20  Stack Segment
  150. 1CC1:02A0 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  151. 1CC1:02B0 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  152. 1CC1:02C0 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  153. 1CC1:02D0 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  154. 1CC1:02E0 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  155. 1CC1:02F0 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  156. #d
  157. 1CC1:0300 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  158. 1CC1:0310 20 20 20 58 31 20 53 65 67 6D 65 6E 74 20 20 20    X1 Segment
  159. 1CC1:0320 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  160. 1CC1:0330 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  161. 1CC1:0340 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  162. 1CC1:0350 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  163. 1CC1:0360 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  164. 1CC1:0370 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  165. 1CC1:0380 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  166. 1CC1:0390 20 20 20 58 32 20 53 65 67 6D 65 6E 74 20 20 20    X2 Segment
  167. 1CC1:03A0 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  168. 1CC1:03B0 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  169. #d
  170. 1CC1:03C0 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  171. 1CC1:03D0 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  172. 1CC1:03E0 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  173. 1CC1:03F0 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  174. 1CC1:0400 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  175. 1CC1:0410 20 20 20 58 33 20 53 65 67 6D 65 6E 74 20 20 20    X3 Segment
  176. 1CC1:0420 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  177. 1CC1:0430 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  178. 1CC1:0440 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  179. 1CC1:0450 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  180. 1CC1:0460 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  181. 1CC1:0470 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  182. #d
  183. 1CC1:0480 20 43 50 2F 4D 2D 38 36 20 50 6C 75 73 20 2D 2D  CP/M-86 Plus --
  184. 1CC1:0490 20 20 20 58 34 20 53 65 67 6D 65 6E 74 20 20 20    X4 Segment
  185. 1CC1:04A0 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  !"#$%&'()*+,-./
  186. 1CC1:04B0 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
  187. 1CC1:04C0 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
  188. 1CC1:04D0 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_
  189. 1CC1:04E0 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F `abcdefghijklmno
  190. 1CC1:04F0 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 00 pqrstuvwxyz{|}~.
  191. 1CC1:0500 10 01 EB A0 8B 16 10 01 8A 1E 12 01 33 C0 B0 80 ............3...
  192. 1CC1:0510 A2 BC 05 88 26 BD 05 E9 FA FC BB B4 05 81 07 80 ....&...........
  193. 1CC1:0520 00 B9 03 00 73 0E 43 43 FF 07 75 08 E2 F8 FE 06 ....s.CC..u.....
  194. 1CC1:0530 BC 05 D1 1F 74 1B F6 06 B4 05 FF 75 05 80 26 B5 ....t......u..&.
  195. #^C
  196.  
  197. Conclusion: AFTER8.BAS seems to  have produced  a viable  AFTER8
  198. ComManD file for CP/M-86 (Plus). At least, SID-86 accepts it.
  199.  
  200. I wonder if I should give you the program which does this magic?
  201.  
  202. Ha, well... I am too kind!
  203.  
  204. 10 REM AFTER8.BAS  for CP/M-86 Plus  by Emmanuel ROCHE
  205. 20 :
  206. 30 PRINT
  207. 40 INPUT "AFTER8> Enter 1st CMD File Name: " ; file1$
  208. 50 file1$ = file1$ + ".CMD"
  209. 60 OPEN "R", #1, file1$, 1
  210. 70 FIELD #1, 1 AS byte1$
  211. 80 :
  212. 90 GET #1, 10 : IF ASC (byte1$) = 0 THEN NrSeg1 = 1
  213. 100 GET #1, 19 : IF ASC (byte1$) = 0 THEN NrSeg1 = 2
  214. 110 GET #1, 28 : IF ASC (byte1$) = 0 THEN NrSeg1 = 3
  215. 120 GET #1, 37 : IF ASC (byte1$) = 0 THEN NrSeg1 = 4 ELSE GOTO 170
  216. 130 :
  217. 140 GET #1, &H80 : IF ASC (byte1$) <> 0 THEN GOTO 340
  218. 150 GOTO 220
  219. 160 :
  220. 170 PRINT
  221. 180 PRINT CHR$ (7) "ERROR: This CMD file has more than 4 Segments..."
  222. 190 PRINT
  223. 200 END
  224. 210 :
  225. 220 INPUT "        Enter 2nd CMD File Name: " ; file2$
  226. 230 file2$ = file2$ + ".CMD"
  227. 240 OPEN "R", #2, file2$, 1
  228. 250 FIELD #2, 1 AS byte2$
  229. 260 :
  230. 270 GET #2, 10 : IF ASC (byte2$) = 0 THEN NrSeg2 = 1
  231. 280 GET #2, 19 : IF ASC (byte2$) = 0 THEN NrSeg2 = 2
  232. 290 GET #2, 28 : IF ASC (byte2$) = 0 THEN NrSeg2 = 3
  233. 300 GET #2, 37 : IF ASC (byte2$) = 0 THEN NrSeg2 = 4 ELSE GOTO 170
  234. 310 :
  235. 320 GET #2, &H80 : IF ASC (byte2$) = 0 THEN GOTO 420
  236. 330 :
  237. 340 PRINT
  238. 350 PRINT CHR$ (7) "ERROR: This CMD file has LOADER Flag(s) set."
  239. 360 PRINT
  240. 370 PRINT "AFTER8 only works for CMD files without LOADER Flag(s),"
  241. 380 PRINT "since it cannot decide which LOADER Flag(s) should be copied."
  242. 390 PRINT
  243. 400 END
  244. 410 :
  245. 420 PRINT
  246. 430 INPUT "Enter Destination CMD File Name: " ; file3$
  247. 440 file3$ = file3$ + ".CMD"
  248. 450 OPEN "R", #3, file3$, 1
  249. 460 FIELD #3, 1 AS byte3$
  250. 470 :
  251. 480 PRINT
  252. 490 PRINT "Pass 1"
  253. 500 CLOSE #1
  254. 510 OPEN "R", #1, file1$, 1
  255. 520 WHILE NOT EOF(1) OR LOC(1) = 0
  256. 530       GET #1
  257. 540       IF EOF(1) THEN GOTO 570
  258. 550       LSET byte3$ = byte1$
  259. 560       PUT #3
  260. 570 WEND
  261. 580 :
  262. 590 PRINT "Pass 2"
  263. 600 CLOSE #2
  264. 610 OPEN "R", #2, file2$, 1
  265. 620 GET #2, &H80  ' Skip over Header Record
  266. 630 WHILE NOT EOF(2) OR LOC(2) = 0
  267. 640       GET #2
  268. 650       IF EOF(2) THEN GOTO 680
  269. 660       LSET byte3$ = byte2$
  270. 670       PUT #3
  271. 680 WEND
  272. 690 :
  273. 700 ' Now, relocate the Group Descriptors
  274. 710 :
  275. 720 CLOSE #2
  276. 730 OPEN "R", #2, file2$, 1
  277. 740 PUT #3, 9 * NrSeg1
  278. 750 FOR i = 1 TO NrSeg2
  279. 760     GET #2
  280. 770     LSET byte3$ = CHR$ (ASC (byte2$) + 4)
  281. 780     PUT #3
  282. 790     FOR j = 1 TO 8
  283. 800         GET #2
  284. 810         LSET byte3$ = byte2$
  285. 820         PUT #3
  286. 830     NEXT j
  287. 840 NEXT i
  288. 850 :
  289. 860 PRINT
  290. 870 CLOSE
  291. 880 END
  292.  
  293. (Regarding LOADER Flags: They  can be  added to  the AFTER8  CMD
  294. file after its creation.  GENRSX adds, of course, the RSX Footer
  295. Record at the end of the  CMD file.   The Concurrent  CP/M CHSET
  296. utility  (which  should  have  been named  SETHR, since  it sets
  297. Header Record fields in CMD files) can modify the other flags. I
  298. think it is also available under DOS Plus.)
  299.  
  300. A>That's all, folks!
  301.  
  302. Yours Sincerely,
  303. "French Luser"
  304.  
  305.  
  306. EOF
  307.