home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / PROGPACK / TXT2DB10.LBR / TEXT2DB.HZT / TEXT2DB.HST
Text File  |  2000-06-30  |  13KB  |  289 lines

  1. Al,
  2. Here's the framework, but much of the shell still needs to be
  3. built - things like dcb's, init, etc.  Things that might be
  4. more "fun" are proc and its associated routines.  I have taken
  5. a very simpleminded approach to these that you could doubtless
  6. do in a more elegant manner.  At any rate, the structure is 
  7. there and there shouldn't be any "surprises" buried several
  8. levels deep.  Most routines save any registers that aren't used
  9. in passing values back to the caller.
  10.  
  11. As I'm sure you will notice, some of the init code is boilerplate
  12. that I developed to cut down the drudgery.  Much can probably be
  13. deleted.  Do we want to limit ourselves to only those routines
  14. that can be used on vanilla CP/M systems?
  15. (aeh reply) NO. Those who use this program are programmers,
  16. and can be expected to have zcpr3, at least???
  17.  
  18. At any rate, have some fun with it and let's see what we can
  19. come up with.  I'll hold off on playing with it while you have
  20. some fun!
  21.  
  22. - Cam
  23.  
  24. 6/18/89 - added routine(s) TPOWR
  25. aeh    - boilerplate in configuration area. The DS at the end
  26.     of the cnfg area can be removed after options are stable.
  27.     - filled in buffer allocation
  28.     - filled in file open routines
  29.     - filled in synlbl routine
  30.     - routines marked this way need something    <=========
  31.  
  32. The only place screen drivers would be used is for the help screen
  33. and error messages, I think. Do we need that?
  34.  
  35. ....
  36. 6/19/89 - added fslbot flag to eliminate conflicts with synthetic
  37. cwc      label request flag fslbl.
  38.     - synthetic label numbers start at user 0 rather than one.
  39.     - changed buffer calc to use z3lib gzmtop call so extended 
  40.       env calcs would be correct (note: this REQUIRES a z system).
  41.     - proc loop logic now complete(?). output file will always be
  42.       terminated if at least one ^Z read from input stream.
  43.     - added calls to retud and logud.
  44.     - added cfg entry for output file type default.
  45. Noted possible limitation of FXx routines is that no DU is associated
  46. with the DCB, forcing all DCB's to refer to same DU.  The net result
  47. of this is we must force the output file to the same DU as the source
  48. file (which probably isn't all that bad).
  49. Parse and help remain...
  50. ....
  51. 6/21/89    - added parse and help
  52. aeh    - srcdu (and dstdu) determined in parse
  53.     - HELP is a parse function
  54.     - FSpecs & options are processed in parse
  55.     - slabel, header in config area now used only to
  56.       initialize a working copy in data area. 
  57. If we choose to ignore vanilla CP/M, then the DU2BC routine gets
  58. simplified.
  59.  
  60. DSTDU, though present, is unused. I agree that processing src and dst
  61. in the same directory is Ok, and users would seldom want otherwise.
  62.  
  63. Option processing looks reasonably flexible. Any suggestions for
  64. making it a little more idiot-proof?
  65.  
  66. The HELP screen (an include file) remains. Should we let it generate
  67. its own screen? After fumigaton, that is...
  68. ....
  69. 6/23/89    - First round of fumigation.  Key bugs found and killed:
  70. cwc    - Register saves in several routines weren't right.
  71.     - Added logic in QUOTE to issue a closing comma if needed.
  72.     - DU2BC now returns drive correctly if none speced on cl.
  73.     - Open of input and output file now cause abort if error.
  74.     - Moved CR to list of chars that DO NOT cause a line wrap
  75.       in the output file.
  76.     - Fixed logic state reversal in line TSTNL.
  77.     - Fixed improper table address sent to procn1.
  78.     - Fixed normal exit from TSTNL.
  79.     - Added "dummy" help message.  Agree that first test for
  80.       program is generation of its own help screen.
  81.  
  82. Not tested yet is synthetic label generation, operation from a
  83. specified DU, specing options or two file names.  Thought I would 
  84. let you have some fun as well.
  85.  
  86. I think we can go ahead and assume a Z system.  We already trap
  87. non-Z and exit if there's no env.  Once we get things sorted out,
  88. I think we need to provide a little feedback to the user to reassure
  89. him that nothing crashed and also make the error messages a bit
  90. more informative.  Perhaps we should control these added messages
  91. with the ZCPR quiet flag as well as a patchable quiet flag (or them).
  92. ....
  93. 06/24/89- Re-arranged proc so synthetic label processed before 
  94. cwc      comma output.
  95.     - Fixed DU2BC for proper drive values.
  96.  
  97. The command line option for synthetic labels needs fixing.  Currently
  98. any attempt at options gives help.
  99. ....
  100. 06/26/89- Fixed FIRSTLBL so option(s) work. EVAL10 was returning Cy set,
  101. aeh      and MA3DC just passed it on (or set cy itself!).
  102.     - Added 8080 test routine at pgm start (pgm abort on 8080)
  103.     - commented out some CP/M 2.2 code in DU2BC. If you agree, please
  104.       erase it.
  105.     - Modified Synthetic label number processing to use the Configured
  106.       default (which might be 000) when not given in the command line
  107.       switch. I think this is what you referred to on the phone, and
  108.       I was being a little dense!
  109.     - Converted DSEG area to all DS statements, since all are
  110.       initialized as needed during startup (and restart, I hope!)
  111.     - Removed dummy Help to an included file, ready for rework.
  112. 06/27/89- Revised configuration data for compatibility with ZCNFG,
  113. aeh      added routines in PARSE initialization to translate space
  114.       terminated strings to null terminated ones. New routines
  115.       REFORM, CPYSTR. White space around 'db' string and the
  116.       string itself are labeled. The labels are for reference, and
  117.       are used as offset values in the .CFG file. (The table of
  118.       offsets is extracted and edited from a PRN listing)
  119.     - Added error messages for faulty open & close of I/O files.
  120.     - Added initialization of the output FCB FN,FT fields so that
  121.       default logic works properly. The default logic could have been
  122.       modified, but would then not work properly on re-execution with
  123.       'GO'.
  124.     - My editor (PMATE) can enter a null in the text, but internally
  125.       the null is used to mark the end of text! Further, control
  126.       characters are displayed during edit (01h displayes ^A); nothing
  127.       qualifies as 'non-printing' to the editor! I suspect many other
  128.       editors will behave similarly. So the trigger character must
  129.       definitely be configurable!
  130. 06/28/89- Used TEXT2DB to make the screen for its own .cfg file. 
  131.     - Modified the configuration block and its use - made a binary
  132.       toggle selection for the delimiter (space or tab) around the
  133.       'DB' in the header. The configured default label is done in
  134.       ASCII text mode, which means that someone could put text in
  135.       the number field (the text2db program will either barf or
  136.       produce strange labels). These changes result only from
  137.       limitations of ZCNFG. TEXT2DB now seems to be operational.
  138.     - Fixed error in CHRPUT - the JR Z,<tab present> occurred before
  139.       HL was pointed to LCHCNT with the result that the TAB char in
  140.       the header string (to which HL points) was being replace with
  141.       the next tab stop position. Switching the two instructions got
  142.       it working right.
  143. 06/29/89
  144. (aeh)    The configuration file is done and working. You might want to
  145. reword the configuration help, or the menus, etc.
  146. Note that the default trigger character is an accent mark (60h) which
  147. you will probably want to change with ZCNFG (or reassembly) before using
  148. on your own files. The ACCENT is used in the menu screen source.
  149.     All that remains is the main HELP screen (T2DBHELP.DB) and any
  150. final clean up of the source code. Perhaps now is the time to use
  151. VPRINT and dress up the displays a bit.
  152.     The program is strictly I/O bound, as it should be. Fast and easy.
  153. My nomination for a name is evident, but not cast in concrete. Got 
  154. another candidate?
  155. ......
  156. 7/8/89
  157. cwc       - Added help screen (generation by TEXT2DB), cleaned up
  158.             formatting of source code and added comments.  Opted 
  159.             to not use standout and other VLIB functions to keep it
  160.             simple.  I don't have any strong opinion in this, but 
  161.             I don't think we need the extra code.
  162. ......
  163. 7/17/89
  164. from jw
  165.  Some modest changes to my taste..  JWW  15 July 89
  166.  
  167.  LINK COMMANDS:  (Generate TEXT2DB.SYM)
  168.     ZMACLNK TEXT2DB /M
  169.     SLRNKP TEXT2DB/N,/A:100/J,TEXT2DB,TEXT2DB/M,/E
  170.     LINK TEXT2DB
  171.  
  172.   1.  Removed default input file type check.  There is no good
  173.       reason to force a blank type to TXT or anything else.
  174.       (As you can tell, I normally use blank types.)
  175.  
  176. (aeh) I recommend restoring this. The default can be set to a
  177.       a blank field or whatever the user wishes.
  178.  
  179.   2.  Apostrophes (Quotes) appearing in the text are now
  180.       treated as normal characters and 'doubled' when
  181.       encountered within our own Quotes.  We might consider
  182.       making QUOT a configurable option, either '"' or "'". (?)
  183.  
  184. (aeh) That could be done, but I don't see the point. The '"'/"'"
  185.       is primarily a convenience for *manual* programming....
  186.  
  187.   3.  We now keep track of the previous character and so wrap at
  188.       right margin is AFTER a space (TSTNL:).
  189.  
  190.   4.  FXO$OPEN does not, and should not, delete an existing file.
  191.       Added call to F$DELETE before FXO$OPEN for our purposes.
  192.  
  193.   5.  Exit directly from PROC0: on End of File without extraneous
  194.       CR/LF pair to outfile that FORCN0: provides.
  195.  
  196.   6.  Error return from FX$GET indicates zero-length input file or
  197.       that the last record was exactly full.  As we can't tell the
  198.       difference, we now read the first character from the Input file
  199.       immediately after opening it (saved in CURCHR).    Error here
  200.       means Zero-length.  In PROC0:, an error means Physical End
  201.       of File.  We simply supply a 1Ah character and continue.
  202.  
  203.   7.  Changed TSTNL: again to force new line after 75 characters
  204.       whether Controls, Space or not so as not to wrap the screen
  205.       with an otherwise interminable string of ascii characters.
  206.  
  207. (aeh) Since the object of this program is to produce a file for the
  208.       Assembler (human readability is lower priority), I'm not sure
  209.       I agree with this. What if the user *wants* 96 char lines?
  210.       If there IS an absolute maximum, then I suppose it should be
  211.       configurable. Might some assemblers gag on a string that's
  212.       too long?
  213.  
  214.   8.  Allow SLCODE as first character of a line.
  215.  
  216.   9.  LBLCNT was cleared at PROC: which over-rode the /S option. (?)
  217.  
  218. (aeh) Right. A left-over from before the option..
  219.  
  220.  10.  Changed INCLUDE statements to treat .LIB rather than .DB files.
  221.       for wider (M80) compatibility.  Still compatible with ZMAC,
  222.       Z80ASM, etc.  INCLUDE and MACLIB are not exactly interchangeable.
  223.       INCLUDE files should hold code or data statements to be included
  224.       in the assembly.  INCLUDE files are read on both passes of a
  225.       of a two-pass assembly.  MACLIB should be used for Macros and 
  226.       Equates (not code or data) and need only be read on the first
  227.       pass of the assembler (Z80ASM).  Both should be of type .LIB
  228.       for M80 compatibility.
  229.  
  230.       There are a number of minor changes to various routines just
  231.       because I couldn't help myself.  Nature of the beast.  In any
  232.       case, I hope you will find these contributions worthwhile.
  233. .......
  234.  
  235. (aeh) - V0.9 - 7/23/89
  236.  
  237. JWW#1 - The check on the input file type was restored, since the default
  238.     is configurable.
  239.  
  240. JWW#2 - The character TEXT2DB uses for quoting is now configurable (Qchar)
  241.  
  242. JWW#3 - Line break before/after a space is now a T/F byte in the 
  243.     configuration area. The code HAS NOT been installed to use this
  244.     byte within TEXT2DB, but the CFG file will maintain it.
  245.  
  246. JWW#7 - Absolute Maximum line length in the output file is now a config
  247.     option. CFG permits values from 30 to 255. The lower value is to
  248.     guard against a rediculous value like 0 for the line length.
  249.  
  250. The trigger character can now quote itself as a result of code called
  251. from the CLASSIFY routine. This function, and the need for special
  252. treatment at the first file position for a synthetic label, prompted
  253. a review of the program flow. A number of changes were made (all
  254. consistent with the original design, I think) which result in the
  255. newline, label, and header functions being located in one section of
  256. the main PROC loop, controlled by flags that can be reset as required
  257. by the trigger quote. This also made it possible to allow for the
  258. initial (boundary) condition. A side effect was to trade the INITIAL
  259. for a FINAL special case! A CRLF call at the end is now required to
  260. complete the last line.
  261.  
  262. Configuration logic was modified for the DELIMT string; the user now
  263. puts in any legal byte argument for a DB statement. Previously, only
  264. the '0' would work!
  265.  
  266. A new CFG file accompanies this version.
  267.  
  268. YET TO BE DONE - Logic/code to implement terminal space location during
  269. line fold. (Joe's item 3)
  270.  
  271. ......
  272.  
  273. (cwc) - V0.a - 24 July 89
  274.  
  275. Added logic for space during line fold.  Prior logic was in error 
  276. due to failure to save the character type for the prior char.  
  277. This could result in some "funny" decisions being made.  State now
  278. saved when prior char saved.
  279.  
  280. Added some additional commenting in PROC and PGMINIT.
  281. ......
  282.  
  283. (aeh) -V1.0 - 25 July 89
  284.  
  285. Looking good! NEAT'd the source file, installed version number. This is
  286. the Release Version, ready for BETA test. Target for release to PD should
  287. be about 30 days, I think, to give BETA testers a chance to respond.
  288. ......
  289.