;;01-06-88 Eric Gans French Dep't UCLA Los Angeles, CA 90024 EGUTIL.DOC V 5.3 (EGUTIL53.LBR) 01/31/88 Version 5.3 adds a new program (READ) and corrects a problem or two in version 5.2. Thanks to Paul Foote in particular for his help with bug extermination. * * * When I brought out version 5.1 of EGUTIL a year ago, I thought it would be the last. But as a result of problems with my DOS computer, I have been doing some CP/M programming lately and thought I would share the results with the faithful. EGUTIL53 adds a considerably improved version of GKEY2 (now called GKX) , a few new programs (FILL, FILX, READ, SAVM, WCX) an update to FINREP, and improvements to CAL, CMDLN, DR, M, PHN and SRW. See EGUTIL53.UPD for details. The library includes virtually all of my utilities for generic CP/M 2.2. These programs were originally written for the Kaypro 10 (CP/M v2.2F); a few make use of K-10 video attributes, and can be patched where indicated. Most are written in Z80 code, a few in 8080. Most COM files have a version number attached (i.e. FINREP26, CAL15) for easier identification; those that do not are version 1.0. When using the files, you should rename them to eliminate the numbers (in fact, commonly used files should always be renamed; typing 11-letter filenames just makes errors more likely). ***************************************************************** * OFFRUN, PHN and CAL >>> MUST <<< be renamed as such in * * order to work, since they write themselves to disk under * * those names. BBACK must be renamed to work with BBDEF, * * and PASS to change the password with PASCH. * ***************************************************************** These programs have been debugged largely through my own use, although many users have both found bugs and made suggestions for improvements, many of which are acknowledged in the various DOC files. Please continue to let me know if for whatever reason the programs don't do the job on your system. (Fan letters are also appreciated.) To make it easier to use/extract the member files from this library, I have included a number of separate DOC files: DOC FILE COM FILES DESCRIBED BBACK.DOC - ARCH.AZM,BBACK622,BBCAT13,BBDEF12,RDATE12 DIRREP.DOC - DBACK21,DREST21 DR.DOC - DR24,FILX <> - ABUSER84,CAL15,CMDLN11,DMAP,ERAX12,FILL,LC22,M22, READ,RN21,SAVM,SWITCH11,SYN,U3,WCX,XRASE33 EGPASS.DOC - PASCH20,PASS20 (formerly ZAP.COM) FINREP.DOC - FINREP26 GKX.DOC - GKX V3.90,GKXSET39,WS.GKX GSUB.DOC - GSUB20,ALERT,IFG,ELSEG,GOTOG,ENDIFG GTXT.DOC - GTXT11,GTXT.000,0.DAT,COM.SUB OUTLN.DOC - OUTLN11 OFFRUN.DOC - LUSER11,OFFRUN34 PAIRX.DOC - PAIRX131 PHN.DOC - PHN31 SRW.DOC - SRW150 WINDEX.DOC - WINDEX30,ALPHA2 COM FILE DOC FILE 0.DAT GTXT ABUSER84 ** ALERT GSUB ARCH.AQM BBACK BBACK622 BBACK BBCAT13 BBACK BBDEF12 BBACK CAL15 ** CMDLN11 ** COM.SUB GTXT DBACK DIRREP DMAP ** DR24 DR DREST DIRREP ELSEG GSUB ENDIFG GSUB ERAX12 ** FILL ** FILX DR FINREP26 FINREP GKX390,GKXSET39 GKX GOTOG GSUB GSUB20 GSUB GTXT11,GTXT.000 GTXT IFG GSUB LC22 ** LUSER11 OFFRUN M23 ** OFFRUN34 OFFRUN OUTLN11 OUTLN PAIRX131 PAIRX PASCH20 EGPASS PASS20 (ex ZAP) EGPASS PHN31 PHN RDATE12 BBACK READ ** RN21 ** SAVM ** SRW150 SRW SWITCH11 ** SYN ** U3 ** WCX ** WINDEX30 WINDEX XRASE33 ** ** = THIS FILE ***************************************************************** 1. ABUSER.COM (v8.4) allows you to change the user numbers of files without copying them from one user area to another. This is an indispensible utility for those with hard disks. ABUSER allows wild cards in both filenames and the from-user area. If an unambiguous filename is entered, it checks for a duplicate file in the to-user area and gives you the option of (erasing it and) replacing it with the new file. This version is reentrant; to exit, type a at the >> prompt. Format: abuser [d:]fn.ft [from-user] to-user[\] If no from-user or drive is entered, current is assumed. \ toggles console output (default: on) This feature (added in v8.2) allows you to keep a directory list on screen while making multiple moves. Examples: abuser blurk.* 8 = all files blurk.* from current user to user 8 abuser *.zap 7 9 = all files *.zap from user 7 to user 9 abuser zlnk.* * 3 = all files zlnk.* in all user areas to user 3 abuser *.* * 5 = everything on the disk to user 5 2: ALERT.COM (v1.0) Beeps to alert you. (GSUB.DOC) 3: ALPHA.COM (v2.0) Makes alphabetical list of words in file. (WINDEX.DOC) 4: BBACK.COM (v6.22) Archive backup program. BBDEF.COM sets default drive, etc. ARCH.AZM is a BIOS patch to set the "archive" bit to work with BBACK. (BBACK.DOC) 5: BBCAT.COM (v1.3) Catalog program for backups (BBACK.DOC) 6: CAL.COM (v1.5) This little calendar is used by BBACK to find the date, which is stored in the file itself at 111-118H. In the latest version it creates a 0 K date file of form -mm-dd-y.y## for use in dating libraries (and erases any previously existing date files). This file should be found in A0: if BBACK is to work properly. The date must be entered in form mm-dd-yy. CAL will only work for the 20th century; an update will be issued in 1999 to all those who still remember what the letters CP/M stand for... Commands: S=same day (no change) N=next day C=change date Version 1.5 allows command-line input of these commands. The C command may be followed by the new date, e.g.: cal c01-01-88 7: CMDLN.COM (v1.1) This little program will place a command-line in the command processor (CCP) on your disk that will be run on every cold boot (startup or reset). Format: cmdln (* = no command line). If you enter 'cmdln' alone, you will be prompted for entry. Version 1.1 uses SECTRAN to read the disk and should be portable to systems that (unlike the Kaypro) make use of sector interleaving. 8: DBACK.COM (v2.1) Backs up file directories. (DIRREP.DOC) 9: DMAP.COM (v1.0) creates a display from the disk allocation vector that shows which blocks are/are not in use. Rather than the traditional bitmap, which is no more readable than the vector itself, the display contains the block numbers, as well as a total of blocks in use. (If you can't see the used blocks, you don't have K-10 graphics! The video attributes addresses are: inverse video on: 3CD-3CFH off: 3D1-3D3H.) [dmap for current drive, dmap b (or c...) for another.] 10: DR24.COM Directory program (gives # of records, allows paging, display erased files, other options) (DR.DOC) 11: DREST.COM (v2.1) Restores disk directories. (DIRREP.DOC) 12: ERAX.COM (v1.2) ERAX is an extended erase program that allows you to erase files in any or all user areas using ZCPR drive/user syntax. Like ERAQ, on which it is based, it queries you before each erasure. It has a no-query option for use in batch files and when you're absolutely sure of what you're doing (say, erasing BAK files). Since it is reentrant (like ABUSER, RN, XRASE) you can erase various groups of files without reloading the program. Format: erax [drus:][fname][ #] *,? OK DRUS is the drive/user; if one or both are absent, current will be assumed: a11:, 4:, c: A "*" in the user position allows you to access all user areas of the drive: a*:, *: (assumes current drive). If the colon is omitted only the current drive/user will be accessed. Wildcards are permitted. If you enter no filename, you will be asked if you want to search all files in the current user area (or on the current drive, if the "*" user option is used). The "#" switch disables the query option. It must be the last character in the line, and must be preceded by a space. To erase all files on a drive/user area with no query, enter: erax [du:]*.* # If you enter erax [du:] #, the program will ask if you wish to erase all files. To exit, type a CR at the ">>" prompt, as in ABUSER et al. Examples: erax *:*.bak # kills all BAK files on current drive (no query) erax searches all files in current drive/user and queries for erasure erax b*: # will erase all files on B: (you will be asked if you want to do this) erax 11:t*.?Q? searches all squeezed files beginning with "T" in user 11 13: FILL.COM (v1.0) As its name suggests, FILL will fill a range of memory with a given byte. If the range includes its own operating space, FILL will obligingly relocate itself. Format: fill add1 add2 [byte] (all entries in hex) Addresses may be ANYWHERE in memory. If the byte is not entered, 0 is assumed. 14: FINREP.COM (v2.6) Find/replace program, allows wild-cards. (FINREP.DOC) 15: GKX.COM (v3.90) Keyboard enhancer, allows redefinition of ESCAPE + key. (GKX.DOC) Extensively enhanced from v1.0. 16: GSUB.COM (v2.0) Batch-processor; allows internal file input, also IF, ELSE, GOTO syntax using IFG, ELSEG, GOTOG, ENDIFG. (GSUB.DOC). 17: GTXT.COM (v1.1) Converts text files into COM files for automatic printing. Can be used more efficiently with GTXT.000, 0.DAT and COM.SUB (GTXT.DOC) 18: LC.COM (v2.2) LC does the opposite of FIXALL et al: it converts text (e.g., ASM) files to LOWER case, the u.c. output of the XLATE 8080-Z80 converter, DASM, etc. being hard to read and unpleasant to type in. Comments and items in single quotes are left alone. (Z80 note - Because LC flags single quotes, it won't work if your program refers to the alternate register pairs af' etc. It just didn't seem worthwhile adding code to avoid this problem.) ['lc filea' to change filea; 'lc filea fileb' to put the new output in fileb and leave filea unchanged. V2.2 manages drives more rationally than previous versions: lc d:file1 file2 will now put file2 on drive d: instead of the default] 19: LUSER.COM (v1.1) Moves $$$.SUB file to new user area; for use with OFFRUN or SUBMIT. (OFFRUN.DOC.) 20: M.COM (v2.3) dumps a page of memory at an address input from the console or the program in both hex and ascii. Since it is much smaller than, say, DDT, it can be used to verify memory traces of programs that would otherwise be overwritten. It also allows the user to write bytes into the memory. The commands in v2.3 are more logical, and a B=back command has been added. [m f will dump f00-fffh; or type m and input the address at the prompt; >cb will dump cb00-cbff, etc. The point of this feature is to take up the minimal space in the CCP buffer at CCP+7. To look at the next memory page, type any key; to go back, type B (or b); to change, N; to write, W; to quit, .] 21: OFFRUN.COM (v3.4) Runs programs on startup. (OFFRUN.DOC) 22: OUTLN.COM (v1.1) Makes & formats outlines. (OUTLN.DOC) 23: PAIRX.COM (v1.31) Checks unmatched control characters in WS files. (See PAIRX.DOC.) 24: PASCH.COM (v2.0) Changes the password in PASS.COM. (EGPASS.DOC) 25: PASS.COM (v2.0) (Formerly ZAP.COM) Password protects access to hard disk. (EGPASS.DOC) 26: PHN.COM (v3.1) Phone list/dialer program. The dialer is only useful for Kaypro (10?)'s with Hayes-compatible modems, but the list is for everybody. (PHN.DOC) 27: RDATE.COM (v1.2) reads the date in files backed up by BBACK. (BBACK.DOC) 28: READ.COM (v1.0) Random file reader that allows you to read text files in random rather than sequential order. It cannot read squeezed or crunched files. "Type" programs like TYPEL(QZ) can read just about anything, but they are inconvenient when you want to browse through a text file, especially a long one. The one program I know of that allows you to back up will only let you jump to the beginning of the file, not the end. Of course your word processor lets you jump around, but WS can only go to the end of a file by plowing right through it, all 200K if necessary. VDE is fast and keeps the whole file in memory, but only if it fits. READ was composed on the KISS principle. It just figures out where you want to go in the file and reads it from the disk. Thus it takes only fractionally more time to read the end than the beginning. Command line: read [[d][u]:]filename.typ The filename cannot be ambiguous. Enter a colon if you enter a drive and/or user. The start of the file will be displayed, with a status line informing you of the number of (128-byte) sectors in the file and the current sectors displayed. Commands h = help Lists the available commands. q = quit Ctl-C also works here. j = jump You will be prompted for a sector number to jump to. b = back Goes back 4 sectors (512 bytes) if possible. 0 - 8 These numbers take you an approximate number of eighths into the file. '0' goes to the beginning, '4' to the middle, and '8' will get you within a sector or two of the end. The display always starts after for a line feed (0ah) so the lines stay even. + or - Goes one sector (128 bytes) forward or back. Displays next screen. Tabs are expanded to eight spaces, and high bits are killed. An end-of-file (1ah) character is expected at the end of the file (where else?) Video display READ is set up for Kaypro video commands. You can easily patch the file with SRW, ZAP, or even DDT by changing the bytes indicated at the top of the file. Each series of bytes is preceded by a message, so you don't need to remember addresses. Make sure the trailing zeroes are not touched. These are as follows: Defaults Do not change Cursor addressing | (yes=FF,no=0) FF V Inverse Video: 1B 42 30 00 00 00 ; esc 'B0' Inverse Video Off: 1B 43 30 00 00 00 ; esc 'C0' Clear Screen: 26 00 00 00 ; ^Z * Clear - End of Screen: 23 00 00 00 ; ^W Cursor leadin string: 1B 3D 00 00 ; esc '=' Cursor base address: 20 20 ; ' ' * used only by the Help routine Cursor addressing is used only for the bottom (status) line and (not indispensably) for the Help routine. If you don't have it, set the Cursor address byte (125H) to 0 to skip it. (If you don't have the other video routines, zero them out.) The program will work more or less the same way, except that you won't get a new prompt for the 'jump' command. 29: RN.COM (v2.1) is a wildcard file rename utility that allows you to rename groups of related files. If the new name already exists, you will be asked if you wish to replace it. As of V2.0, RN supports ZCPR drive/user syntax (a13: b: 11: a*: *: [=alluser] and the intuitive oldfile=newfile order used in MS-DOS. V2.1 is reentrant. Format: rn [du:]oldfile=newfile (*,? OK) The new name cannot be more ambiguous than the old. Examples: rn 1:blurk.*=zap.* renames all blurk.* files to zap.* in user 1 of current drive (blurk.qqq > zap.qqq) rn c12:z*.*=x*.* makes all filenames on C12: starting with "Z" begin with "X" rn zap.*=*.qqq is illegal To exit, type a CR at the ">>" prompt. 30: SAVM.COM (v1.0) This utility will save a memory block in a file. It is particularly useful if your system has frozen up while running a word processor and you want to save your text file after a reset. Format: savm filespec add1 add2 [/b] The addresses must be in hex, and add2 >= add1. If the /b(=binary) switch is not used, an extra byte for EOF (1ah) will be added to the file. 31: SRW.COM (v1.50) Disk/memory utility. (SRW.DOC) 32: SWITCH.COM (v1.1) allows you to hide files in user area 16 so that they will not normally show in the directory. This is useful if you have friends (children?) who play with your computer. The program also outputs a list of switched files. Switching the file a second time will return it to the current user area. For security, you might wish to make SWITCH a SYS (hidden) file, and to change its name to something exotic like 'BLRK.COM'. Format: switch [d:]fn.ft (*? OK) Examples: switch zap.* switches all files zap.* between user 16 and the current user area switch typed alone prints a directory of switched files in user 16. (This is done whenever SWITCH is used.) 33: SYN.COM (v1.0) SYN.COM is a "synonym" program that makes a file out of a CP/M command line. It accepts input parameters, and so can be used like a one-line SUBMIT file. Syntax: syn file.com You have to add the COM extension (unless you want to use OBJ). The command line is the set of commands you want to run, including up to 9 parameters ~1 - ~9 (I used "~" instead of "$" to avoid having to worry about literals). Example 1: you do a lot of PIPing of files from B2 to A0 and are tired of typing: pip fileqq=b:[g2ov. 1. create the file pip2.com with a parameter: syn pip2.com pip ~1=b:[g2ov 2. to copy fileqq from B2 to A0, enter: pip2 fileqq Example 2: you extract a lot of files from libraries using NULU: nulu -o a9:blurk -e zap.com=a0: 1. syn nulux.com nulu -o a9:~1 -e ~2=~3: 2. nulux blurk zap.com A0 does the trick (I assume you keep all your libraries on A9:) The created file won't be more than 2 sectors long, so it will load fast and get your command line to the CCP quickly. 34: U.COM (v.3) is for those who tire of typing "user" but who are reluctant to get involved with ZCPR. It changes drive/user without the use of upper-case (e.g. ':'). Since it uses specific addresses it should be employed with caution, although it should work with a standard CCP & BDOS. (This program owes nothing to similar programs with the same name in the public domain.) [u 1 goes to user 1; u b changes the drive to b: ; u b7 changes both.] 35: WCX.COM (v1.0) This program gives a fast word count for a file or group of files. A total is given if there are more than one. Format: wcx afn 36: WINDEX.COM (v3.01) WordStar file indexer. (WINDEX.DOC) 37: XRASE.COM (v3.3) Version 3.3 update: checks for gaps in remaining directory entries (a file with extents 1,2 and 4 will not be unerased); fixed a couple of bugs reading last directory sector, block vector; a few code improvements. XRASE is an unerase program that, unlike many such programs, (1) works on all types of disks, (2) will not unerase two versions of the same file, and (3) checks for reused allocation blocks and will not unerase a file part of which has been reallocated. It accepts only unambiguous filenames. Unerased files are restored to the current user area. The output of the program tells you whether the file has been unerased and if so which "extents." This term is used a bit loosely to designate directory entries rather than extents in the narrow sense (=128 sectors). This may be confusing to "end-users," since many systems will have more than one extent per entry: e.g. the Kaypro-10 has two per entry on both hard and double-sided floppy disks. (CP/M hackers can find this information from the "extent mask" in the disk parameter block.) So tell your friends not to worry if they find they have unerased "only" extents 1 and 3 of a file. Versions 3.2+ are reentrant; as with ABUSER, to exit, type a CR at the >> prompt. Format: xrase [d:]fn.ft (no wildcards)