CP/M ON THE C128 (ARTICLE 2) 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.) Last time we looked at the origins of CP/M and the component programs that make up a CP/M operating system. Before we look at how to work with CP/M, it's important to understand what CP/M isn't. CP/M is NOT a programming language. Commodore operating systems rely heavily on the BASIC programming language ROM to communicate with the user. CP/M has no high level language in it. To program in BASIC, you must LOAD a BASIC language into the computer. CP/M does NOT contain a word processor, data base, or any other sophisticated programs. It is only an operating system. It gives you the ability to LOAD other programs and utilities, to view disk directories and text files, and to rename or erase disk files. It combines some of the features of the Commodore DOS 5.1 wedge and a sequential file reading program. It also gives programs written in 8080 or Z80 microprocessor machine code a universal way to access the screen, keyboard, disk drives, printer, and modem. Most of these programs will run on the C128, even though they were written many years ago on different machines running under an earlier version of CP/M. To start or BOOT CP/M on the C128, place the "system" disk (the disk that has the CP/M operating system on it) in your disk drive and turn on the computer or reset it with the reset button next to the power switch. If you are in C128 mode, you can type the command BOOT instead. The older CP/M operating systems supplied with the C128 used either the forty or eighty column screens. The systems dated December 4th and later use only eighty columns. To use CP/M effectively, you should be using the newest version. This will require an eighty column monitor. You can use an RGBI monitor, such as the 1902, simply by plugging in the 9 pin connecting cable. You can have excellent eighty column video at much lower cost by using a monochrome monitor. Some are even available with audio amplifiers, for under $100. You can also use a 1702 monitor for monochrome with lower resolution. To use a 1702 or monochrome monitor, you'll need a cable with an RCA type phono plug on one end and a DB-9 connector on the other. You can make one (connect the center of the RCA plug to pin 7 and the shield to pin 1 of the DB-9), or purchase one ready made. Check with your local dealer, or the ads in Commodore oriented magazines. Once you BOOT CP/M, you'll see the opening message with the date and finally A> with a flashing cursor behind it. This is the user prompt, the CP/M equivalent of Commodore's "READY". CP/M is awaiting your command. The tasks that CP/M can be told to perform in direct mode are called "utilities". Six of these utilities are called "resident" because they are a permanent part of CP/M as it sits in the C128's RAM. All other utilities are "transient", they must be LOADed from disk into memory and executed, just like a program. To execute a utility, just type its name at the system prompt. For example, type the following: A> dir and press RETURN. The disk drive will spin briefly and you'll see the names of the files on the disk in drive A. CP/M uses letters to identify drives, where Commodore uses numbers. The C128 CP/M system supports four disk drives, the defaults are: A=8 B=9 C=10 D=11 These can be changed, as we'll see later. If you only have one disk drive, the CP/M system will let you use drive E as a "virtual" drive. Drive E doesn't exist, but when you refer to it, CP/M will use available RAM in place of a drive, or prompt you to put the "E" disk in drive A. You'll use drive E to hold files when copying, much as the program 1541 BACKUP uses the C64 RAM to hold files when copying disks on a single drive. Each file listed on the directory has two parts, the name and the extension. For the program CPM+, the extension is SYS. The name and extension together are called the "filespec". Files on a CP/M disk can have as many as eight characters in their file names and up to three character extensions. Although the "dir" command shows the file names and extensions separated by spaces on your screen, you'll enter filespecs by separating the name and extension with a "." as in CPM+.SYS Since CP/M uses the "." to tell where the name ends and the extension begins, don't use a "." as part of the file name. In fact, it's best to avoid any characters in file names except letters and numbers. You can use any extension you like when naming or renaming a file. Some of the extensions have special meaning to CP/M or some utilities. But unlike the Commodore DOS, CP/M will let you rename any program, including its extension, at any time. The most important extension for now is ".COM". Files with this extension are "command" files. They are Z80 or 8080 machine language programs. Usually they are self starting. To "RUN" a command file, simply type its name at the system prompt. Do NOT type the ".COM" extension. On the INPUT CP/M1 disk is a simple card game called TWENTY1.COM. Try the game now by typing: A> twenty1 The disk drive will spin, the program will be LOADed and RUN automatically. To end the game at any time hold the CONTROL key and press the "C" key. This is the CP/M equivalent of RUN/STOP-RESTORE plus SYS 64738, and is usually abbreviated CTRL-C or sometimes shown as an "up-arrow C" in texts that can print an up-arrow symbol. If you have a second disk drive, you can LOAD programs or other files from it in one of two ways. First try A> b:twenty1 If you forgot to move the disk to drive B, you'll get a "TWENTY1?" from CP/M, which is asking you if that's really what you meant to type. With the disk in drive B, the program will LOAD and RUN. Use CTRL-C to exit, and type A> b: and you should see B> To change the system or "default" drive at any time, simply type the new drive number at the system prompt. Don't forget the colon, or CP/M will look for a file named "B.COM" on drive A. With the system drive changed to B, you can enter the name of any ".COM" file on the disk in that drive without including the drive as part of the filespec. Next time we'll look at more of the resident utilities in CP/M. If you don't have the latest CP/M system, dated December 6th, you can get it and several useful CP/M public domain programs, and text file copies of the first four articles in this series on the INPUT CP/M1 disk. See the order form elsewhere in this issue.