home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / asmutl / form7.lbr / FORM7.DQC / FORM7.DOC
Encoding:
Text File  |  1985-05-14  |  7.8 KB  |  197 lines

  1.  
  2.   FORM7 - Formats, changes colons and tabs in source code - 04/27/85
  3.  
  4.               COPYRIGHT 1984, 1985
  5.              Irv Hoff W6FFC
  6.  
  7.   This program places colons after labels in source code files.  It can
  8.   do a variety of other things as indicated in the menu that comes up
  9.   each time the program is requested:
  10.  
  11.         0) remove all colons from labels
  12.         1) add colons to all labels
  13.         2) colons for M80 assemblers
  14.         3) colons for 8086 assemblers
  15.         4) all source code to lower-case
  16.         5) remove tabs, case unaffected
  17.           * 6) inline comments to column 32
  18.           * 7) inline comments to column 40
  19.           * 8) reformat source code (col 32)
  20.           * 9) reformat source code (col 40)
  21.           = a) inline comments to lower-case
  22.           = b) full line comments to lower
  23.            (then asks for a reselect)
  24.  
  25.             select: x
  26.  
  27.     * require a string of characters to match before starting
  28.         (Typing a RETURN will start immediately)
  29.     = only work with the selections having a "*" on them
  30.         (can use both "a" and "b" or either one)
  31.  
  32.  
  33.       Selection 2) is primarily for Microsoft M80 assemblers with
  34.       8080 or Z80 code.  It requires colons after all labels with
  35.       the exception of no colons after labels in EQU lines.
  36.  
  37.       Selection 3) is for 8086 assemblers, which require colons af-
  38.       ter all labels with the exception of DB, DD, DW, RB, RS, RW
  39.       and EQU lines.
  40.  
  41.       Selection 4) makes all source code lower-case, does not affect
  42.       DB strings or existing colons.
  43.  
  44.       Selection 5) removes all tabs, replacing with an appropriate
  45.       number of spaces.  Does not change any source code to upper-
  46.       case, thus can be used on both ASCII text or source code files.
  47.       Normally gives identical CRC check with programs using the [T8]
  48.       option on PIP, but is faster and gives a results summmary.
  49.  
  50.       Selection 6) does not affect any colon, but moves all inline
  51.       comments to a minimum of column 32 for neat appearance.  (This
  52.       is controlled by byte 0106H.)
  53.  
  54.       Selection 7) is same as 6) but moves comments to a minimum of
  55.       column 40.  (This is controlled by byte 0107H.)
  56.  
  57.       Selection 8) removes all tabs, then reformats all source code
  58.       to a standard appearance with comments moved to column 32.
  59.       (This is controlled by byte 0108H.)  This is a very intelligent
  60.       routine with lots of hidden features.
  61.  
  62.       Selection 9) is the same as 8, but moves comments to column 40
  63.       which is preferred by most 8086 users.  (This is controlled by
  64.       byte 0109H.)
  65.  
  66.       Selection a) will set the inline comments to lower-case for
  67.       options 6-9.  (Still supports the first letter being capitalized
  68.       if desired.)  Then asks for a reselect after it sets the flag.
  69.       Leaves any upper-case text between double quotes in upper-case.
  70.  
  71.       Selection b) will set the full line comments to lower-case for
  72.       options 6-9.  Then asks for a reselect after it sets the flag.
  73.       May be used in conjunction with, or independent of, selection a).
  74.       Leaves any upper-case text between double quotes in upper-case.
  75.  
  76.     NOTE:     IF USING A 1-4 SELECTION TO HANDLE COLONS AS
  77.          WELL AS REFORMATTING WITH 8 OR 9, DO THEM IN
  78.          THAT ORDER.  THIS ALLOWS THE REFORMATTING MAX-
  79.          IMUM LEEWAY IN HANDLING LABELS OVER 7 COLUMNS.
  80.          (IN OTHER WORDS, 'GO UP' IN NUMBERS IF USING
  81.          8 OR 9 TO REFORMAT.  ELSE ANY ORDER IS FINE.)
  82.  
  83.  
  84.     CAUTION: ANYTHING IN THE FIRST COLUMN IS CONSIDERED TO
  85.          BE A LABEL OR A COMMENT, WITH THE EXCEPTION OF
  86.          'TITLE' WHICH IS TREATED AS A COMMENT.  THERE
  87.          ARE NO OTHER 'RESERVED' WORDS FOR THAT COLUMN.
  88.          YOU MAY NEED TO CHECK THE LABELS MANUAULLY TO
  89.          MAKE SURE EVERYTHING IN THAT COLUMN IS NORMAL.
  90.  
  91.  
  92.   The program counts the original spaces and tabs, removes all tabs and
  93.   then places tabs wherever possible.  The tabs are placed for standard
  94.   CP/M intervals of "every 8" columns.    It pads the end of the file with
  95.   CTL-Z (end-of-file) characters.  When the file is finished it displays
  96.   the original and the current space count, tab count and the number of
  97.   colons present.
  98.  
  99.   A tab is placed at any location it can until it comes to a semicolon
  100.   (delimiter for text comments).  It will still tabulate in the text
  101.   comments, but does not substitute a tab for a single space as nothing
  102.   would be gained.  It also protects the space between 'quotes' and does
  103.   not replace any spaces with tabs.
  104.  
  105.   Note:  Some prefer a space after the ';' for source line comments.
  106.      To get this feature, change byte 105H from 00 to FF, then
  107.      save 16 pages with a new name.  This only works with options
  108.      6-9.  Some like a capital letter in the first column of the
  109.      source line comments.    To get this feature, change byte 0104
  110.      from 00 to FF.  This only works for options 6-9.  Byte 0103
  111.      changes the rate at which the line count progress is shown.
  112.      DDT, etc. can be used to make any of these easy changes, then
  113.      save 16 pages and rename the program as desired.
  114.  
  115.   ---------------------------------------------------------------------
  116.  
  117.      (* = normal default settings)
  118.  
  119.      Byte 103   07H  for every 8 lines (slow floppies)
  120.           * 0FH  for every 16 lines (fast floppies)
  121.             1FH  for every 32 lines (normal hard disks)
  122.             3FH  for every 64 lines (fast hard disks)
  123.      Byte 104 * 00H  does not affect first inline comment character
  124.             FFH  capitalizes first incline comment character
  125.      Byte 105 * 00H  inline comment text follows the semicolon
  126.             FFH  one space between inline semicolon and comment
  127.      Byte 106 * 20H  puts comments to column 32 for option 6
  128.      Byte 107 * 28H  puts comments to column 40 for option 7
  129.      Byte 108 * 20H  puts comments to column 32 for option 8
  130.      Byte 109 * 28H  puts comments to column 40 for option 9
  131.      Byte 10A * 08H  puts instructions in column x (8 normal)
  132.  
  133.      These additional features give an unusual versatility to
  134.      this program.
  135.  
  136.   ---------------------------------------------------------------------
  137.  
  138.   DISPLAYS UPON COMPLETION:
  139.   ------------------------
  140.  
  141.         total lines in the file
  142.  
  143.            original spaces
  144.            original tabs
  145.            original colons after labels
  146.  
  147.            current  spaces
  148.            current  tabs
  149.            current  colons after labels
  150.            trailing spaces deleted
  151.  
  152.                     - notes by Irv Hoff W6FFC
  153.  
  154.   ---------------------------------------------------------------------
  155.  
  156.   To use:
  157.  
  158.     B>FORM HELLO.ASM           (1)
  159.     B>FORM HELLO.ASM NUNAME.ASM       (2)
  160.     B>FORM A:HELLO.ASM           (3)
  161.     B>FORM A:HELLO.ASM B:NUNAME.ASM    (4)
  162.  
  163.     (1)  Sets tabs in a file named HELLO.ASM.  When finished the original
  164.        file is named HELLO.BAK and the new file has the normal name.
  165.     (2)  The original file keeps the original name.  The new file is now
  166.        named NUNAME.ASM.
  167.     (3)  Just shows you can use two disks.  The backup file will be on
  168.        the same disk as the original and assumes the original name.
  169.     (4)  The original file remains intact, the new file is on another
  170.        drive and is named NUNAME.ASM.
  171.  
  172.   ---------------------------------------------------------------------
  173.  
  174.   04/27/85  v7    Accepts lines up to 255 characters long (vice 128).  In-
  175.         sures last line has CR-LF to allow normal processing.
  176.                     - Irv Hoff
  177.  
  178.   03/07/85  v6    Fixed ERXIT so external file is not deleted unless a 'Y'
  179.         is used.        - Irv Hoff
  180.  
  181.   11/20/84  v5    'b' puts full line comments lower-case for options 6-9.
  182.           Requests a string of chars. for a starting location
  183.           for options 6-9 (typing RETURN starts immediately.)
  184.                     - Irv Hoff
  185.  
  186.   11/15/84  v4    'a' puts inline comments lower-case for options 6-9.
  187.                     - Irv Hoff
  188.  
  189.   11/11/84  v3    Added instruction column option
  190.                     - Irv Hoff
  191.  
  192.   11/07/84  v2    Added several features    - Irv Hoff
  193.  
  194.   11/01/84  v1    Original version    - Irv Hoff
  195.  
  196.   ---------------------------------------------------------------------
  197.