CP/M ON THE C128 (ARTICLE 4) by Noel Nyman (Copyright 1986 by Geoduck Developmental Systems. Permission to reprint this material is hereby granted, provided this notice is included in the reprinted material.) In this article, we'll look at the rest of the resident utilities in CP/M. USER is a utility that was designed for systems with hard disk drives or multi-user systems. It allows you to have sixteen "user areas" on a single disk. To illustrate this, type: A> user 5 Don't forget the space ahead of the number. CP/M responds with 5A> The system will now only look at disk files that were SAVEd to disk in the user 5 area. When you type the DIR command, you'll get a "no files" message because all the files on your disk are in user 0. The user number would be handy for keeping your files separate from another user's on a hard disk you both share. It's not very useful to us, because you can't access another user area files from the current user area. This means that any utilities are shut off from you unless you copy them into the new user area. However, when you type a file name, CP/M will look for a ".COM" file with that name in the current user area. If it doesn't find one, it will look for the file in user 0, and LOAD it if it has a "system attribute". As we saw last time, the system attribute is not the same as a ".SYS" extension. If you want utilities available in other user areas, use SET.COM to change them to system attribute files. Change back to user 0 now by typing: 5A> user 0 "ERASE" and "RENAME" are used to erase (scratch) or rename files on a disk. The commands can be abbreviated "ERA" and "REN". To change the name of the game TWENTY1.COM on the INPUT CP/M1 disk, type: A> ren d:TWENTONE.COM=d:TWENTY1.COM This is similar to the Commodore DOS format where the new name comes first. The "d:" represents the drive number containing the disk with the file you want renamed. You can omit if if the file is on the currently logged drive. Don't use more than eight characters for the name and three for the extension. If you forget the extension, the file will be named "TWENTONE. ". You can change any extensions at any time, but some utilities expect certain extensions. Avoid ".HEX", ".MAC", ".ASM", ".BAS", ".HLP" and ".COM" for general files. However, if you find a file on a public domain disk with ".OBJ" (object code file), or ".BIN" (binary code file), try changing the extension to ".COM" to get the program to run under CP/M+. The Commodore DOS wild card rules apply to CP/M as well. You can use "?" as a single character wild card, or "*" as a file name or extension wild card in most commands. For example A> dir *.COM will show you only the ".COM" files on the disk in drive A. Using A> ren d:*.bak=d:*.txt changes all ".TXT" (text) files to ".BAK" (backup) on the drive specified by "d:". Typing A> era *.* will erase ALL the file on drive A...be careful! If you use a wild card in ERA or REN, CP/M will prompt you for a "YES/NO" before executing the command. Although DIR, REN, and ERA are resident utilities, they are "bare bones" versions. They have all have advanced features that require too much memory to keep in RAM. If you try to use one of these features, you must have the corresponding ".COM" file on disk. For example, place any disk except the CP/M system disk in the drive and enter A> dir [full] You will get the message "DIR COM required". The advanced [full] option requires LOADing DIR.COM. Now place the CP/M system disk in the drive and re-issue the command. An easy way to repeat a command on the C128 is to tap the CURSOR DOWN key next to the SHIFT key, not the one at the top of the keyboard. The last command entered will be retyped on the screen. Press RETURN to execute it, or use the cursor and DEL keys to change it. You should now see a much more complete directory listing. The files are listed in alphabetical order, and their sizes in bytes and records are shown. The sizes will be in 1K increments for single sided disks and 2K for double sided. CP/M records are 128 bytes each. The attributes of each file are shown, either DIR or SYS and either RW for "read or write" or RO for "read only". RO files cannot be changed without changing them to RW with the SET.COM utility. The [full] option also shows total bytes used and free on the disk, total files found and directory entries used. Long files may take up two directory entries. You can see the same display on a disk that doesn't have DIR.COM by typing a> dir [drive=b] Place the disk containing DIR.COM in drive A and the disk you want to view in drive B. If you have only one drive, replace the "b" with "e". CP/M will LOAD DIR.COM and prompt you for the new disk. The last resident utility, TYPE, allows you to look at files on your screen and print them on a printer. All files on a CP/M disk are either ASCII (text) files or binary machine code files. You can only use TYPE with ASCII files. You can't harm anything if you accidentally use TYPE on a binary file, but you'll only see gibberish on the screen, and CP/M may crash. If that happens, just re-BOOT the system. Any file with ".DOC", or ".TXT" extensions can usually be viewed with TYPE. If you have the INPUT CP/M1 disk, enter A> type readme.txt CP/M will display part of the file README.TXT on the screen. When the screen is full, a prompt will appear to press RETURN (almost any key will do), and more of the file will be displayed. If you want to exit TYPE, just press CTRL-C. You can print a text file on your printer by pressing CTRL-P before issuing the TYPE command. CTRL-P toggles the printer on line, and anything that appears on the screen will be printed as well. The CTRL-P command produces a tone when the printer is toggled on. Pressing CTRL-P again toggles the printer off and no tone is heard. While CTRL-P gives you hard copy from TYPE, it also has all those "Press RETURN..." prompts in it. You can avoid them, by using an advanced TYPE option. Enter A> type readme.txt[nopage] The file will scroll up your screen without stopping, and will print completely. Since [nopage] is a non-resident feature of TYPE, TYPE.COM must be on the disk for it to work. You can use [nopage] on another disk by typing A> type d:readme.txt[nopage] where "d:" is any valid disk drive. There are many other utility options, too many to discuss here. You can find out about them in the DIGITAL RESEARCH CP/M PLUS USER'S GUIDE. This is part of the package you get by mailing in the card bound in the CP/M section of the C128 SYSTEM GUIDE that came with your C128. The Digital Research documentation is extensive and a great bargain at the offered price. However, it was written by computer folks for other computer folks. For easier reading, you may also want to purchase the CP/M PLUS HANDBOOK by Alan Miller, or check out the other references listed in the "ARTICLE1.TXT" file on the INPUT CP/M1 disk. You should always keep back-up copies of your system disk and important utilities. You can copy files with the utility PIP.COM. PIP is explained briefly in the C128 SYSTEM GUIDE. You can also use DIR+.COM found on the INPUT CP/M1 disk. You can make full disk copies of any single sided CP/M disk using a C64 or C128 bit or nibble copier or a dual drive copier program in non-CP/M mode. You cannot use any program that uses BAM or directory references to copy a disk. Text files of the first four articles in this series can be found, along with several additional utilities and the most current CP/M operating system on the INPUT CP/M1 disk. See the order form elsewhere in this issue.