Morrow Owner's Review, Volume 4, #2, page 12 (Apr/May '87)

Forever Z

by Rick Charnes

By now many of you are well on the way toward creating elegant command scripts for your menus and exploring the many ways to make beautiful screen displays. The menu utilities (VFILER, VMENU, MENU) are interesting: while many of us were running CP/M we denigrated programs that relied heavily on menus. "Menus are for beginners!" we insisted. But in Z-System the more you use them the more you see how helpful they are, how much time and energy they save in doing repetitious tasks. The difference between CP/M programs that display menus and Z-System menus you create yourself is the latter's ability to run detailed 200-character command lines at the touch of a key. Most CP/M menus execute but a single command in this manner.

I would like to mention a few other sources of Z-System information that I have found immeasurably helpful in my own education. First and foremost are products from Echelon, Inc. at 885 N. San Antonio Road, Los Altos, CA 94022. I urge all users of Z to subscribe to their stylish and lively fortnightly Z-News containing much information about new CP/M-compatible hardware (and don't think it doesn't exist!), Z-System tips, announcements and discussion of new programs, letters from readers, philosophical ruminations, etc. It's the essential way to keep up with the latest developments in our Z-System world. I recommend it to every user without exception. Echelon's new catalog is also out, which discusses each of their products from a personalized point of view. It's beautifully done and presents Z-System from a broad historical perspective. Lastly, the invaluable accompaniment to the Z-System User's Guide which most of you have is ZCPR3: The Manual, available from MOR for $20. This is a reference manual rather than a guide, and describes each utility in painstaking detail, picking up where The User's Guide leaves off.

Now to HSH.COM, the amazing command recall and editing program. "HSH.COM" stands for "History SHell", and that's exactly what it is. It remembers the "history" of all the commands you've entered and stores them in a file. It's a "shell" because it envelopes all your other operations, remaining in the background until you need it, with no functional reduction in TPA. Who among us has never typed a line such as: "NW LOBELTR.TXT" only to realize that the "B" was supposed to have been a "V"? In CP/M all the letters after the "B" are lost. You have no choice but to backspace and erase until you get to the "B", this time enter "V", and retype the rest. If, however, in your STARTUP alias you loaded HSH, you can cursor to the left with ^S or ^A to move to the offending letter, delete it with ^G and replace it with "V", and return. This feature is especially valuable in Z-System where we are allowed command lines of up to 200 characters in both a menu script and directly from the command line.

This isn't the half of it. I've found its most useful feature to be command line recall. When we are doing work from the command line that entails frequent repetition of filenames and commands, we are able to "recall" previously issued commands. They can then either be reissued as is or edited and then run. The author has kindly relied on the Wordstar/NewWord cursor movement commands with which we're familiar. To recall a previous command we type ^E until we get to the command we desire. To move forward in our command "history" we type ^X. When we find the command we want, <CR> will send it to the operating system, or we can edit it and send it out again.

I keep HSH in operation at all times. It is available on our MOR BBS (415/654-3798) or Z-Nodes everywhere free of charge, courtesy of its author Michael Rubenstein. It is a brilliant piece of work and adds an additional level of elegance to our computing.

Another superb program which I wanted to cover, just released in 1987, is ZPATCH. This is a patching utility that leaves ZAP, the program many of us previously used, in the dust. It is also a shell, which has a special meaning in this context. Remember, a shell sets itself up below your normal operations. Any time you choose to exit another program, you are always returned to the shell. Because of this feature ZPATCH has a power and flexibility that no comparable CP/M program such as ZAP or EDFILE can match.

Suppose you have found a certain patch you want to make to VFILER.COM, for instance to allow for immediate execution of macros 0-9 without hitting the "macro" lead-in character. You know the patch address for this byte is O11Ah. From the Z-System command line enter "ZPATCH VFIILER". Once you are inside ZPATCH the actual commands for patching are very similar to any of the CP/M programs such as the two mentioned above. But here's the rub. Once you have made the patch and saved to disk, hit "X" to eXecute. Voila! The program VFILER is automatically run, with your new values in effect. You can of course test it now to make sure the changes you have made work as you wish. Now: when you are finished testing, exit VFILER the way you would normally. ZPATCH once again takes over. You see its "strike any key" message and when you do so you find yourself back in ZPATCH. If you wish to correct the changes you made the first time or to patch new locations you may do so all without leaving this wonderful shell we have created. You can loop back and forth between patching and running as many times as you like until you have your program exactly as you like it. No commands need be typed on your part; the entire routine is held "on the shell stack" and is taken care of by the operating system. This user as opposed to programmer use of the shell stack is one of the superior elements of Z-System over CP/M.

But that's not the end of ZPATCH's shell nature. Suppose in the middle of patching you realize you're not sure of the right addresses to change. You remember they're all explained in the HELP file for VFILER, VFILER.HLP. But what a shame it would be to have to leave ZPATCH. Simply hit "Z". This will return you to the Z-System command line but still from within the ZPATCH shell (a similar feature is available by typing "Z" in VFILER as well). You may then enter "HELP VFILER" (or any other Z-System command line) as if you were at your regular operating system prompt. HELP.COM will load your help file; you may read it, note the patching address, and exit. Here, rather than returning to your Z-System command line as you would normally, you will be presented with ZPATCH's familiar "strike any key". You do so and you're immediately back to the precise location and screen in ZPATCH from which you left off.

