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 / AFTER8C.TXT < prev    next >
Internet Message Format  |  2009-12-11  |  4KB

  1. From: "French Luser" <Bill.Ga...@microsoft.com>
  2. Newsgroups: comp.os.cpm
  3. References: <419f187a$0$7241$8fcfb975@news.wanadoo.fr> <41a45904$0$9082$8fcfb975@news.wanadoo.fr>
  4. Subject: Re: AFTER8 File Format
  5. Date: Tue, 30 Nov 2004 15:04:52 +0100
  6. X-Priority: 3
  7. X-MSMail-Priority: Normal
  8. X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
  9. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
  10. X-RFC2646: Format=Flowed; Original
  11. Lines: 120
  12. Message-ID: <41ac7e04$0$24832$8fcfb975@news.wanadoo.fr>
  13. Organization: les newsgroups par Wanadoo
  14. NNTP-Posting-Host: APoitiers-106-2-3-17.w81-248.abo.wanadoo.fr
  15. X-Trace: 1101823492 news.wanadoo.fr 24832 81.248.43.17:52316
  16. X-Complaints-To: abuse@wanadoo.fr
  17.  
  18. AFTER8C.TXT  by Emmanuel ROCHE
  19. -----------
  20.  
  21. The more you play with AFTER8 ComManD files, the more fun it is.
  22. ("The only difference between men and boys is the price of their
  23. toys...")
  24.  
  25. However, there is a slight problem: the fact that the  "program"
  26. file needs an exact copy of the "Subroutine Table"  contained in
  27. the RTS file...
  28.  
  29. After making  this  table  a  few times  manually, I  decided to
  30. finally let my computer work a little!
  31.  
  32. So, I did a SUBTAB program, producing an INC file  that will  be
  33. loaded by ASM-86 at  assembly time  of the  "program" file.   An
  34. added  bonus  is  that  the source  file of  the "program"  file
  35. contains now only
  36.  
  37.         INCLUDE filename.INC
  38.  
  39. As a result, the listing appears  much neater.  However, if  you
  40. write a demo "program" by hand, it is easier to  be able  to see
  41. the Subroutine Table inside the  file, at  the beginning  (or to
  42. print it).
  43.  
  44. Example of use:
  45.  
  46. Sub_Tab> Enter A86 File Name: diyrts
  47.  
  48. Ok
  49.  
  50. That's all! As you can see, no need to open a Window...
  51.  
  52. Note that the whole thing could be put in a submit file, and the
  53. full process of generating  an AFTER8  file from  two A86  files
  54. could  be  automated. I  will provide  such a  file in  the near
  55. future.
  56.  
  57. For example, here are some lines from the INC file produced:
  58.  
  59. Chk_CPMP EQU     0
  60. Bak_CPMP EQU     1
  61. (...)
  62. Set_Segment_X2 EQU 29
  63. Set_Segment_X3 EQU 30
  64. Set_Segment_X4 EQU 31
  65.  
  66. The original A86 file contained the following:
  67.  
  68. ;--------------------------------
  69.  DSEG $
  70. ;--------------------------------
  71. Sub_Tab: ; Table of Subroutines
  72. ;
  73. Chk_CPMP EQU     0! DW      Sub_Chk_CPMP
  74. ;
  75. Bak_CPMP EQU     1! DW      Sub_Bak_CPMP
  76. ;
  77. (...)
  78. ;
  79. Set_Segment_X2 EQU 29! DW Sub_Set_Segment_X2
  80. ;
  81. Set_Segment_X3 EQU 30! DW Sub_Set_Segment_X3
  82. ;
  83. Set_Segment_X4 EQU 31! DW Sub_Set_Segment_X4
  84. ;
  85. ;-------------------------------- Start of Subroutines
  86.  CSEG $
  87. ;-------------------------------- 0
  88.  
  89. So, I decided to parse the  A86 file  until the  Sub_Tab: label,
  90. then  not  include the  empty lines  beginning with  a semicolon
  91. (";"), but include the lines defining the command  bytes of  the
  92. "program", but not the  DWs (else,  they would  be found  in the
  93. DSEG, with potential catastrophic results).
  94.  
  95. Here is the silly little program that does this. (I  should have
  96. timed the time it took me to write  it. BASIC  is wonderful  for
  97. writing those kind of little utilities.) Very useful if you want
  98. to experiment with AFTER8 files.
  99.  
  100. list
  101. 10 REM SUBTAB.BAS  by Emmanuel ROCHE
  102. 20 :
  103. 30 PRINT
  104. 40 INPUT "Sub_Tab> Enter A86 File Name: " ; file$
  105. 50 file1$ = file$ + ".A86"
  106. 60 file2$ = file$ + ".INC"
  107. 70 OPEN "I", #1, file1$
  108. 80 OPEN "O", #2, file2$
  109. 90 :
  110. 100 INPUT #1, line$
  111. 110 IF EOF(1) THEN GOTO 230
  112. 120 IF LEFT$ (line$, 8) = "Sub_Tab:" THEN GOTO 150
  113. 130 GOTO 100
  114. 140 :
  115. 150 INPUT #1, line$
  116. 160 IF LEFT$ (line$, 5) = ";----" THEN GOTO 230
  117. 170 IF LEFT$ (line$, 1) = ";" THEN GOTO 150
  118. 180 FOR i = 1 TO LEN (line$)
  119. 190     IF MID$ (line$, i, 1) = "!" THEN PRINT #2, LEFT$ (line$, i-1)
  120. 200 NEXT i
  121. 210 GOTO 150
  122. 220 :
  123. 230 line$ = CHR$ (26) : PRINT #2, line$  ' EOF needed for ASM-86...
  124. 240 CLOSE
  125. 250 PRINT
  126. 260 END
  127.  
  128. system
  129. A>That's all, folks!
  130.  
  131. Yours Sincerely,
  132. "French Luser"
  133.  
  134.  
  135. EOF
  136.