FORM7 - Formats, changes colons and tabs in source code - 04/27/85 COPYRIGHT 1984, 1985 Irv Hoff W6FFC This program places colons after labels in source code files. It can do a variety of other things as indicated in the menu that comes up each time the program is requested: 0) remove all colons from labels 1) add colons to all labels 2) colons for M80 assemblers 3) colons for 8086 assemblers 4) all source code to lower-case 5) remove tabs, case unaffected * 6) inline comments to column 32 * 7) inline comments to column 40 * 8) reformat source code (col 32) * 9) reformat source code (col 40) = a) inline comments to lower-case = b) full line comments to lower (then asks for a reselect) select: x * require a string of characters to match before starting (Typing a RETURN will start immediately) = only work with the selections having a "*" on them (can use both "a" and "b" or either one) Selection 2) is primarily for Microsoft M80 assemblers with 8080 or Z80 code. It requires colons after all labels with the exception of no colons after labels in EQU lines. Selection 3) is for 8086 assemblers, which require colons af- ter all labels with the exception of DB, DD, DW, RB, RS, RW and EQU lines. Selection 4) makes all source code lower-case, does not affect DB strings or existing colons. Selection 5) removes all tabs, replacing with an appropriate number of spaces. Does not change any source code to upper- case, thus can be used on both ASCII text or source code files. Normally gives identical CRC check with programs using the [T8] option on PIP, but is faster and gives a results summmary. Selection 6) does not affect any colon, but moves all inline comments to a minimum of column 32 for neat appearance. (This is controlled by byte 0106H.) Selection 7) is same as 6) but moves comments to a minimum of column 40. (This is controlled by byte 0107H.) Selection 8) removes all tabs, then reformats all source code to a standard appearance with comments moved to column 32. (This is controlled by byte 0108H.) This is a very intelligent routine with lots of hidden features. Selection 9) is the same as 8, but moves comments to column 40 which is preferred by most 8086 users. (This is controlled by byte 0109H.) Selection a) will set the inline comments to lower-case for options 6-9. (Still supports the first letter being capitalized if desired.) Then asks for a reselect after it sets the flag. Leaves any upper-case text between double quotes in upper-case. Selection b) will set the full line comments to lower-case for options 6-9. Then asks for a reselect after it sets the flag. May be used in conjunction with, or independent of, selection a). Leaves any upper-case text between double quotes in upper-case. NOTE: IF USING A 1-4 SELECTION TO HANDLE COLONS AS WELL AS REFORMATTING WITH 8 OR 9, DO THEM IN THAT ORDER. THIS ALLOWS THE REFORMATTING MAX- IMUM LEEWAY IN HANDLING LABELS OVER 7 COLUMNS. (IN OTHER WORDS, 'GO UP' IN NUMBERS IF USING 8 OR 9 TO REFORMAT. ELSE ANY ORDER IS FINE.) CAUTION: ANYTHING IN THE FIRST COLUMN IS CONSIDERED TO BE A LABEL OR A COMMENT, WITH THE EXCEPTION OF 'TITLE' WHICH IS TREATED AS A COMMENT. THERE ARE NO OTHER 'RESERVED' WORDS FOR THAT COLUMN. YOU MAY NEED TO CHECK THE LABELS MANUAULLY TO MAKE SURE EVERYTHING IN THAT COLUMN IS NORMAL. The program counts the original spaces and tabs, removes all tabs and then places tabs wherever possible. The tabs are placed for standard CP/M intervals of "every 8" columns. It pads the end of the file with CTL-Z (end-of-file) characters. When the file is finished it displays the original and the current space count, tab count and the number of colons present. A tab is placed at any location it can until it comes to a semicolon (delimiter for text comments). It will still tabulate in the text comments, but does not substitute a tab for a single space as nothing would be gained. It also protects the space between 'quotes' and does not replace any spaces with tabs. Note: Some prefer a space after the ';' for source line comments. To get this feature, change byte 105H from 00 to FF, then save 16 pages with a new name. This only works with options 6-9. Some like a capital letter in the first column of the source line comments. To get this feature, change byte 0104 from 00 to FF. This only works for options 6-9. Byte 0103 changes the rate at which the line count progress is shown. DDT, etc. can be used to make any of these easy changes, then save 16 pages and rename the program as desired. --------------------------------------------------------------------- (* = normal default settings) Byte 103 07H for every 8 lines (slow floppies) * 0FH for every 16 lines (fast floppies) 1FH for every 32 lines (normal hard disks) 3FH for every 64 lines (fast hard disks) Byte 104 * 00H does not affect first inline comment character FFH capitalizes first incline comment character Byte 105 * 00H inline comment text follows the semicolon FFH one space between inline semicolon and comment Byte 106 * 20H puts comments to column 32 for option 6 Byte 107 * 28H puts comments to column 40 for option 7 Byte 108 * 20H puts comments to column 32 for option 8 Byte 109 * 28H puts comments to column 40 for option 9 Byte 10A * 08H puts instructions in column x (8 normal) These additional features give an unusual versatility to this program. --------------------------------------------------------------------- DISPLAYS UPON COMPLETION: ------------------------ total lines in the file original spaces original tabs original colons after labels current spaces current tabs current colons after labels trailing spaces deleted - notes by Irv Hoff W6FFC --------------------------------------------------------------------- To use: B>FORM HELLO.ASM (1) B>FORM HELLO.ASM NUNAME.ASM (2) B>FORM A:HELLO.ASM (3) B>FORM A:HELLO.ASM B:NUNAME.ASM (4) (1) Sets tabs in a file named HELLO.ASM. When finished the original file is named HELLO.BAK and the new file has the normal name. (2) The original file keeps the original name. The new file is now named NUNAME.ASM. (3) Just shows you can use two disks. The backup file will be on the same disk as the original and assumes the original name. (4) The original file remains intact, the new file is on another drive and is named NUNAME.ASM. --------------------------------------------------------------------- 04/27/85 v7 Accepts lines up to 255 characters long (vice 128). In- sures last line has CR-LF to allow normal processing. - Irv Hoff 03/07/85 v6 Fixed ERXIT so external file is not deleted unless a 'Y' is used. - Irv Hoff 11/20/84 v5 'b' puts full line comments lower-case for options 6-9. Requests a string of chars. for a starting location for options 6-9 (typing RETURN starts immediately.) - Irv Hoff 11/15/84 v4 'a' puts inline comments lower-case for options 6-9. - Irv Hoff 11/11/84 v3 Added instruction column option - Irv Hoff 11/07/84 v2 Added several features - Irv Hoff 11/01/84 v1 Original version - Irv Hoff ---------------------------------------------------------------------