home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol226 / colons.doc < prev    next >
Encoding:
Text File  |  1986-02-13  |  2.8 KB  |  80 lines

  1. Documentation for COLONS.COM as of 05/06/84
  2.  
  3.  
  4. So you have M80 but not MAC, but that huge .ASM file gives you headaches
  5. because none of the labels has a colon, or all those EQUs have colons?
  6. Until today, the only thing you could do was to carefully edit the file and
  7. insert the needed colons or delete the unwanted ones. But now, the agony is
  8. over, COLONS.COM is here!
  9.  
  10. COLONS.COM will place colons after every label, and strip colons from EQUs
  11. if necessary. Automatically. Simply enter the command COLONS, and answer the
  12. program's requests for input- and output filenames. COLONS.COM will display
  13. the file as it is processed, but without tab expansion.
  14.  
  15. PECULIARITIES:
  16.  
  17. COLONS.COM is not very intelligent. If the output file you specify exists,
  18. you will have a chance to change your mind. it is entirely possible to
  19. specify the output file to be the same as the input file. If you then tell
  20. COLONS that you really mean it, the program will go ahead and annihilate
  21. your input file for good and it will probably crash or hang or catch fire.
  22. In other words, the output filename MUST be different from the input file
  23. name, but that's your responsibility.
  24.  
  25. When processing a program, COLONS does the following:
  26.  
  27. 1. If the first character of a line is a SEMICOLON, the line is
  28.    copied without change.
  29. 2. If the first character is an ASTERISK, that asterisk is changed to
  30.    a SEMICOLON and the remainder of the line is copied.
  31. 3. If the first character is a non-printable character (SPACE or lower),
  32.    the line is copied unchanged.
  33. 4. If the first character is a printable character, it is assumed that
  34.    it is the start of a LABEL. The line is copied to the first non-printable
  35.    character. If a COLON is encountered during copying, the remainder of
  36.    the line is immediately copied. Otherwise, a colon is inserted. If the
  37.    first non-printing character after the label is a SPACE, it is discarded.
  38.    If it is a TAB, it is copied.
  39. 5. If the word "EQU" or "equ" is contained anywhere in the line, delimited
  40.    by any non-printing character (SPACE or below), AND IF the first PRINTABLE
  41.    character preceeding that EQU is a colon, that colon is replaced with
  42.    a TAB character or simply removed depending on whether the colon is a
  43.    delimiter or not.
  44. 6. If the word "EQU" or "equ" is contained inside a label, that line is
  45.    copied without modifications!
  46.  
  47. Example:
  48.  
  49. Before:
  50. ************************
  51. ; test: equ something
  52. ;
  53. bdos:    equ    5
  54. longeqts:equ    6
  55. onequs:    equ    0
  56. ;
  57. begin    jmp    done
  58.  mvi a,7
  59. dad    d
  60. done    jmp    0
  61.     end
  62.  
  63. After:
  64. ;***********************
  65. ; test     equ something
  66. ;
  67. bdos    equ    5
  68. longeqts    equ    6
  69. onequs:    equ    0
  70. ;
  71. begin:    jmp    done
  72.  mvi a,7
  73. dad:    d
  74. done:    jmp    0
  75.     end
  76.  
  77. As you can see, bad file format results in bad conversion (COLONS can't
  78. tell whether the "dad" above is an instruction or a label; since it begins
  79. in column 0, COLONS assumes it is a label!
  80.