ZPATCH is quite an extraordinary program and is available through all the usual channels. By the way, for keeping up with the latest progams I must emphasize here the importance of having and using a modem for any serious work in Z-System.

I'd like to delve into a topic which is covered only in the most cursory manner in the Z-System User's Guide, Extended Command Processing (ECP), which is especially important on floppy disk systems. This feature has no parallel in CP/M. Suppose you issue a command "COPY LETTER1 C:LETTER2" while logged on to B0:. In CP/M, if you have no program called COPY.COM that's the end of it. But not in Z-System; this is where the ECP comes into play. The ECP then looks for a file called CMDRUN.COM. This file can be any executable program, renamed to CMDRUN.COM. Whatever this file may be, it then is executed. Most people use a program called ARUNZ.COM. ARUNZ stands for Alias RUN Z-System (run an alias) and is a real star in our repertoire. It provides us a way to put all our aliases into a single supplementary file which we create, called ALIAS.CMD.

What is the advantage of this? On a floppy disk system a single alias existing as its own COM file occupies a minimum of 2k in disk space and 4k on a hard disk. This is an inefficient use of space considering that the maximum length of an alias is 200 characters. With your word processor you create a file which you name ALIAS.CMD. Into this file you then put as many aliases as you like, each horizontal entry representing one alias. Each should occupy one physical line only and the individual commands within an alias must be separated by semicolons, just as within a menu command script. The lines themselves may extend to a right margin of 200, and should begin with the name of the alias.

Suppose you wanted to put the COPY alias that I described last time into your ALIAS.CMD rather than as a "free-standing" COM file taking up disk space. Your entry in ALIAS.CMD would read:

COPY CP $1=$2

Then when you issued your command "COPY LETTER1 C:LETTER2" your CCP would first look for a regular program named COPY.COM and not finding one would surrender control to the ECP which is here ARUNZ.COM. It in turn then passes control, complete with your parameters, to its auxiliary file ALIAS.CMD, and finding your entry will successfully execute the copy. This entire process takes place very quickly, occupying just a very slight amount of time greater than it would with a single program called COPY.COM.

The possibilides are endless. You can put as many of your aliases as you wish into your ALIAS.CMD and save an amazing amount of space, especially crucial on a floppy disk. A nice variation would be:

COPY ECHO COPYING FILE "$1" TO "$2" ...;CP $1=$2

to give yourself some friendly "status reporting".

Don't forget about our memory resident flow control, always crucial with aliases and menu scripts. Remember how "if", "else" and "fi" (endif) work together. The following is typical:

IF condition x exists
(do such and such command)
ELSE; or else if condition x does NOT exist
(do such and such OTHER command)
FI; it must be tenninated in this manner

A good example here, building on our alias above, would be to first check to see if our file existed at all. This is done with the EXIST option of IF (a resident command). The following would be our ALIAS.CMD entry:

COPY IF EXIST $1;ECHO COPYING FILE "$1" TO $2 ... ;CP $2=$1; >>
ELSE;ECHO FILE "$1" DOES NOT EXIST

Each entry is separated by semicolons. If the file does not exist, we are told so by means of an ECHO'ed message.

In closing, I must mention something in our Morrow Z-System world that is most exciting. Many of you have been hearing about the new Hitachi HD64180 chip, an 8-bit CP/M compatible microprocessor capable of addressing 512k bytes of memory. All our familiar CP/M and Z-System programs can run on this chip at approximately twice the speed. Several machines are now being manufactured that use this chip such as the Micromint SB 180 and the Deep Thought DT42. We in the Morrow community may soon have the opportunity to install an HD64180 to our existing computer by means of an add-on board made by a company called M.A.N. Systems. An operating system capable of multi-tasking and taking full advantage of the 64180 is still under development at Echelon, but until then we would be able to use the extra memory primarily as a RAMdisk.

There is one hitch, however: M.A.N. Systems has requested that we do the necessary revisions to the Morrow BIOS. We are looking for assembly language programmers willing to tackle the task. Interested parties should contact me through the MOR office.

Lastly, don't forget the Morrow auto-install Z-System disk packages are now available and shipping from MOR in both floppy and hard disk versions, as well as the group discount for the Mini-Winnie hard disk. Running Z-System on a hard disk is a sight to behold... By the way, with purchases of these disks MOR is now including my home phone number as a reference, and please feel free to call if you have any questions.

Learn, experiment, and be amazed. Z see you next time...


Rick Charnes bought his MD-2 many years ago when he thought of himself primarily as a writer. Now a seIf-admitted fledgling technical type, his computer has turned from tool to toy. His immense love affair with ZCPR3 leaves some occasional time for mundane things like work. He is president of BAMDUA.