Morrow Owner's Review, Volume 3, #5, page 34
The Wonderful World of ZCPR3
by Ted Silveira
If you've spent any time browsing through bulletin boards or catalogs of public domain CP/M software, you've run across ZCPR, especially its latest incarnation, ZCPR3. But if you asked someone what ZCPR3 was, you probably got a blank look or an enthusiastic rush of words trailing off into "You really have to see it..."
ZCPR3 is tough to describe because it's not a program but an operating environment supported by over 70 utility progams. I realize that "operating enviromnent" doesn't tell you much either, so let me try an analogy. ZCPR3 affects your whole computer the way a key definition program like SmartKey affects your word processing program - it makes many things easier and makes other things possible that weren't possible before.
The core of ZCPR3 is an enhancement of your normal CP/M 2.2 operating system (ZCPR3 isn't for CP/M Plus). When you add ZCPR3, you get an operating system that is compatible with CP/M programs (with a very few exceptions) but is more powerful and more flexible than CP/M ever was.
The CP/M operating system is divided into three parts: the CCP (console command processor), BDOS (basic disk operating system) and BIOS (basic input/output system). The CCP interprets all the commands you enter at the A> and also contains CP/M's built-in commands DIR, REN, ERA, TYPE, SAVE and USER. The BDOS provides basic program services - opening and closing files, reading from and writing to the disk - so that programs you run don't have to bother with the mechanics of these things themselves. Both the CCP and the BDOS are licensed from Digital Research, makers of CP/M, and are the same on all CP/M 2.2 computers (with the exception of a few oddball systems).
The BIOS, on the other hand, is customized for (i.e., written specifically for) a particular computer (a Kaypro 2X, a Morrow MD3, etc.) and is provided by the computer manufacturer rather than by Digital Research - that's why it's sometimes called the CBIOS (for custom BIOS). The BIOS translates the general functions handled by the BDOS (disk access, file handling, etc.) into detailed instructions to the specific computer hardware (select drive A, move the head to track 2, read 16 sectors, etc.). It does the nitty-gritty work of controlling your computer.
In its simplest form, ZCPR3 replaces CP/M's normal CCP, while the BDOS and BIOS remain the same. (ZCPR3 gets its name from the fact that it's written in Z80 assembly language - Z80 Command Processor Replacement, version 3). Because ZCPR3 is written in very efficient Z80 code, it crams extra features into the space occupied by the normal CCP.
To really show its stuff, though, ZCPR3 needs some extra space for buffer storage and extra functions. A standard CP/M operating system uses about 9K out of your total 64K of RAM (random access memory), leaving about 55K for programs to run in. A thorough ZCPR3 installation typically uses an extra 2-4K, depending on the number of enhancements you choose, so it leaves about 51-53K free for programs. But some people have all-out installations that leave even less. Most CP/M programs will run comfortably with 48K free, and some, like WordStar and dBase II, with less. A few programs, such as large MBasic programs, may require more.
What Do You Get From ZCPR3?
If you're going to give up part of your valuable 64K of RAM to ZCPR3, you ought to get something in return. And so you do. In fact, it would take me half a dozen articles to cover all the features of ZCPR3, so what follows is a brief overview, at best.
The Built-in Commands. Even the most minimal ZCPR3 installation enhances the CCP's built-in commands. For example, the ERA command echoes the names of files it has erased and can be set to require verification before any erasure. The TYPE command will pause after every 22 lines, instead of scrolling continuously. And if you try to rename a file with the name of an already existing file, the REN command will ask if you want to delete the old file.
You also get some new commands. LIST, for example, sends a file to the printer, ECHO sends a message to the screen, and GO reruns the last command or program you executed.
The Minimal Extras. The enhancements possible with ZCPR3 go far beyond the CCP commands, though. With little or no loss in memory space, you can get the following features:
Search Paths. With ZCPR3, you can set a search path that your computer will follow when trying to execute a command. My two-floppy system is set to search drive A for a program if it can't be found on the current drive, so if I'm on drive B and want to run WordStar, I can just give the command "WS" without worrying about whether WordStar is located on drive B or drive A. If you have a hard disk, the search path really comes into its own. You could, for example, have the system first look for a program in the current drive and user area, then in user area 0 of the current drive, then in user area 15 of the current drive, then in user area 0 of drive A, and finally in user area 15 of drive A. And you can change the search path while you're working so that you can use one path when you do word processing and another when you do spreadsheets.
Multiple Command Buffer. With ZCPR3, you can have a 200 character buffer to hold commands. With such a buffer, you can enter a string of commands (separated by semicolons) at the A> and have ZCPR3 run the commands off one after the other - an instant batch file. On my system, for example, the command "SK WS1;WS B:LETTERS;TW B:LETTERS" will run SmartKey and load the key definition file WS1.DEF; then start up WordStar and open the file B:LETTERS; and finally, when I exit WordStar, run a spelling check on B:LETTERS using The Word Plus.
Named Directories. Instead of drive and user areas like AO and B14, you can give your directories names such as WORDSTAR or DBASE. Then instead of seeing an A> or AO>, you'll see WORDSTAR> (or whatever you've chosen). And to move to the dBase II section of your hard disk, you'll just enter "DBASE:" at the prompt. Named directories aren't important on floppy disks, but they help tremendously on a hard disk.
Other ZCPR3 Buffers. ZCPR3 also can have other buffers that allow its utilities to get infonnation about the operating environment (including terminals and printers), pass messages to each other, and, in the case of special "shell" programs, reload themselves after executing another program.
The total overhead for all these ZCPR3 buffers is lK, and it's well worth the space, as they add many of the features that make ZCPR3 such a nice environment to work in.
The Outer Limits. If you want to go full-dress, you can set aside extra buffer space - 2K, 4K, 6K or more - for "dynamically loadable packages", program-like segments of code that can be loaded into memory to provide extra functions. Once loaded, these packages stay resident until you remove them or cold boot (reset). You can also change the packages, loading a new set of features whenever you like. These packages come in three types:
Flow Command Packages. A flow command package (FCP) contains logic commands (such as IF, IF ERROR, IF EXIST, and ELSE) that can control the flow of command execution. For example, you can create a command like "IF EXIST B:SURVIVAL.DOC; ERA A:SURVIVAL.DOC; ELSE; PIP B:=A:SURVIVAL.DOC; ERA A:SURVIVAL.DOC; FI". This command will first check to see if SURVIVAL.DOC exists on drive B. If so, the command will erase SURVIVAL.DOC from drive A. If SURVIVAL.DOC doesn't exist on B, the command will copy it from A to B and then erase it from A: (The FI command signals the end of the logical branching.)
You're not likely to use flow commands directly, but they're invaluable in batch files, menus and other automated operations.
Resident Command Packages. A resident command package (RCP) can contain enhanced versions of CCP commands, but its real value is in new commands. These include GET (to load a program into memory without running it) and PEEK (to examine the contents of memory). The most useful RCP commands are CP, a built-in file copy command, and POKE, which lets you patch any part of memory, including a currently loaded program. You can combine POKE with the GET and GO commands to actually patch programs like WordStar on the fly.
Input/Output Packages. The input/output packages (IOP) contain various input/output device drivers. At the moment, 1OPs are mostly do-it-yourself projects, but there are three commercial IOPs available from Echelon, Inc., of Los Altos. These are PKEY, a simple key definition program; RECORDER, which saves everything crossing your screen into a disk file; and BPRINTER, a print spooler.
ZCPR3 and the Public Domain
Because ZCPR3 is available through bulletin boards and user groups, there's a certain amount of confusion about its status. ZCPR3 is not in the public domain and never has been. It is a copyrighted product released free for noncommercial use to individuals. It is also available for a reasonable sum (considering what you're getting and the cost of downloading the megabytes that make up the ZCPR3 system) from Echelon, Inc., of Los Altos, the official distributor of ZCPR3. [MOR recently signed a contract with Echelon to distribute a special Morrow version at a discount.]
There's More
I've given you only the merest glance at ZCPR3. In articles on OCT86 FLOBs 1 and 2, I give you a better look at ZCPR3's real power by covering menus, aliases, smart batch files, on-the-fly patching and other wonders. Don't miss them.
Ted Silveira is a freelance writer and contributing editor to several computer-oriented publications. He appreciates suggestions or feedback and can be reached through the KAY*FOG RBBS 415/285-2687 and CompuServe (72135,1447) or by mail to 2756 Mattison Lane, Santa Cruz, CA 95065.