home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 110_01 / read_me.doc < prev    next >
Text File  |  1984-03-03  |  6KB  |  155 lines

  1. 17 June 81
  2.  
  3.             Documentation for
  4.             C User's Group
  5.             Transmittal Disk
  6.  
  7. Robert Pasky
  8. 36 Wiswall Rd.
  9. Newton Centre, MA 02159
  10.     (617) 449-4600 x240    work (7-3 e.d.t.)
  11.     (617) 964-3641        home
  12.  
  13. Files contained on disk:
  14.  
  15. 1.    symbug.c    - converts "clink" .SYM output file to "vbug" format.
  16. 2.    symbug.com    - object file for same.
  17. 3.    prolog.c    - EPROM programmer utility.
  18. 4.    prolog.com    - object file for same.
  19. 5.    chargen.c    - character generator utility
  20. 6.    chargen.com    - object file for same.
  21. 7.    charset        - character descriptions for chargen program.
  22. 8.    bin2hex.c    - binary to hex-ascii format converter.
  23. 9.    bin2hex.com    - object file for same.
  24. 10.    printf.c    - _spr function modified for leading 0's.
  25. 11.    getc.c        - getc function modified for proper eof.
  26. 12.    disk.doc    - this file.
  27.  
  28.  
  29. 1. & 2. symbug
  30.  
  31.     This program was intended to convert the .SYM file produced by
  32. CLINK (and MAC) to a format compatible with VBUG, a symbolic debugger
  33. which I had previously written.
  34.  
  35.     Although it may not be of immediate use to others as written, it
  36. is a simple example of a file sorting routine.
  37.  
  38. 3. & 4. prolog
  39.  
  40.     A modification of Leor Zolman's earlier TELNET program, this
  41. transmits hex-ascii files from disk to a PRO-LOG(tm) EPROM programmer
  42. and verifies the contents of an EPROM against a hex-ascii file.
  43.  
  44.     This program should be easily modified for other PROM programmers,
  45. although I don't have any specific information on any of them.
  46.  
  47.     You should note that I am using memory-mapped i/o for the serial
  48. interface -- remove #define MMREFIO ... for inp/outp instead of peek/poke.
  49.  
  50.     Secondly, the masks and default values for PROM addresses assumes
  51. a 16k bit (2k byte) EPROM (2516, 2716 types). If you normally use other
  52. sizes, you will want to change the masks and defaults. If you program PROMS
  53. of 256 bytes or less, the program must be changed to send 2 digits
  54. instead of 3 for the starting and ending addresses to the PRO-LOG.
  55. You might add a "menu" allowing the user to select various size PROMs
  56. and change the masks and defaults accordingly.
  57.  
  58.     One thing this program doesn't do that perhaps it should is
  59. verifying the sumcheck bytes in the hex-ascii file. I'm assuming that
  60. if the disk file can be read sucessfully the sumcheck is probably correct.
  61.  
  62. 5. & 6. chargen
  63.  
  64.     This program was written when I purchased an Imsai VIO video
  65. interface board. I decided I wanted to modify the character set which
  66. was contained in three 2708 PROMs in an awkward to edit format.
  67.  
  68.     The screen displays a large box within which a 7x10 matrix of
  69. squares can be individually turned on or off. In this way a large-scale
  70. version of the character can be constructed, edited and then stored.
  71.  
  72.     When the entire character set is completed, the data are
  73. converted to the format required by the VIO logic and stored as a disk
  74. file. The disk file is a binary image of the three EPROMS used for
  75. upper case (0-0x7f), lower case (0x80-0xff) and descenders, respectively.
  76.  
  77.     If you will be using the "prolog" program, above, or something
  78. similar, you will need a hex-ascii version of this file. And so was
  79. born the "bin2hex" program.
  80.  
  81. 7. charset
  82.  
  83.     This file is the output of the "chargen" program. It can be
  84. used as a basis for creating your own character set.
  85.  
  86.     Use the 'g' function of "chargen" to get this file into memory,
  87. then the 'o' function to unformat it for editing. Finally, don't forget
  88. to re-format the data using the 'p' function before writing it back to
  89. disk with 'f'. If you do forget and save the unformatted file and then
  90. quit the program, most of it can be recovered. Get the file but don't
  91. unformat it (no 'o'), the end of the data (i.e., characters somewhere
  92. above 0x80) may be missing.
  93.  
  94.  
  95. 8. & 9. bin2hex
  96.  
  97.     This is a simple program to convert a binary file (e.g. .COM files)
  98. to a hex-ascii file.
  99.  
  100.     It takes as input any file and produces a .HEX type file of the
  101. same name. The user may specify any starting address, and all data are
  102. assumed to be contiguous. The program produces blocks of 32 bytes of data
  103. each, with a proper sumcheck byte at the end of the block.  The final
  104. block contains a zero count and zero address as required by most hex
  105. loaders, including the LOAD.COM program of CP/M.
  106.  
  107.     Since the program cannot assume that a 0x1a byte means an
  108. end-of-file, it may produce some extraneous data at the end of the
  109. hex file. However, if you have set NSECTS to a number greater than 1
  110. (as I have), the standard "getc" function may produce a lot more
  111. garbage than necessary. The modification to "getc" supplied on this disk
  112. attempts to minimize the problem. An alternative, of course, is to leave
  113. NSECTS at 1.
  114.  
  115. 10. printf
  116.  
  117.     The _spr() function modified to optionally print leading zeros.
  118. To specify leading 0's, use a leading 0 in the field length. See K&R,
  119. section 7.3.
  120.  
  121. For example,
  122.         num = 123;
  123.         printf ("\nleading zeros %05d", num);
  124.         printf ("\nno zeros %4d", num);
  125.         printf ("\nleft justified %-04d", num);
  126.         printf ("\nleft justified %-4d", num);
  127.     will print:
  128.         leading zeros 00123
  129.         no zeros   123
  130.         left justified 00123
  131.         left justified 123
  132.  
  133.     This is often used when printing hex or octal addresses, for
  134. instance, to print a "split octal notation" address, use:
  135.         address = 512+10;
  136.         printf ("%03o.%03o",address);
  137.     to get:
  138.         002.012
  139. 11. getc
  140.  
  141.     The getc() function modified to calculate "nleft" from the
  142. actual number of sectors read. This change is useful only if "NSECTS"
  143. is greater than 1, and you wish to read binary files as, for example,
  144. the "bin2hex" program does.
  145.  
  146.     The problem is that if you have set NSECTS to 8, for example,
  147. and the file has 9 sectors, the "getc" function (if you call it repeatedly
  148. without checking for the eof character, 0x1a) will hand you 16 sectors
  149. worth of data, the last 7 of which are leftovers from the previous 8
  150. sectors.
  151.  
  152.     This modification will minimize the problem by returning the
  153. ERROR flag after the last (9th in this example) sector has been read.
  154.  
  155.