Professional Documents
Culture Documents
ZCPR3 The Manual (Richard Conn - OCR)
ZCPR3 The Manual (Richard Conn - OCR)
RICHARD CONN
ISBN 0-918432-59-6
DEDICATED
to my parents and my second family
R ic h ar d Conn
December 17, 1984
TABLE OF CONTENTS
1 ZCPR3 and C P /M 3
3 TOOLSET of ZCPR3 21
ALIAS (Version 1.1) 21
CD (Version 3.0) 23
CLE AN D IR (Version 1.0) 24
CMD (Version 1.0) 25
CMDR UN 26
COMMENT (Version 2.0) 26
CP (SYSRCP) 27
CPSEL (Version 1.0) 28
CRC (Version 2.0) 29
DEV (Version 1.0) 30
DEVICE (Version 1.0) 31
DIFF (Version 2.0) 31
DIR (Version 1.0) 33
DIR (CP-Resident) 34
DIR (RCP-Resident, provided in SYS.RCP) 34
DPR OG (Version 1.0) 35
D U / D I R Forms 42
DU3 (Version 1.0) 43
ECHO (Version 1.0) 44
ECHO (CP-Resident or RCP-Resident) 45
ELSE (from SYSFCP Version 1.0) 45
ERA (CP-Resident) 46
ERA (RCP-Resident) 46
ERASE (Version 5.0) 47
ERROR1 (Version 1.0) 48
ER R O R 2 (Version 1.0) 48
ERR OR 3 (Version 1.0) 49
ER RO R4 (Version 1.0) 49
E R R O R X (Version 1.0) 49
FI (from SYSFCP 1.0) 50
FIND F (Version 2.0) 50
GET (CP-Resident) 51
GO (CP-Resident or RCP-Resident) 52
GOTO (Version 1.0) 52
HELP (Version 5.0) 54
HELPCK (Version 1.0) 55
HELPPR (Version 1.0) 56
IF (Version 1.1) 56
IF (FCP-Resident) 58
IFSTAT (Version 1.0) 59
JUMP (CP-Resident) 59
LDR (Version 1.0) 60
LIST (CP-Resident) 61
LIST (RCP-Resident) 61
MCOPY (Version 1.4) 62
M EN U (Version 3.2) 64
M KD IR (Version 3.0) 65
MU (RCP-Resident) 65
MU3 (Version 1.0) 66
NOT E 69
P (RCP-Resident) 69
PAGE (Version 2.0) 70
PAT H (Version 3.0) 71
P O K E (RCP-Resident) 72
P R I N T (Version 2.0) 73
P R O T (RCP-Resident) 74
P R O T E C T (Version 2.0) 75
PWD (Version 1.0) 76
Q U I E T (Version 1.0) 77
R E C O R D (Version 3.0) 77
R E G (Version 1.0) 79
R E G (RCP-Resident) 79
R E N (CP-Resident) 80
R E N (RCP-Resident) 80
R EN A M E (Version 3.0) 80
SAK (Version 2.0) 81
SAVE (CP-Resident) 82
SETFILE (Version 1.0) 83
SH (Version 1.0) 84
SHC TRL (Version 1.0) 84
SHDE FIN E (Version 1.0) 85
SHFILE (Version 1.0) 85
SHOW (Version 1.0) 86
SHSET (Version 1.0) 86
SHVAR (Version 1.0) 88
SUB (Version 3.0) 88
T CC H EC K (Version 1.0) 91
TCM AKE (Version 1.0) 91
TCSELECT 97
TYPE (CP-Resident) 101
TY PE (RCP-Resident) 101
U N E RA S E (Version 1.0) 101
V F I L E R (Version 1.0) 103
VM E NU (Version 1.0) 103
WHEEL (Version 3.0) 104
WHL (RCP-Resident) 105
XD (Version 1.2) 105
X DI R (Version 2.0) 107
X IF (Version 1.0) 111
Z3INS (Version 1.0) 112
Z3LOC (Version 1.0) 113
ZEX (Version 3.0) 113
4 On-Line HELP Subsystem 121
12 Inside ZE X 223
Section 3 Installation
Appendices
B Documentation 333
C References 335
ZCPR3 and SYSLIB2 Publications and Documentation
ZCPR3 Manuals
SYSLIB2 Manuals
Software Upgrades to SYSLIB2 and ZCPR2
Sources
C P /M Books
ZCPR3 Sources
Selected Computer Clubs
AC GNJ and SIG/M
New York Am at eur Computer Club
Echelon, Inc.
New York Zoetrope, Inc.
Magazine Articles on ZCPR3
ZCPR3 Newsletters
ZCPR3 C on fig ur at ion Management
ZCPR3 Electronic Bulletin Board
Index 347
S e c tio n 1
This book is divided into three sections. Section 1 deals with learning and using
the system. In Chapters 1-2, the philosophy of ZCPR3 is presented, ZCPR3 and CP/M
2.2 are compared, and the basic concepts of ZCPR3 are outlined. Chapter 3 presents
the ZCPR3 Toolset in detail; all of the commands are listed in alphabetic order, with
their syntax, their application, and examples of how to use them. A f te r reading these
chapters, a person should be ready to use the ZCPR3 System. Chapters 4 through 8
discuss the online Help, Menu, and Shell subsystems, together with two of the major
tools (YFILER and DU3) in somewhat more detail than could be given in Chapter 3.
Section 2 discusses the internal structure and workings of some parts of ZCPR3;
this section, comprising Chapters 9 through 15, is aimed at the systems programmer
who will be using, installing, and adapting to his own needs a ZCPR system.
Section 3 contains detailed instructions for installing a ZCPR3 system. Chapter
16 presents an overview of the installation process, which is complex and requires
familiarity with assembly language programming and the inte rf ace requirements of
CP/M. Chapter 17 offers guidance on how to select the many features available if you
don’t have enough memory or disk space to accommodate all of them. Chapters 18
through 22 describe in detail the installation procedures and the ZCPR3 tools that
make life easier for the installer.
Do not be put off by the complexities of Section 3. If you merely want to use
ZCPR3 with all its flexibility and added power, you can obtain a self-installing
version, called Z3-DOT-COM fr om Echelon, Inc. This version pokes and pries into
your own system until it has all the required inf ormation, and then begins the
installation process automatically, reporting on your console as it completes
installation of each fe at ur e and utility. Two very simple commands entered from the
keyboard do all the work for you.
But if you are installing ZCPR3 from the source files, or if you w an t to adap t the
system to meet special needs of your own, then you will need to study Section 3 very
l
2 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
closely.
Thro ugh out this book a working knowledge of C P /M 2.2 is assumed. Fu rther,
since ZCPR3 is not compatible with C P /M versions earlier than 2.2, the reader should
assume that all references to "CP/M" mean "CP/M version 2.2."
U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1 3
This chapter explains the ideas and motivation behind ZCPR3. It describes, in
some detail, w h at ZCPR3 offers to the user and what the user needs to u nd ers tan d in
order to make effect ive use of ZCPR3.
A First Look at ZCPR3
To see how ZCPR3 meshes with CP/M, let us first take a look at the memory map
of figure 1-1, which shows the components of a stan dar d CP /M system alongside those
of a ZCPR3-based system.
Address CP/M System ZCPR3 System
1 Extended Features |
High Memory ->
| BIOS | 1 Modified BIOS |
BDOS+OEOOH ->
| CP/M 2.2 BDOS | 1 CP/M 2.2 BDOS |
CCP +0800H ->
| CP/M 2.2 CCP | T 1 ZCPR3 |
CCP Base -> r
| Scratch Area | A* 1 Scratch Area |
100H ->
| CP/M Buffers et al| 1 ZCPR3 Buffers et al|
OH ->
*TPA = Trans ie nt Program Area, which covers the Scratch Area and the CCP or
ZCPR3
standardized requests from application programs (which ma nipu late data in ways that
serve the user’s specific needs). All computers have fou r basic resources to be managed
by the operating system:
o Memory
o Processors and Processes (a Process is a runn ing Program)
o Devices
o In fo rm at io n
Memory Management. C P /M does very little in the way of Memory Management. It
merely defines the basic memory structure as shown in figure 1-1; it does not allocate
sections of the memory to application programs or do any of the partiti on ing usually
associated with the memory management function.
Process Management. CP /M does no Process Management. There is only one
processor, so no processor management is needed. Only one process at a time can run,
so C P /M simply starts the process and then relinquishes all control. The process then
has complete control over the entire microcomputer, and C P /M does nothing to stop it
from doing any th in g it wishes to do. Co-routines or time-sharing between users on the
basis of a clock in t er r u p t are sometimes found, but in such cases the allocation of time
slices to users is a f un ct io n of a separate process control program, not of CP/M.
Device Management. The beauty of CP /M is the way it does device and
in fo rm ati on management. Device Management'll perfor me d by the Basic Input-Output
System (BIOS) of CP/M. The BIOS provides a standardized, h ar d w ar e- in d e p en d en t
int erface to the devices attache d to the microcomputer. The routines controlling these
devices may be accessed by way of a table of jump instructions located at the
beginning of the BIOS. The parameters passed to these routines, the parameters
returne d by these routines, and the functions perfor me d by these routines are
precisely defined. The applications programmer does not need to know how the
routines pe rf or m their functions, but only wh at they do and how to communicate with
them. This is a process box , or black box concept, illustrated in figure 1-2.
Input Parameters |
are precisely known | The Process Box is
V a "Black Box," and
it is not necessary
| Function is <— to know what is in
| Precisely Known the box in order
to use it
Output Parameters |
are precisely known |
V
device the console may be (such as a CRT or print ing terminal), an application
program has only to make a subroutine call to address BIOS + 9 (each Jump Table
Entry is three bytes long); the BIOS will then re tu r n the next chara cter fr o m the
console in the A register. To output a character to the console, the software need only
place that character into the C register and make a call to BIOS + 12. The jump table,
which is in a constant location relative to the start of CP/M, ensures tha t the correct
driver routine will be accessed, regardless of where C P /M is located in the memory
(minimum memory size is 22K, maximum is 4K).
The BIOS performs all of the functions necessary for C P /M (and the programs
which run under CP/M) to control and communicate with the disk subsystem and most
commonly used peripherals such as printers, modems, and so on. Surprisingly, only
seventeen general-purpose functions are required to provide the h a r d w a r e interfaces
necessary to perfo rm all character and disk I / O unde r CP/M. They are:
1. Initialization Functions
o Cold boot initialization (when the system is first tur ned on)
o Warm boot initialization (performed periodically af te r the system is tur ned on)
2. Character I n p u t / O u t p u t Functions
o Console status (check for availability of a character at the console)
o Console input
o Console output
o List status (check to see if List Device is ready to output the next character)
o List (printer) output
o Auxiliary output
o Auxiliary input
3. Disk I n p u t / O u t p u t Functions
o Home drive (move head to Track 0)
o Select drive (which drive to use)
o Select track
o Select sector
o Select memory address to read into or write from
o Read block (at selected track and sector) into memory
(at selected memory address)
o Write block (to selected track and sector) from memory
(at selected memory address)
o Logical-to-physical sector translation (for efficiency of disk use)
The BIOS, then, creates a virtual machine : that is, a hypothetical computer on
which all C P /M software runs (including CP /M itself). This hypothetical computer
always behaves in the same man ner and has the same logical inte rf ace to application
programs, regardless of the actual ha rd w ar e used to implement it. It makes no
difference whether 5.25" floppy disks storing 100K per disk, 8" floppy disks storing
600K per disk, or 8" Winchester h ar d disks storing 5M per disk are used. The software
talks to all of these devices in the same way, and this makes such software
transportable at the binary level between any two microcomputers r u n n in g CP/M. The
only proviso is that the application program must use the sta nd ard CP /M function
calls when requesting service; direct calls to the BIOS via the jump table may result in
loss of portability to some systems.
6 U sin g ZCi: R 3 a n d C o m m a n d D e fin itio n s Sec. 1
■ PWD Print Working Directory; this command lists the names of the directories
accessible to the user
■ M KDI R Make a Directory; create a new set of named directories or modi fy an
existing set
All of the ZCPR3 resident commands and utilities respond to the ZCPR3 DU and
DIR forms, but conventional CP /M programs do not. If a DU or DIR fo rm is presented
in the command line of a conventional CP /M program, the fo rm is usually interpreted
as the disk referenced by the form. For example, if the "ROOT" directory is disk A,
user area 15, then "WS ROOT:MYFILE.TXT" will be read by the WordStar program to
mean "WS A:MYFILE.TXT". Some programs, such as PIP, will not respond favo rab ly to
the DU and DIR forms. As a general rule, only the D fo rm should be used in
conjunction with non-ZCPR3 utilities.
Command Search Path
A path is a sequence of directories tha t are to be searched for a parti cul ar file in
the order specified by the sequence. The directories in the path may be specified by
absolute D U forms, by symbolic DU forms, by DIR forms, or by a mixture of all three.
The sequence always starts with the directory into which the user is curre nt ly logged,
and ends with a special directory (by convention called "ROOT"). The ROOT
directory contains COM f il e s - s u c h as directory display utilities, telecommunication
packages, editors, and copy utilities—tha t are f r equ ent ly used throu gh ou t the system
and are sometimes called by application programs.
Although the terms "root" and "path" are taken from U N I X and have some
functional resemblance to their U N IX equivalents, it is im po rta n t to note tha t ZCPR3
directories are not hierarchical in the sense that U N I X directories are. In UNIX, a
directory is a file containing filenames and other in fo rm at io n about the files—and
these names may belong to text files, bina ry executable files, or command scripts; but
they may also belong to files which are themselves subordinate directory files, so that
a "tree" of directories and subdirectories is possible. The BDOS treats directories in a
dif fer en t way from files; thus, und er CP /M and ZCPR3 all directories arc on the same
level and search paths are a r b i t r a r y —there is no physical tree structure. If any tree
structures are to be established, they will have to be done in a "logical" fashion. By
making directories visible or not visible (which is possible when only the DIR form is
used), logical trees can be created. Logging into a directory via CD, for instance, may
run an ST.COM file which loads a new set of directory names, suddenly establishing
visibility to these directories (establishing a node of the tree). See the description of
the CD command for more details.
The PATEI command is used to defin e the search path desired by the user. The
following examples all defin e exactly the same path, but use the d i f f e r e n t forms. At
the start of the path, the user is logged into Disk B, User 5.
Absolute DU: B5 BO A5 A15
Symbolic DU: $$ $0 A$ A15
DIR forms: LETTERS WP SPELL ROOT
A dollar sign used in symbolic D U forms specifies "Current Disk" if it appears in the
first position, or "Current User Number" if it appears in the second position. Use of
10 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
the DIR forms assumes tha t all the names have previously been assigned to specific
directories.
Command Search Processing
Command processing und er C P /M is really quite simple:
1. Input and parse command line fro m user or file.
2. Determine if it is a CCP-resident command; if so, run the command.
3. Determine if the cu rr en t disk and user area contains a COM file with a name that
matches the command; if so, load it and run it.
4. Print error message if 2 and 3 fail.
ZCPR3 offers a much more sophisticated and flexible command processing
facility. The ZCPR3 command search hierarchy can be expressed as follows (the
command processors to which reference is made will be fully described later):
1. Inp ut and parse the command line fr o m the user, a r u nni ng SUBMIT file
($$$.SUB), or a ZE X or ZEX-like input source (ZEX is a memory-based command
file processor which can be thought of as a memory-based SUBMIT).
2. Check the cu rr en t Flow Command Package (FCP) to see if it recognizes the
command; if so, ru n the command through the FCP.
3. Check the cu rr en t Flow State to see if it is TR U E; if so, continue; if not, flush the
command and advance to the next one (step 1).
4. Check the cu rr en t Resident Command Package (RCP) to see if it recognizes the
command; if so, run the command through the RCP.
5. Check the ZCPR3-resident command table for the command; if found, run it
with in the ZCPR3 command processor.
6. Search along the command search path for a COM file which matches the verb in
the command line, logging into the disks and user areas indicated in the path until
either the bottom of the path is reached or the desired COM file is found; load and
run the program, if found.
7. If an Ext ended Command Processor has been specified (at installation time), load
it and pass the command line to it for execution
8. If steps 2-7 fail, invoke an Error Han dler program if one has been installed; if no
Error Han dl er has been installed, prin t an error message.
The ZCPR3 command processor follows these steps when it attempts to resolve a
command line presented to it. Because steps 1-5 use memory-resident facilities, this
procedure is quite fast, and the ZCPR3 user realizes a very reasonable response time
f rom the system.
Command Sources
In a full ZCPR3 System, there are fo u r places where commands can be found:
1. Within the ZCPR3 command processor itself
2. Within memory-based resident command packages
3. Within memory-based flow command packages
C hap. 2 B asic Z C P R 3 C o n c ep ts 11
Change Disk D: D:
These fo ur areas are briefly described below; more detailed discussions of the
commands themselves and how the command processors work are contained in a later
chapter.
ZCPR3 Command Processor. Like the C P /M CCP, ZCPR3 contains some built-in
commands. It can contain all of the CCP commands (except USER, which is not
needed) and a few more, but all of the ZCPR3 resident commands are d i f f e r e n t
because they have logical extensions that o f f er features not f o u n d in the CP /M
resident commands. Table 2-1 compares the various resident command forms under
the CP /M CCP and ZCPR3.
The Extended Command Processor (ECP) is a program that is run by the ZCPR3
Command Processor. The entire command line is passed to the ECP, so the ECP can see
the line as it was intend ed to be executed. It can perfo rm its own addit ion al parsing
and evaluation and then either resolve the command or pass a new command line back
to ZCPR3 for ano ther ro und of interpretation.
If the ECP is not found, the conventional error message is given, flagging the
original command as being in error. If the ECP (usually named CMDRUN.COM) is
found, then the entire command line is passed to it as though it had been run as a
command in its own right. For instance, if the original command line was:
MASM MYPROG
and the file MASM.COM was not fo und but the Ext ended Command Processor
CM DR UN was, then this would be equivalent to issuing the command:
CMDRUN MASM MYPROG'
The utility of this f ea tu re can be seen immediately. Imagine tha t the SUBMIT
program were renamed to CMDRUN. Then the failu re of a command would cause
SUBMIT to run and a ttemp t to run a command file.
With this f ea tu re in mind, two ZCPR3 transients are provided for use as Extended
Command Processors. They are SUB and ZEX. SUB and ZE X are command file
processors. SUB is like an enhanced SUBMIT, and ZEX is also like an enhanced
SUBMIT but it places its executable text into memory a n d runs much faster.
Resident Command Packages. Commands may also reside wi thi n a Resident
Command Package (RCP). An RCP is a file which contains one or more commands and
is loaded into memory by the LDR utility of ZCPR3 for direct execution by the
ZCPR3 command processor. Each command within an RCP looks and acts like a COM
file, but instead of having to be loaded fr o m disk each time it is executed, the
command executes immediately fro m within its memory-based RCP. Several sta ndard
RCPs are provided in the ZCPR3 distribution files, and Table 2-2 lists some of these
commands and their functions.
Resident command packages o f f er several advantages to the ZCPR3 user:
1. Disk space can be saved, because a nu mber of small commands can be grouped
together in one file and loaded as a group for execution.
2. Time can be saved, because RCP-based commands are memory-resident once their
RCP has been loaded; therefore, no disk activity is involved in locating and
loading them.
C hap. 2 B asic Z C P R 3 C o n c ep ts 13
3. Some commands, such as those built into the C P /M CCP, which are normally
included in the ZCPR3 command processor, can alternatively be placed into an
RCP, thereby freeing up the command processor for more system-oriented
functions.
4. There is usually more space available in an RCP than wi thi n the ZCPR3
command processor, so RCP-based commands can be larger and more powerful
than their ZCPR3-based counterparts.
5. Commands residing within an RCP generally do not occupy any space in the
Transient Program Area; thus, if debugging facilities are made RCP-resident,
they can examine the TPA afte r a transient program has been executed in an
undisturbed state.
Command Function
CP Copy a file
ECHO Echo the command line tail to the console or printer; this
is useful in message display and device programming
Flow Command Packages. A Flow Command Package (FCP) is very similar in natu re to
an RCP—it is a package of commands that is loaded by LD R for execution directly
from memory. Commands tha t control the Flow State of the system are typically stored
here. Nine flow states may exist at any one time in a ZCPR3 system: the empty state
(which is T R U E ) and IF Levels 1 to 8. The ZCPR3 command processor is constantly
14 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
aware of the cu rr en t flow state of the system, and if this state is T R U E , the ZCPR3
command processor will allow any command to execute if at all possible. If the flow
state is FALSE, however, only commands which reside with in an FCP may be
executed. The IF command is usually used to raise the user to the next flow state level
and set its value to T R U E or FALSE as the result of testing some condition. Table 2-3
shows the commands that are usually placed within an FCP.
Table 2-3. Common FCP Commands
Multiple-Command Lines
The multiple-command line fe at ur e adds much flexibility and versatility to the
ZCPR3 System. Unlike CP/M, ZCPR3 allows the user to specify, on one line, a
sequence of commands separated by a semicolon. For example:
A>B:;DIR A 7 :* .TXT;DIR C22: .COM A;C7:;ERA *.COM;DIR
is a valid command line to ZCPR3. This fea tu re buys the ZCPR3 user two important
advantages:
1. A sequence of time-consuming commands can be issued at one time, and the user
can leave the system and do something else until the sequence completes. A
ZCPR3 utility (SAK), designed with this in mind, rings the console bell to alert
the user when the command sequence completes or reaches a critical point.
2. One program can invoke another program by placing a command line into the
multiple-command line b uf fer , setting a pointer to the first chara cter of the
command line, and r etu rn in g to the operating system. ZCPR3 will then resume
command line execution at the pointer location and run the command for the
previous program. This f ea tu re makes aliases and shells (among other things)
possible.
Shells
The command search hierarchy described above is fu n d am e n ta l to the ZCPR3
command processor itself, but ZCPR3 also supports the concept of a shell. A shell is a
program that acts as an int erface between the user and the ZCPR3 command processor.
Shells can completely change the user’s mode of interaction with a ZCPR3 system;
their f un cti on is to lift the user to a higher level of abstraction which is f u r t h e r away
from the details of the machine he is using and closer to the problem he wants to solve.
Several shells are provided with ZCPR3, each with a programming language and
environment of its own. M ENU and VME NU are two such shells; they present menu
displays to the user, allow him to select an item from a menu display with a single
keystroke, and then build command lines based on this selection, passing these
command lines to the ZCPR3 command processor for execution. When all commands
in a sequence have been executed, the ZCPR3 command processor automatically
reinvokes the shell, and the user finds himself back at his menu. All shells are
documented in the chapter of this book which describes the commands.
The user never needs to know wh at commands are built and executed—all he
needs to know is how to interpret the menu and strike a single character to select the
function he desires. The shell hides fr om him all the details of implementation. Thus,
an application coded in the command language associated with one of these shells can
be run by a person with no technical knowledge except the little required to tu rn the
machine on and select major functions.
Scripts
A script is a sequence of commands that may be stored in a disk file and executed
as if they were a single command, merely by invoking the name of the file. A SUB file
executed by the SUBMIT command of CP /M is an example of a command file of this
type. However, because the ZCPR3 command processor is more powerful and flexible
than the corresponding C P /M facilities, much more complex operations can be
16 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
2. The sequence pauses to allow the user to see the results of the assembly; if it is
successful, he may strike the R E T U R N key and allow commands 3 and 4 to
execute; if it is not successful, the N option aborts commands 3 and 4.
3-4. If the user responded in the a f f ir m a ti v e at step 2, the L80 linker is run and
MYPROG.REL is erased.
C hap. 2 B asic Z C P R 3 C o n c ep ts 17
To remain compatible with CP/M, these simple features were retained in their
entirety in the design of ZCPR3, with few changes. ZCPR3, however, offers the
environment descriptor as an add itional f ea tu re that opens many doors to the software
developers. The environment descriptor specifies the characteristics of the user’s CRT
and printer, as well as the features available und er a par ticular ZCPR3 system. This
in fo rm atio n makes it possible to transport programs such as screen-oriented editors
from one ZCPR3 system to another at the binary level; the only special requ irement is
that a pointer to the target system’s environment descriptor has to be installed in the
program. The utility Z3INS performs this installation in a mi nim um amount of time.
Redirectable I / O
Redirectable Input/Output refers to the ability of the user to switch to d if f e r e n t
I n p u t / O u t p u t devices dur ing the course of a session. Optionally implemented through
the I /O Byte, I /O un de r C P /M supports four logical devices, namely:
Console (CON:)input (keyboard) and output (display)
P rinter (LST:) output-only
R ead er (RDR:)input-only
Punch (PUN:)output-only
Each of these fou r logical devices may have any one of f o ur physical devices assigned
to it, allowing the user to work with as many as sixteen physical devices. Re f er to the
C P /M 2.2 Alteration Guide by Digital Research Inc. for in fo rm at io n on device driver
and parameter-passing requirements.
Device Assignment under CP/M. U n de r CP/M, the I /O Byte (at memory location 3)
specifics the assignment of these devices. It is divided into fo ur 2-bit fields, each field
associated with a logical device; within a given field, each of the fo u r possible values
(00, 01, 10, 11) is associated with a par ticular physical device. Assignment of a
physical device to a logical device can be done by STAT commands (e.g., "STAT
CON:=CRT:"). Table 2-4 summarizes the logical and physical device assignments and
mnemonics available through the I/O Byte. Table 2-5 lists the sta n d ar d meanings of
the physical device mnemonics.
Table 2-4. I / O Byte Assignments
To make use of this structure, each logical device driver must, every time it is
called, examine the value present in the I /O Byte field associated with tha t logical
device, and use the value as an offset into a table to obtain the address of driver
routine for the physical device specified in the I/O Byte. This process adds a good deal
of code to the BIOS, and many systems do not implement it. Nevertheless, if you have,
say, a dot ma trix print er and a daisywheel printer, you can use either one as the list
Chap. 2 B asic Z C P R 3 C o n c ep ts 19
device by issuing the app rop riate STAT command; wi thout this feature, it would be
necessary to change the physical cable connections to the output port.
Toolset
We have now examined the more imp or tan t ideas tha t went into the design of
ZCPR3, and have incidentally seen some examples of how they can make life easier
for the user. But there are many components in ZC P R3 —so many that it is easy to
become confused by the complexity of their interaction. What threa d can we fin d
linking these components that will help us to un der sta nd and use ZCPR3 effectively?
Perhaps the most f r u i t f u l approach is to view the ZCPR3 System as a toolset from
which the user can create his working environment, and change this environ me nt to
suit his changing needs. There are several classes of tools within the ZCPR3 System:
1. Utilities — tools tha t p erf o rm basic functions such as erasing files and displaying
directories.
2. Documentation —tools tha t provide online help to the user.
3. Programmer Aids —tools that assist the user in debugging his programs.
4. Shells - tools that act as front-ends to the ZCPR3 command processor and provide
a d i f f e r e n t type of int erf ace between the user and the ZCPR3 System.
5. Command File Processors — tools tha t support the processing of files containing
commands.
The following chapters describe the programs of the ZCPR3 Toolset. Chapter 3
contains brie f descriptions of all the tools, in alphabetic order by program name.
Chapters 4 through 7 describe some of the more complex tools in greater detail.
Chap. 3 Basic Z C P R 3 C o n c ep ts 21
3 TOOLSET OF ZCPR3
This chapter describes in detail how to use the tools provided as part of the
ZCPR3 system. The tools are described in alphabetic order of their names, for easy
reference. Some of the more complex tools are very briefly described, with references
to the later chapters in which they are more fully covered.
Examples of Aliases
Case 1: The user is constantly issuing the following commands in the order
indicated:
ASM myfile.BBZ
LOAD myfile
He can generalize it with the following Alias script:
ASM $1.BBZ;LOAD $1
If this Alias is named MYASM.COM, then typing "MYASM test" will be equivalent
to "ASM test.BBZ;LOAD test".
Case 2: The user has two printers on his system. He is using redirectable I /O as
implemented unde r ZCPR3, and he has two versions of Word Star (trademark,
Micropro)—one for each printer. He can create an Alias containing the following
script:
Script Meaning
IF NEC=$2 Check to see if 2nd param is NEC
DEV L NEC If so, assign LST to NEC
WSN $1 and run NEC version of WS
ELSE If not ...
C hap. 3 TO O LSET OF ZCPR3 23
CD (version 3.0)
Syntax:
CD dir:
or
CD du:
Function:
CD (Change Directory) is used to move from one directory to another by using the
names or literal DU forms associated with the directories. CD first logs into the
referenced directory, and, if there is a file named ST.COM in it, CD will log the
user into the referenced directory and invoke ST.COM. If there is no file named
ST.COM in the directory, CD will simply log the user in.
Options:
None.
Comments:
Under ZCPR3, there are two basic ways to log into a directory. One way is by
using the DU: or DIR: prefix (e.g., B1:ASM>TEXT: or B1:ASM>C7:). The other way
is by using CD (e.g., B1:ASM>CD TEXT: or B1:ASM>CD Cl:).
The tr a d e o f f is in user efficiency. If a directory is always used for a particular
function, such as cataloging disks, CD may be p r efe rr ed because it will not only log
the user in but will also run ST.COM, which can set up his env ironm ent by running
MENU or some other program or group of programs.
ST.COM is an Alias. The only purpose of ST is to load the multiple command line
buffer with a command line when it is executed with ou t any options. This
command line may contain a reasonable number of commands which perfo rm any
desired set of functions.
In the ZCPR3 environment, good candidates for execution by r u nn in g ST via CD
include the following commands:
LDR file.NDR <— Set up a new directory environ
PATH path-exp <— Set up a new Command Search Path
MENU <— Invoke the MENU Preprocessor
24 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Using CD to log into a new directory can drastically change the user’s
environment. The names of the directories he can access can change (LDR changes
the Memory-Based names), the command search path he uses can change, and he
can even fi n d himself in a MENU environment or other fr on t-e nd instead of a
ZCPR3 command environment.
Selected Error Messages:
"Command Line Overflow" means that there was not enough room in the command
line to insert the command to invoke ST.COM.
Examples of Use:
CD TEXT: — lo g in to d irecto ry TEXT
C L E A N D IR (version 1.0)
Syntax:
C L E AN D IR dir: o
or
CLE AN D IR o
Function:
CL E A N D I R "cleans" a physical disk directory. It loads the directory of the target
disk into memory, sorts it alphabetically within each user area (ascending order by
default), and writes it out to disk filling unused directory entries with E5.
A DIR: prefix is allowed, but only the disk reference is meaningful, so if
"CLEANDIR ROOT:" is issued where ROOT: is A15:, then disk A is cleaned.
Options:
D sort user areas and files in descending order
Comments:
C L E A N D I R ’s sort on the disk directory has several advantages:
1. Utilities such as XDIR, which sort the disk directory af te r loading it, run faster
since the directory is already sorted.
2. The possibility of recovering files by the U NE RA SE command is increased if
C LE AN D IR has been run on the directory recently before the files were erased.
Note tha t any erased files absolutely cannot be recovered by U NE RA S E if
C LE AN D IR was run between the time they were erased and U N E RA S E was
executed.
3. Use of DU3 to look at the directory is facilitated if the directory is already sorted
by CLEANDIR.
C hap. 3 TO O L SE T OF ZCPR3 25
CM D (version 1.0)
Syntax:
CMD cmdl;cmd2;...
or
CMD or CMD;cmd2;...
Function:
If CMD has an argument, it builds a new command line which begins with this
argum ent and proceeds with the rest of the command line. For example, the first
form "CMD cmdl;cmd2;..." is translated into "cmdl;cmd2;...". This allows sources
such as MENU, VMENU, and VFI L ER to enter the "cmdl" variable fr o m the user
selection manually.
If CMD has no argument, the user is prompted for input, and this input is inserted
into the command stream at the point of the CMD command. This is useful, for
instance, when SHSET is used to define a shell sequence, and this sequence is to be
exited at some time. For example, if the user typed in "myemd" in response to the
prompt, the second fo rm "CMD;cmd2;„." is translated into "mycmd;cmd2;...".
CMD sets the error message whenever it runs. E R R O R is tur ned on if no line was
in put to CMD.
Options:
None.
Comments:
CMD was built for use specifically with the SHSET command, although it may
f in d other applications. The problem that CMD addresses is the case where the
main program in the shell sequence knows nothing about shells, and it is desired to
leave the sequence sometime. CMD provides this out. For instance, if MU3 is to be
used as the main shell, then "SHSET MU3;CMD" will run MU3, allow the user to do
wh at he wants, and then reenter MU3. If the user entered the command "SHCTRL
POP" the shell stack would be popped and the "MU3;CMD" loop would be broken.
26 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
CM D RU N
Syntax:
C M DR UN text (this command is usually executed by ZCPR3 itself, not by the user)
Function:
CM DR UN is a sample Extended Command Processor. It is invoked automatically
by ZCPR3 when the user command is not f ou nd via the command search path and
no error han dler is engaged.
The text which follows the verb is the text of the original command line.
Options:
None.
Comments:
CM DR UN is only a simple sample. It shows that the original command line is now
available in the command tail b u f f e r (at 80H). The formal CM DR UN which the
user programs for his ZCPR3 System can extract the original command line from
this b u f f e r and manipulate it as desired.
Selected Error Messages:
None.
Examples of Use:
None.
C O M M EN T (version 2.0)
Syntax:
COMMENT
Function:
COMMENT allows the user to type as many lines as he wishes without them being
processed by ZCPR3. It has no arguments.
If the user strikes a AP, all subsequent lines he types will be printe d on the printer.
Chap. 3 T O O LSET OF ZCPR3 27
Options:
None.
Comments:
COMMENT has two main applications in the ZCPR3 environment:
1. When the console displays are being recorded, COMMENT allows the user to type
notes to a f u tu r e reader without having to begin lines with a semicolon (;); all of
these lines are clearly shown to be comments since they begin with the prompt
"Comment»".
2. When console I/O is redirected to two d if f e r e n t users, such as CRT and MODEM
I/O in parallel, then COMMENT may be used to provide a simple mechanism for
them to communicate; both users can type to each other w ith ou t having any effect
on the system (such as command processing).
COMMENT is aborted by striking a AC as the first character of a line. Backspace and
Delete both echo as Backspace, space, backspace, and AX and AU both erase the current
line. AP toggles printing.
If COMMENT is to be used to chat between two users, it is recommended that an
over/out protocol be employed (as recommended for the UNIX* WRITE program).
The first user types, and, when finished, terminates with the letter "o" for over. The
second user types a nd signals completion the same way. Completion of the
conversation may be signalled by "o+o" for over and out.
* [UNIX is a tr ad e m ar k of Bell Labs]
Selected Error Messages:
COMMENT generates no error messages.
Examples of Use:
CP (S Y S R C P )
Syntax:
CP di r : uf n l= d i r :u f n 2
Transient Counterpart:
MCOPY
28 U sing ZCPI13 a n d C o m m a n d D e fin itio n s Sec. 1
Function:
CP copies one file fr om one directory to another or into the same directory un d er a
d if f e r e n t name.
Options:
None.
Comments:
This is a simple fo rm of MCOPY. One major distinction is tha t CP can duplicate a
file un de r a d i f f e r e n t name in the same directory; MCOPY cannot do this.
Selected Error Messages:
None.
Examples of Use:
CP f 1 . t x t = f 2 . t x t
CP a l 5 : = f 1 . t x t
CP a ! 5 : f 2 . t x t = c 5 : f 1 . t x t
C P S E L (version 1.0)
Syntax:
CPSEL cmdl,cmd2,...
Function:
CPSEL ( C R T / P r i n t e r SELect) is a ZCPR3 utility tha t permits the user to select
either CRT 0 or C RT 1, and Printer 0, 1, 2, or 3 fr o m the cu rr en t ZCPR3
En vi ro nm ent Descriptor. This dynamically changes the characteristics of the
print er and CR T which are used by other ZCPR3 utilities, such as PRINT.
Options:
None.
Comments:
The commands may be any of the following:
Cc, c=0 or 1 Select CRT 0 or CRT 1
Pp, p=0-3 Select Printer 0-3
Dd, d=A (All), C (CRT), P (Printer) Display Selection Values
The values af f e c t e d by these selections include number of lines and columns on the
CRT and num be r of lines and columns on the printer. The ability of the print er to
form feed is also included.
Selected Error Messages:
None.
C hap. 3 TO O LSET OF ZCPR3 29
Examples of Use:
CPSEL DA — display all devices
CPSEL Cl,P3,DA — Select CRT 1 and Printer 3;
display all devices when done
Comments:
CRC is useful when tr ans fer ri ng files from one site to another. The CRC values of
the files can be computed and listed at one site, transf err ed, and compared at the
other site.
The L option adds the utility of tracking code size (in lines of code).
Selected Error Messages:
Self-explanatory.
Examples of Use:
CRC *.MAC L — Compute CRCs of all *.MAC files in the
current directory; include lines-of-code
count in display
CRC *.* DLC — Compute CRCs of all files, include count of
lines of text and comments on each file, and
30 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
D EV (version 1.0)
Syntax:
DEV command,command,...
Function:
DEV is a utility which manipulates the ZCPR3 redirectable I /O device drivers. It
allows the user to display the names of the current devices and select them.
Unlike its count erp art DEVICE, DEV accepts all input from the command line and
is not interactive.
Options:
None.
Comments:
Any DEV command may take the following forms. Only the first letters are
significant in these commands:
DISPLAY ALL <— Display names of all devices
(D A is the same as DISPLAY ALL.)
DISPLAY CON <— Display consoles
DISPLAY LST <— Display printers
DISPLAY PUN <— Display punches
DISPLAY RDR <— Display readers
The full physical device name must be given in the following commands. Only the
first chara cter and the ’=’ are significant in the rest of the command.
CON:=name LST:=name PUN:=name RDR:=name
C=name is the same as CON:=name.
Selected Error Messages:
"DEV NOT Initialized with I /O Base" means that this ZCPR3 System does not
support Redirectable I/O.
"Redirection Not Supported" means that the loaded drivers in the I /O Package do
not support redirection.
Examples of Use:
DEV C=CRT,L=TTY — assign CRT to CON: and TTY to LST:
C hap. 3 TO O LSET OF ZCPR3 31
D EV IC E (version 1.0)
Syntax:
DEVICE <—Enter Interactive Command Mode
Function:
DEVICE allows the user to interactively display the names of the available
physical devices (actually, device drivers) which may be assigned to the logical
devices. The user may also assign a physical device to a logical device by name.
Options:
None.
Comments:
DEVICE runs only in an interactive mode. It responds to single-character
commands, completing the command names on the screen and prompting the user
for fu r th er input.
The following commands are recognized by DEVICE:
D Display Device Names
C Select Console Device (CON:)
L Select List Device (LST:)
P Select Punch Device (PUN:)
R Select R ead er Device (RDR:)
X Exit to ZCPR3 wi thout prompting for confirmation
The Display Device Names command (D) asks the user for the devices to display.
The possible responses are: A - All, C - Consoles, L - Lists, P - Punches, or R -
Readers.
The C, L, P, and R commands assign devices immediately. The user types the name
of the device to be assigned. If he strikes a return in response to the device name
prompt, the command is aborted.
Selected Error Messages:
Self-explanatory.
Examples of Use:
DEVICE — in v o k e u t i l i t y
Function:
DIFF compares two files. It can simply state if the two files are d if f e r e n t
(stopping immediately af te r the first diff ere nce is located) or it can list all of the
differences between two files on a byte-for-byte basis. The fo rm "DIFF dir:ufn
o..." compares the file in the indicated directory with the file by the same name in
the cu rr en t directory. The fo rm "DIFF d ir :u f n l,d ir :u f n2 o..." compares the two
files indicated.
Options:
C Compare Files Only and Stop at First D iff ere nce
M Multiple Runs; when a comparison is complete, prompt the user
for new disks, allow him to change disks, and then run the
comparison again until the user says to stop
Comments:
If used to prin t out differences. D i f f presents the following in fo rm at io n to the
user:
o Relative Offset from the beginning of the file
o Byte values in the two files:
- in Decimal
- in Hexadecimal
- in ASCII
Selected Error Messages:
"AFN Not Allowed" means that the user specified an ambiguous file name (one
containing wild cards). Both file names must be unambiguous.
Examples of Use:
DIFF text:myfile.txt -- prints differences between
MYFILE.TXT in TEXT: and MYFILE.TXT
in current directory
DIFF myfile.txt — compares MYFILE.TXT against itself
DIFF backup:myfile.txt me
— compares MYFILE.TXT in BACKUP: with MYFILE.TXT
in the current directory; stops as soon as
a difference is found; when done, prompts
the user to change disks (BACKUP could be a
floppy, and this command is checking to see
that all copies of MYFILE.TXT on several
disks are the same)
Chap. 3 TOO LSET OF ZCPR3 33
Comments:
The syntax of DIR is not the same as that of X D I R and XD. DIR is designed to be
small (only 2K) an d fast, while providing more utility tha n the ZCPR3-resident or
RCP-resident counterparts.
If the user wishes to use an option, the AFN must be filled with *.* —otherwise, the
option will be int erpreted as a file specification.
A slash used as a delimiter (DIR /A, for instance) automatically causes the built-in
documentation to be displayed.
Selected Error Messages:
"Ovfl" means tha t there was not enough b u f f e r space in the TPA to contain the disk
directory.
Examples of Use:
DIR — displays all non-system files in the
current directory in the following fashion:
1. Horizontal display
2. Sorted by file name and type
DIR (CP-Resident)
Syntax:
DIR dirrafn o...
Transient Counterpart:
DIR, XD, X DI R
34 U sing Z CPit.3 a n d C o m m a n d D efin itio n s Sec. 1
Function:
Display a disk directory to the user.
Options:
A Select non-system and system files
S Select system files only
Comments:
The DIR command is used to display the names of the files in the curre nt directory
with out any bells or whistles (such as sorted ou tput and file size information). It
has three basic forms:
DIR DU:afn — Display $DIR File Names
DIR DU:afn S — Display $SYS File Names
DIR DU:afn A — Display All File Names
Comments:
This command is better than the DIR in ZCPR3 in that it sorts the file listing.
Horizontal display fo r m at is used.
Selected Error Messages:
None.
Examples of Use:
1. comment lines -lines in which the first non-blank character is a semicolon (;).
2. word def ini ti on lines- lin es that begin with a dash (-) in column one followed
immediately by a word.
36 U sing Z CPii.3 a n d C o m m a n d D efin itio n s Sec. 1
4. output lines—any other line which does not conform to one of the three categories
above; these lines generate the output sent to the device.
Selected Error Messages:
Self-explanatory.
Examples of Use:
DPROG — program from STD.DPG
DPROG ASM — program from ASM.DPG
DPROG Programming:
DP R OG is a 3K inter prete r for a device programming language. This language allows
the de fin it io n of words (symbols up to 16 characters long) that contain any
combination of output f or m at control instructions, text strings, and references to
other words. Once a word has been defined, it can be named in an ou tput line, and its
def initio n (including embedded fo rm at controls) will be translated and sent to the
console, printer, or punch device. Word references can be nested up to 128 levels deep.
For example:
; Use Words
7
"This is a test\n" test "ABC" normal_form "\nEnd of Test"
Execution of the output line will cause the device to d is p la y/ p r in t the following:
This is a test
Char: A 41 65
Char: B 42 66
Char: C 43 67
End of Test
Chap. 3 TO O LSET OF ZC PR 3 37
The following 2-character escape sequences are output literally when used in fo rmat
definitions, but are translated according to the curr ent f o r m at d efi ni ti on when they
appear in quoted strings.
Ac Define control character
\b Backspace char
\d Delete char (DEL)
\e Escape char (ESC)
\1 New Line char (CRLF pair)
\n Line Feed char (LF)
\r Carriage R e t u r n char (CR)
\t Tab char (TAB)
\# Numeric value (forms are \ d for decimal, \ d H for hex, \ d q for octal,
\dB for b i n a r y : \ l , \245, \33h, \0f eH , \ 1 1 lb, \77q, etc)
Additionally, the f o r m a t expression is of the form (<format text>) where <format
text> can contain any character sequence as well as recognize the following output
directives:
%c O utp ut chars as ASCII characters
%d Ou tput chars as floating decimal ASCII chars
%x Ou tput chars as 2 hex ASCII chars
%2 Ou tput chars as 2 decimal ASCII chars
%3 Ou tput chars as 3 decimal ASCII chars
Any text can s u rr oun d these output directives, and each directive can be used as many
times as desired in a f or m at expression. Once a f o r m at expression is given, it is used
until a new expression is defined. For example:
(%x %d ) "\12\10hA" (%c) "\12\10hA"
will output:
OC 12 10 16 41 65 ALAPA
(where AL and AP are the ASCII control-L and control-P).
The user can direct output to the console, printer, or punch at any time (for
programming the physical devices attached to these logical devices); there are
debugging commands (pause to examine output, dump word d ef in it io n table, dump
format expression); and you can set up as many *.DPG files as you want for
programming a variety of functions. DP R OG is a true ZCPR3 utility and searches the
current path for the *.DPG files. Thus, if *.DPG files arc placed in the ROOT
directory, they will be f ou nd fr om any directory on the system.
A word def initio n un d er D PR OG takes the following form:
-word_symbol text_of_definition
where is the first character in the line.
38 U sing Z C PE 3 a n d C o m m a n d D e fin itio n s Sec. 1
The following D PR O G commands are available for debugging and other purposes:
Output Direction:
Data Dump:
Output Pause:
< Pause and wait for user to strike key (AC will abort)
DPROG can be used within an alias, ZEX command file, or any other ZCPR3
environment. For instance, the following WordStar alias is reasonable:
IF NEC=$2
DEV L NEC <— assign printer
WSN $1 <— run NEC version of WS
ELSE
DEV L TTY <— assign printer
DPROG CORRESP <— program printer for
correspondence
WS $1 <— run proper version of WS
FI
Listing 3-1 provides a clear example of how a .DPG file can be used by D P R O G to
program a Tclcvideo 950 CRT.
Define Functions
Function Key:
FKEY Fn|FnS FKEY_FDX|FKEY_LOC|FKEY_HDX "string" CTRLY
FKEY Prefix
Fn or FnS Function Key Number or Number Shifted
(FI or FIS)
FKEY_FDX or Full Duplex - Send to Computer Only
FKEY_LOC or Local - Send to Terminal Only
FKEY_HDX Half Duplex - Send to Computer and Term
"string" Contents of Function Key
CTRLY Terminator
-f2 "2M
-f 2s i i = ii
-f 3 "3"
-f3s ii > ii
-f4 " 4 ii
-f4s ii 2 ii
-f5 "5"
-f5s 1'
-f 6 "6"
-f6s "A"
ii 7 ii
-fl
-fls ii B"
-f8 "8"
-f8s "C"
-f9 ii g ii
-f9s "D"
-flO ii . ii
-f 10s "E"
-fll ii
/. ii
40 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
-fkey fdx ii 2_ ii
-fkey_loc it 2 "
Cursor: C_OFF|C_BB|C_SB|C_BU|C_SU
C_OFF No Cursor
C_BB Blinking Block
C_SB Steady Block
C_BU Blinking Underline
C SU Steady Underline
-c off .
esc " 0 "
-c bb esc ".1"
-c sb esc " .2 "
-c bu esc " .3"
-c su esc " . 4 "
f
; Keyclick: CLICK_OFF|CLICK ON
Chap. 3 TO O LSET OF ZCPR3 41
-els ,,AZ"
t
; End of TVI 950 Definitions
-my_key f1
-my_text "xd\r"
42 U sing Z C P tl3 a n d C o m m an d D efin itio n s Sec. 1
function_key
screen on
D U /D IR Forms
Use the DU form, standing alone, to log into a d if f e r e n t directory. This command has
three basic formats:
Change Disk D:
Change User U:
Change both Disk and User DU:
Chap. 3 TO O LSET OF ZCPR3 43
The DIR form standing alone may also be used to log into a d i f f e r e n t directory. The
format is:
TEXT: (where "TEXT" is the name of the desired directory).
Named directories have passwords associated with them. Any attempt to access a
named directory tha t has a non-blank password will cause the user to be prompted for
the password. If he supplies an invalid password, access is denied and he remains in
his current directory.
The DU: form may be disabled under ZCPR3, leaving only the DIR: form. This option
allows directory access to be strictly controlled, since only named disk /us er areas can
be referenced and password protection is provided.
EC H O (version 1.0)
Syntax:
ECHO text <—send <text> to console
or
ECHO $tcxt <—send <text> to printer
Function:
ECHO echoes the text which follows it to the CON: or LST: devices. If the first
non-blank character of this text is a then ECHO sends its output to the LST:
device.
Options:
None.
Comments:
The purpose of ECHO is two-fold:
1. To provide a convenient way to send messages to the console during the execution
of a command file or command line; for example:
ECHO Assembling;ASM myfile.BBZ;ECHO Loading;LOAD myfile as a single
multiple command line will print the informative messages "ASSEMBLING" and
"LINKING" dur ing the respective commands
2. To provide a convenient way to send escape sequences to the C RT or printer;
ECHO uses direct BIOS calls without any character translation, so sequences for
programming intelligent devices can be issued by r u nni ng echo and typing in
those sequences; for example:
ECHO AZ
will clear the CRT screen if AZ is the Clear Screen character for the user’s
terminal, and
ECHO $ AL
will form feed the printer (assuming that the printer responds to the form feed
character).
NOTE:
Since the command input line editor capitalizes the command lines, all alphabetic
characters are automatically capitalized when echoed.
C hap. 3 TO O L SE T OF ZCPR3 45
EC H O (CP-Resident or RCP-Resident)
Transient Counterpart:
ECHO
Syntax:
ECHO text <—send text to console
or
ECHO Stext <—send text to printer
Function:
CP- or RCP-resident ECHO commands behave in all respects like the transient
count erp art previously described.
ELSE
< statements >
FI
ER A (CP-Resident)
Transient Counterpart:
ERASE
Syntax:
ER A a f n <—erase files
or
ER A a f n V <—erase files with verify
Function:
The ERA command erases the indicated file(s). If the V er ify option is used, a list
of all matching files is displayed and the user is prompted for confirmation. If the
user confirms tha t erasure is desired, all files on the list are erased.
Options:
V verify erasure
Comments:
Compare this ERA fo rm to the RCP-Resident ERA form.
Selected Error Messages:
None - self-explanatory.
Examples of Use:
ERA b7:*.bak
ERA text:* .tmp V
ER A (RCP-Resident)
Syntax:
ERA a f n <—erase files
or
ERA afn I <—inspect files before erasing
Transient Counterpart:
ERASE
Chap. 3 TO O LSET OF ZCPR3 47
Function:
The ERA command erases the indicated file(s). It is not able to erase R ea d/ O n ly
files, but it can erase System files. The name of each file is print ed as it is erased.
If the I (Inspect) option is used, ER A prints each matching file name and prompts
the user for approval to erase; if approval is given, the file is erased, otherwise
ERA leaves the file intact and proceeds to the next matching file name.
Options:
I Inspect each file and request approval to erase.
Comments:
None.
Selected Error Messages:
None.
Examples of Use:
E R A S E (version 5.0)
Syntax:
ERASE dir: a f n 1,dir: afn2,... o...
Function:
ERASE erases files in the file list. If no option is selected, ERASE does not "sec"
system files, and requests permission to erase read-only files encountered, but
r e a d / w r i t e non-system files are unconditionally erased.
Options:
S Erase system files encountered in the file list.
R Erase R e a d / O n l y files in the list without asking the user for permission.
I Inspect; ERASE displays the name of each file in the list and asks
permission before erasing the file. If the user gives permission but ERASE
discovers tha t the file is R / O with the R option off, it will request a
second co nf irm ati on before performi ng the erasure.
48 U sing Z C P R 3 a n d C o m m an d D efin itio n s Sec. 1
Comments:
None.
Selected Error Messages:
Self-explanatory.
Examples of Use:
ERASE text:*.txt,asm:*.tmp — erase a l l . TXT files in the
TEXT: directory and a l l . TMP
files in the ASM: directory.
E R R O R X (version 1.0)
Syntax:
ERRORX
50 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Function:
E R R O R X disengages the current error handler, leaving no error han dler enabled.
The d ef au lt error control facility of ZCPR3 is now in effect; if an error occurs in
the command line, the command line from that point f o r w ar d is printed (followed
by a ’? ’).
Options:
None.
Comments:
None.
Selected Error Messages:
No error messages are generated by ERR O RX .
Examples of Use:
ERRORX — disengage any Error Handler currently enabled
FI (from S Y S F C P 1.0)
Syntax:
FI anytext
Function:
FI terminates the curre nt IF Level. If there is no current IF level, FI docs nothing.
Options:
None (any text may follow the verb FI).
Comments:
None.
Selected Error Messages:
None.
Examples of Use:
I F E X IS T M Y FIL E . ASM
< statements >
ELSE
< statements >
FI
Syntax:
FINDF a f n l , afn2,... o
Function:
FINDF searches through all of the known disks and user areas for files matching
any of the indicated file specifications.
Options:
S Include System Files
Comments:
If the S option is omitted, F I N D F will search only for Non-System files. Use of the
S option causes FI N D F to search for both System and Non-System files. The search
begins at disk A and extends until F I N D F encounters the last possible drive or a
drive that is not loaded. All user areas (0 to 31) are examined.
FINDF displays the names of the files found, grouped by drive and user area.
Selected Error Messages:
Self-explanatory.
Examples of Use:
FINDF xdir.com s — search all drives and user areas
(both system and non-system) for XDIR.COM
FINDF xd.com,help.hip,myfile.txt
search all Non-System files for XD.COM,
HELP.HLP, and MYFILE.TXT
G E T (CP-Resident)
Syntax:
GET adr uf n
Function:
GET loads a file into memory starting at the specified page address. It requires
two arguments: the nu mber (assumed to be hexadecimal) of the 256-byte page in
memory at which to start the load; and the name of the file.
Note that "adr" is a page number, not an absolute address. Thus, if a d r = l, loading
starts at location 100H; if adr=2d loading starts at location 2D00H, and so on.
Options:
N one.
52 U sing Z C P K 3 a n d C o m m a n d D e fin itio n s Sec. 1
Comments:
None.
Selected Error Messages:
"TPA Full" means that the file has hit the top of the TPA in its load.
Examples of Use:
GET 40 myfile.bin — load MYFILE.BIN into memory at 4000H
GO (CP-Resident or RCP-Resident)
Syntax:
GO parameters
Function:
The GO command reexecutcs the last program loaded into the TPA without having
to reload it.
The parameters are parsed in the same way as for any transient command, and the
app ropriate buf fers are loaded by ZCPR3. Aft er ZCPR3 has finished with the
parsing and b u f f e r loading, it "calls" the program loaded at 100H.
Options:
None.
Comments:
GO must not be used when a shell is active, since the shell comes into memory at
100H and overlays the last program loaded there. If GO is used, the probability is
that the shell, not the last program, will be reinvoked.
Selected Error Messages:
None.
Examples o f Use:
XD
GO ROOT: — rerun XD with ROOT: as a parameter
G O TO (version 1.0)
Syntax:
GOTO label
C hap. 3 TO O L SE T OF ZCPR3 53
Function:
GOTO is a ZCPR3 utility, designed to be ru n f r o m wi thi n a ZE X command file
that permits branching. It accepts only one argument, a label, which is defined
within the ZE X file as a special comment of the form:
;=label
Any text which follows the "label" phrase is considered to be comment and is not
processed.
Options:
None
Comments:
GOTO works correctly only if executed within a ZEX command file; otherwise
GOTO will issue an error message.
Without the ZCPR3 Flow Control facility, GOTO would be of little value. With IF,
however, GOTO is extremely useful in setting up loops and other flow-control
constructs.
Selected Error Messages:
"ZEX Not Running" means that GOTO was executed fr o m outside a ZE X command
file.
"Label xxx Not F oun d — Aborting ZEX" means that the referenced label was not
fo un d wi thi n the command file, so ZEX execution is terminated.
Examples o f Use:
ZEX Command File 1:
REG SI 0;note Register 1 = 0
;=start
XIF;note Exit all pending IFs
REG PI;note (Reg 1) = (Reg 1 ) + 1
ECHO Hello, World
IF ~1 3 /note IF Register 1 <> 3
GOTO START
FI
Z EX Command File 3:
if NEC=$2
echo Terminal is NEC
goto done
fi
if TTY=$2
echo Terminal is TTY
goto done
fi
if DIABL0=$2
echo Terminal is Diablo
else
echo Terminal is Undefined
fi
;=done
xif;note Exit all pending IFs
ws $l;note Edit file
H E LP (version 5.0)
Syntax:
HELP <~ display HELP.HLP
or
HELP filename.typ <—display HELP file (if ’typ ’ omitted, HLP is used)
Function:
HELP displays HELP files in an interactive way to the user on his console CRT. It
is also able to p rin t selected screens or inf ormation sections on the printer.
Options:
N one.
Chap. 3 TO O LSET OF ZCPR3 55
Comments:
See Chapter 4 for an overview of the HELP subsystem and a detailed description of
the structure of HELP files.
Selected Error Messages:
See Overview of Help command, below.
Examples of Use:
HELP — display HELP.HLP
HELP myfile — display myfile.HLP
HELP myfile.txt — display myfile.txt
H E L P C K (version 1.0)
Syntax:
HELPCK dir:ufn o <-- d ef au lt file type is HLP
Function:
HELPCK checks the syntax of a HELP file. It analyzes the file, providing a
variety of statistics and reporting on structural errors. Reports include a listing of
the options if the file is user-indexed; this listing should be manually checked by
the user to see that all options are included and no additional, hidden options exist.
Options:
P Send report to Printer
Comments:
None.
Selected Error Messages:
Messages are self-explanatory.
56 U sing Z C P ri3 a n d C o m m a n d D e fin itio n s Sec. 1
Examples of Use:
HELPCK myhelp — report on MYHELP.HLP
HELPCK myhelp P — report on MYHELP.HLP on printer
H E L P P R (version 1.0)
Syntax:
H EL P P R afnl,afn2,... o...
Function:
H EL P P R prints out a HELP file. It starts each in fo rm ati on section on a new page
and ignores fo rm feeds (used to separate frames), so the data is presented in a
sequential fashion.
Options:
H@hcad@ Heading Text that appears at the top of each page
I Inspect Files (select) before printing
L N umber each line
Occ Off set each line by cc spaces
Snn Skip to page nn before beginning pr int
T (If TIMELIB installed) tur n o f f time display
Comments:
H EL P P R is specifically designed to take advantage of the inte rn al structure of
HELP files to pr int the data in a logical manner. It is the refore p r efe rr ed over
P R I N T when HELP files are to be printed.
Selected Error Messages:
Error messages are self-explanatory.
Examples of Use:
HELPPR myfilel,myfile2 o5 — print myfilel.HLP and
myfile2.HLP offset by 5 spaces
on each line
HELPPR myfile s5 — print myfile.HLP starting at
the 5th page
IF (version 1.1)
Chap. 3 TO O LSET OF ZCPR3 57
Syntax:
IF cond args
or
IF -c o n d args
Function:
IF tests the indicated condition to see if it is T R U E and, if so, sets the Flow State to
TR UE (allowing the following commands to execute). If the condition is FALSE,
the Flow State is set to FALSE (allowing only Flow Commands to execute).
Options:
Option Meaning
T T R U E (Flow State is Set to TR U E)
F FALSE (Flow State is Set to FALSE)
EMPTY afn,. If all files in the indicated list are EMPTY (size is OK), then
Flow State is Set to T R U E
E RR O R If the ZCPR3 Error Flag is Set, then Flow State is Set to T R U E
EXIST afn,... If all files in the indicated list exist, then Flow State is Set to T R U E
INPUT User input is enabled, and if the user strikes T, Y, <CR>, or
<SP>, the Flow State is Set to T R U E
NULL af n If there is no ’a f n ’ (field is blank), then the Flow State is Set to
TRUE
TCAP If a Z3TCAP is installed, the Flow State is Set to T R U E
WHEEL If the Wheel Byte is Set, the Flow State is Set to T R U E
rcg value If the indicated register (0-9) has the indicated value (0-255),
the Flow State is Set to T R U E
afnl=afn2 If the two AFNs are identical in name (11 char FILENAME.TYP
are same), the Flow State is Set to T R U E
Comments:
In all cases, if the indicated condition is T RU E, the Flow State is Set to TRU E; if
the indica ted condition is FALSE, the Flow State is Set to FALSE.
This command is invoked if the current Flow Command Package has the 1F.COM
facility enabled. If this is the case, whenever an IF command is issued, the FCP
will load IF.COM from the ROOT directory into memory and execute it. The
command tail is passed to IF.COM, and IF.COM acts as a conventional COM file
from that point forward. All b uf fer s are loaded correctly (FCBs at 5CH and 6CH,
TB U F F at 80H, etc).
A leading tilde (~) character before a condition negates the effec t of the condition.
If the condition is FALSE, the Flow State is Set to T R U E , and vice-versa. Example:
"IF ~T" is the same as "IF F"
"IF - N U L L arg" is T R U E if ’arg ’ is non-blank
"IF - E X I S T afn,..." is T R U E if ’afn,...’ do NOT
exist (AFN and A FN ... must each not exist)
For each condition given, only the first two characters are significant (eg, NU for
NULL).
58 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
IF -EXIST ZEX.ASM,ZEX.ZEX
if any one of these files does not exist, the
Flow State is set to TRUE
IF EXIST ZEX.ASM,ZEX.ZEX
if any one of these files does not exist, the
Flow State is set to FALSE (ie, all files
must exist for a TRUE Flow State)
IF NEC=$1
if the first passed parameter is the same as the
file name "NEC.", then the Flow State is Set to TRUE
IF 5 5
if Register 5 = 5 , the Flow State is Set to TRUE
IF (FCP-Resident)
Syntax:
Same as for transient IF.
Function:
Same as for transient IF. The IF command described here is resident within
SYSFCP 1.0 when the COMIF equate is set to FALSE.
Options:
Same as for transient IF except that the file lists are not p e r m it te d — only one
ambiguous file name.
Chap. 3 TO O LSET OF ZCPR3 59
Comments:
This command is invoked if the curr ent Flow Command Package has the IF.COM
facility disabled. If this is the case, whenever an IF command is issued, the FCP
will resolve it internally. The resolution of the IF command within the FCP itself
is noticeably faster (approximately 0.5 to 1.5 seconds) than resolution by loading
and executing IF.COM.
Each of the options of the Resident IF may be ind ependently enabled or disabled.
These options are installation-dependent, and the SHOW command will display the
available options for any installation.
Selected Error Messages:
None.
Examples of Use:
See transient IF.
IF S T A T (version 1.0)
Syntax:
IFSTAT
Function:
IFSTAT displays the curre nt IF level. IFSTAT will report a Level N umber from 1
to 8 (IFs may be nested up to 8 levels deep) or will reply "No Active IF".
Options:
None.
Comments:
The Flow State must be T R U E for IFSTAT to run.
Selected Error Messages:
None.
Examples of Use:
IFSTAT — the current IF level is displayed
JU M P (CP-Resident)
Syntax:
JUMP address <—bran ch to indicated hex address
60 U sing Z C Pii.3 a n d C o m m a n d D efin itio n s Sec. 1
Function:
JUMP can bran ch to any location in memory. It takes only one argument, which is
the target address, specified as a 16-bit hexadecimal number (leading zeros may be
omitted).
Options:
None.
Comments:
JUMP is useful for entering a PROM- or ROM-based routine, such as a monitor
program.
JUMP 100 is the same as the GO command except tha t first FOB has ’100’ in it as a
file name. The text following a "JUMP 100" instruction is parsed into the
app rop riate bu f f er s as it normally would be.
Selected Error Messages:
None.
Examples of Use:
JUMP 100 — "call" routine at 100H
JUMP F800 — "call" the routine at 0F800H
LD R (version 1.0)
Syntax:
LDR ufnl,ufn2,...
Function:
LD R is a general-purpose System Segment loader for ZCPR3. It loads all of the
ZCPR3 System Segments into their appropriate buffers, checking their f o r m at and
content before approving and completing each load. Each System Segment is
specified unambiguously.
Options:
None.
Comments:
The following System Segments are loaded into memory bu f f er s by LDR:
*.ENV files Env ironment Descriptors
*.FCP files Flow Command Packages
*.IOP files I n p u t / O u t p u t Packages
*.NDR files Named Directory Files
*.RCP files Resident Command Packages
*.Z3T files Z3TCAP Entries
Chap. 3 TO O LSET OF ZCPR3 61
The contents of each file to be loaded are read into a memory b u f f e r and examined
segment by segment. Segment-unique structural checks, based on the file type, are
performed. If the checks are passed, the segment is copied into the correct memory
buf fer as det ermined by the data contained in the En vi ro nm ent Descriptor. If the
checks are not passed, an error message is issued and the next file in the list is
processed.
Since the Env ir on m en t Descriptor (currently residing in its own memory bu ff er)
provides the address at which to load a b u f f e r e d system segment, it is important
that the En vi ro nm ent Descriptor be the first segment loaded by LDR. An
alternative to this procedure would be to make the BIOS initialize the Environment
Descriptor on Cold Boot, but this would require a relatively large BIOS overhead
(over 128 bytes for the initial Envir on men t Descriptor).
When L D R loads an Env ir o n m en t Descriptor, it places it at the address installed in
LDR during the ZCPR3 System installation. All other system Segments are loaded
at locations specified by the Env ironment Descriptor cur rently residing in
memory.
Selected Error Messages:
"filename.typ is not a Valid Type" means that the file type of the indicated file is
not ENV, FCP, IOP, NDR, RCP, or Z3T.
"filename.typ Contains a Format Flaw" means tha t the str ucture of the indicated
file was not correct.
Examples of Use:
LDR SYS . ENV, MYIO . I O P , MYCMDS. R C P , M Y I F S . FCP
— load SYS.ENV, and, based on the data in this Envi ro nme nt Descriptor, load the
I/O Package MYIO.IOP, the Resident Command Package MYCMDS.RCP, and the
Flow Command Package MYIFS.FCP
LDR TE R M 1. Z 3T
—replace the cu rr en t Z3TCAP entry with TERM1.Z3T
L IS T (CP-Resident)
L IS T (RCP-Resident)
Syntax:
LIST u f n CP-resident and RCP-resident
LIST a f n RCP-resident only
Transient Counterpart:
PRINT
62 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Function:
LIST displays a file on the printer. No paging or fo rm at tin g of any kind is
performed.
Options:
None.
Comments:
The CP-Resident version of LIST accepts only an unambiguous file name. The
RCP-Resident version accepts an ambiguous file name. The matching files are
printed sequentially without any page breaks between files.
Selected Error Messages:
None.
Examples of Use:
L I S T M Y FIL E .T X T — print file on printer
L I S T *.txt — print all .TXT files in the
current directory on the printer.
M C O P Y (version 1.4)
Syntax:
MCOPY dir:=dir:afnl,afn2,dir:=dir:afn3,... o...
Function:
MCOPY is a file copy program designed for use un der ZCPR3. It supports many
features related specifically to the ZCPR3 System and is intimately tied into the
ZCPR3 System.
The basic purpose of MCOPY is to copy files from one directory (disk/user area) to
another un de r ZCPR3.
MCOPY only copies files; it does not rename them. This is a major dif fer en ce
between MCOPY and PIP. An attempt at renaming (e.g., MCOPY text.T L t x t= f 2.txt)
just copies F2.TXT into the TEXT: directory, but it is still named F2.TXT (F I.T XT
is ignored).
Options:
E Test for Existence of File on Destination and User Approves Copy
before Copy is Done
I User Approves Each File before Copy Begins
M Multiple Copy (Repeat) Facility. This allows the user to backup several
files to several disks by copying all the specified files, prompting the
user for a new disk, and then copying the files again, continuing until
Chap. 3 TO O LSET OF ZCPR3 63
The E option (Existence Test) looks in the destination directory to see if the file it
is about to copy is already there. It then tells the user of its findings and asks him
if he wants to go ahead with the copy. The user may elect to copy or not copy as he
desires.
The I option (Inspect) displays all filenames tha t match the indicated source files,
allowing the user to select which of them are to be copied.
The M (Multiple Copy) option pauses before starting the copy operation. During
the pause, the user may abort the procedure or insert a disk into the source drive,
the destination drive, or both, and then instruct MCOPY to proceed. Aft er copying
all of the indicated files, MCOPY pauses again, allowing the user to change disks
again. This sequence continues until the user aborts the procedure.
The Q (Quiet) option turns o f f the MCOPY activity display. During "noisy"
operation, MCOPY is constantly telling the user wh at it is doing. I feel that this is
better than quietly having problems without the user knowing wh at is going on.
MCOPY pays attention to the QUIET flag of ZCPR3, and the initial mode of
MCOPY is set by this flag.
The V (Verify) option checks the copied file to insure that the copy is good. With
this option engaged, MCOPY computes a CRC value of the source file dur ing read
operations; when copying is complete, MCOPY stores the computed CRC. MCOPY
now reads the destination file and computes its CRC value. The two CRC values
are compared; any diffe re n ce indicates a copying error.
Comments:
MCOPY can also be used for making multiple backups, pausing between successive
copy passes to allow the user to change disks. Once MCOPY has begun operations,
the user need never warm boot the system af te r changing disks; MCOPY docs that
for him automatically.
If a destination directory is not specified, MCOPY looks for a directory named
BACKUP: and copies to this directory if found. If there is no directory named
BACKUP:, MCOPY will copy to BO: (this can be changed by reassembling MCOPY
or by modify ing it with DDT and then SAVEing the modified version).
In copying a file fr om one directory to another, MCOPY performs the following
steps:
1. It logs into the source directory and scans for the files specified by the user.
2. It logs into the destination directory, determines if a copy of the file exists on the
destination and, if so, deletes it.
3. MCOPY copies the file in the source directory into the destination directory.
4. MCOPY sets the attributes of the file in the destination directory to be the same
as those in the source directory.
64 U sing Z C t R 3 a n d C o m m a n d D efin itio n s Sec. 1
"Shell Stack Ent ry Size" means tha t the Shell Stack elements arc too short for
MENU to store its parameters.
"TPA Full" means th a t there is not enough room in the TPA to load the *.MNU file.
Examples of Use:
See Chapter 5.
M K D IR (version 3.0)
Syntax:
MKDIR <—enter utility
or
MKDIR dir:ufn <—enter utility and load N D R file
Function:
MKDIR creates Named Directory Files; these are disk files containing the
mnemonic names and the dis k/user areas with which they are associated. M KDIR
is an editor. It provides a scratch area in which the user can set up a named
directory, review it, edit it, and make any changes he wishes. When satisfied, the
user can write it out to disk as a file or abort and throw it away.
Options:
None.
Comments:
See text unde r "Using MKDIR" in the section on Named Directories.
Selected Error Messages:
Self-explanatory.
Examples of Use:
See text unde r "Using MKDIR" in the section on Named Directories.
MU (RCP-Resident)
Syntax:
MU <—invoke MU at 100H
or
MU address <—invoke MU at indicated address
Function:
MU is identical to MU3 in function, with the exception that the FI command
(Hexadecimal Calculator) is not supported. The dif fe re nc e between MU and MU3
is tha t MU executes as an RCP and MU3 executes as a transient. As an RCP, MU
allows the user to examine the TPA without concern for side effects, so debugging
66 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Value
AR Replot Screen
1
1
A
As the user moves the cursor about on the screen, the value in the upper right
corner changes, indi cating both the hex value and ASCII chara cter representation
of the byte being pointed to. Also, a cursor moves in the Hexadecimal Memory
Dump region, indicating where the user is in the curre nt 128-byte block.
Once the cursor is pointing to a desired byte, N or T commands may be used to
change memory starting at the byte indicated by the cursor.
Movement Commands
The cursor may be moved ar oun d the screen using the WordStar cursor movement
convention. If the arrow keys for the user’s terminal are installed via the ZCPR3
TCAP, then they keys may also be used to move the cursor.
68 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
Select address At any time, the user may strike the letter A (case makes no
difference) to select a d i f f e r e n t region of memory to view. MU3 will display 128
bytes of memory starting at the address given by the user.
Move One Block Forward (+) or Backward (-) The commands "+" and move the
display f o r w a r d and backward, respectively, by one block (128 bytes). The
movement is instantaneous, and the cursor is repositioned to the first byte in the
new block.
Value Entry Commands
The N command is used to enter a group of hexadecimal numbers into memory
starting at the address indicated by the cursor. The user is prompted for input, and
he may then enter a series of hexadecimal values, separated by spaces. Entry
terminates when the user strikes the R E T U R N key. Case is not significant. Any
number prefixe d with ’# ’ is decimal.
For example, the following is a sample sequence of values which may be entered:
0 If f3 ff 2C C3 0 2 3 4 #192 #255
The T command is used to enter text into memory starting at the address indicated
by the cursor. The user is prompted for input, and he may then enter a string of
characters. All characters input are significant. E n tr y terminates when the user
strikes the R E T U R N key. Case is significant.
If the user wishes to embed a numeric value within a text string, the escape format
<nn> is provided, where ’n n ’ is a hexadecimal value as shown above. The form
<#nn> is also provided, where ’n n ’ in this case is a decimal value. The form ’« ’
inserts a single ’<’ character into memory.
For example, to enter the sequence ’<this is a test>’ followed by carriage ret ur n and
line feed characters into memory starting at the cursor, the use would type:
<<this is a test><0d><#10>
’Od’ is OD hex and ’# 1 0 ’ is 10 decimal or 0A hex. The leading ’« ’ translates into one
O th e r MU3 Commands
The C command allows the user to enter a command line for immediate execution
by the ZCPR3 Command Processor. If MU3 is invoked as a shell via the SHSET
command, this command provides an escape mechanism as well as a way to execute
a command line from within MU3. The SHCTRL POP command will terminate the
current shell on the shell stack.
The H command invokes a hexadecimal calculator. The user is asked to enter two
hexadecimal numbers. The second number is added to and subtracted fr o m the
first number, the results being printed immediately. Again, decimal numbers may
be entered by prefix ing them with ’# ’.
The AR command refreshes the screen for the user. This is h and y if the screen was
garbled in some way, such as by tur ni ng o f f the CRT.
C hap. 3 TO O LSET OF ZCPR3 69
N O TE
Syntax:
NOTE anytext
Function:
NOTE is used to express comments. A line beginning with a semicolon (;) is a
comment, and a command whose verb is NOT E (there may be many commands on
one line, separated by semicolons) is a comment.
Options:
None.
Comments:
NOTE is available as a CP-Resident command, an RCP-Resident command, and as
a transient. It is recommended tha t it be implemented as a CP-Resident command
due to its very low cost and high utility in command files and aliases.
Selected Error Messages:
None.
Examples of Use:
NOTE this is a comment
P (RCP-Resident)
Syntax:
P <—display next 256 bytes
or
P ad d r <—display 256 bytes starting at addr
or
P a d d r l ad dr 2 <—display memory range
Transient Counterpart:
MU3
Function:
The P (PEEK) command allows the user to examine an area of memory. If the user
simply types "P" with no address, the next 256 bytes of memory are displayed. If
the user types "P address", 256 bytes of memory starting at the indicated address
are displayed. If the user types "P a d d r l addr2", memory in the range a d d r l
through addr2 is displayed.
70 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
Options:
None.
Comments:
P EEK does not modify the memory locations it displays.
Selected Error Messages:
None.
Examples of Use:
P 50c0 — peek starting at 50C0H
P 4000 4fff — peek from 4000H to 4FFFH
P A G E (version 2.0)
Syntax:
PAGE dir:afnl,dir:afn2,... o...
Function:
The PAGE command lists one or more files to the console, one screen at a time.
Unlike TYPE, PAGE knows the width and depth of the screen; thus, when wide
listings (such as those produced by assemblers) generate w r a p a r o u n d lines, the
w r ap ar o u n d lines are counted by PAGE and do not overflow the screen.
Options:
0-9 Set Charac ter Print Speed Delay
I Inspect files
L N um ber lines
P Disable pause at end of screen
Sn Skip to page n and then begin
Comments:
While a file is being paged to the user, the user can strike one of the digits to vary
the speed of the output dynamically. 0 is the fastest, 9 is the slowest. This option
allows the user to scan selected portions of a file by r u nn in g PAGE with the P
option (so it does not stop when the screen is filled) and striking a digit from time
to time to speed up over sections that are of no interest and slow down for sections
he wants to read.
While the output is being directed to the screen, PAGE supports the following
single-character commands to change the output display in various ways:
0 to 9 change speed (0=slowest, 9=fastest)
P or p toggle pause when screen fills (the user can dynamically tur n on and
o f f the ability to delay when a screen fills)
AX skip to next file
Chap. 3 TO O LSET OF ZCPR3 71
PAGE constantly looks for user input, so these commands can be issued at any
time, including the intervals when PAGE has paused a f te r filling the screen (its
default) or has been halted by a AS. Characters other th an the valid command
characters listed above are ignored.
Selected Error Messages:
Self-explanatory.
Examples of Use:
PAGE *.txt p8 — page all *.TXT files; begin with
paging off; set speed to 8.
PAGE myfile.txt s5 — page MYFILE.TXT, starting at page 5.
P A TH (version 3.0)
Syntax:
PATH
or
PAT H path-expression
Function:
PATH allows the user to display the curre nt path or set a new path. The display
shows the path in three formats: Symbolic, Absolute (DU), and Named Directory
(DIR). The path expression may intermix any of these formats as desired to
express the new path.
Options:
None.
Comments:
PATH determines the address of the path with which it is going to work from the
ZCPR3 Env ir on m en t Descriptor.
The P AT H command deals with path expressions—tha t is, a sequence of directory
names which can be expressed as "ambiguous" D U forms, absolute DU forms, or
Named Directory forms.
To illustrate, let’s say that the user is logged into Bl. The path "$0 A$ AO ROOT"
represents the sequence BO to A1 to AO to ROOT.
Selected Error Messages:
"Bad Expression at <text>" indicates there was an error in the path expression at
the indicated point.
72 U sing ZCI R 3 a n d C o m m a n d D efin itio n s Sec. 1
Examples of Use:
PATH $0 A$ A15 set path from current disk/user 0
to disk A/current user to disk A/user 15.
PATH A$ ROOT set path from disk A/current user to ROOT:
P O K E (RCP-Resident)
Syntax:
PO K E address vai l val2 ... vain
or
PO K E address "character string
Function:
The P OKE command allows the user to change the content of memory. The user
must specify an address to POKE; the values that follow may be numeric
(hexadecimal assumed) or alphabetic (preceded by a double-quote mark). The two
forms may be int ermixed with leading values and a trailing character string:
POKE address vail val2 ... vain "character string
Note, however, that once text input begins, f u r t h e r hex values are int erpreted as
text characters, so hex input is halted for the scope of the command.
Options:
None.
Comments:
There is no restriction on the memory locations that may be changed by the user.
Use o f this command can be dangerous.
Selected Error Messages:
None.
Examples of Use:
POKE f400 0 1 2
place the values 0, 1, and 2 into memory
starting at 0F400H
POKE f400 "this is a test
place the ASCII values for the indicated
characters into memory starting at 0F400H
POKE f400 1 2 3 "hello, world
intermix hex values and text.
C hap. 3 T O O LSET OF ZCPR3 73
P R IN T (version 2.0)
Syntax:
PRINT dir:afnl,dir:afn2,... o...
Function:
The P R I N T command, like the LIST command, prints a file on the LST: device but
offers many more options. It can prin t a heading, page the file, number the pages,
number the lines, place a da te /ti m e stamp on the output, put the file name on the
output, and pe rf or m yet other functions.
Options:
E Exact Print (Expand Tabs, Form Feed, No Line or Page
Numbers, No Heading)
F Toggle defa ul t of file name display on page header
(default is ON, so F turns o f f name display)
H<delim>text<delim> Define Heading text to appear at the top of each page
I Inspect Files (allow user to select files before printing
begins)
L Enable numbering of each line
M Disable Multiple R u n Flag (if multiple run is ON, then no
"Set Top of Form" message appears for each file and
P R I N T moves fro m one file to another unattended);
defa ul t is with Multiple R un ON
N Disable numbering of each page
On Off set each line. Move each line in the indicated
number of chars from the left of the page
Sn Start printing on page n
T Toggle d a t e/ ti m e stamp in the header of each page
(a TIME subroutine must be assembled into P R I N T
to enable the d a t e/ ti m e stamp feature)
Comments:
The characteristics of the printer are def ined by the ZCPR3 Env ironment
Descriptor. Such characteristics include the number of physical lines on a page,
the num be r of lines of text on a page, the number of characters per line, and
whe ther the print er can fo rm feed or not. The Envi ro nme nt Descriptor contains
options for fou r printers, and the CPSEL utility can be used to select the desired set
of attributes.
The d a t e /t i m e stamp f ea tu re is very machine-dependent, and P R I N T has to be
reassembled to support it.
While P R I N T is running, the following commands work:
AC Abort and retu rn to operating system
AX Skip to top of next page and skip to next file
74 U sing Z C P F 3 a n d C o m m a n d D e fin itio n s Sec. 1
P R O T (RCP-Resident)
Syntax:
PR O T a f n <-- set files to R/ W and DIR
or
PR O T a f n R <—set files to R / O and DIR
or
PR O T a f n S <—set files to R/W and SYS
or
PROT a f n RS <—set files to R / O and SYS
Function:
The PR O T command sets the sta nd ar d C P / M f i l e protection at tributes (i.e., bit 7 of
bytes 1 and 2 of the filetype) for a group of files. The R / O and System attributes
may be set with the R and S options, respectively, given in any order as "RS" or
"SR". Omission of one of these options toggles the opposite (i.e., omission of R
makes the files R/W).
Transient Counterpart:
PR O TE CT
Options:
R Select R / O [Read-Only] (R/W [Read-Write] otherwise)
S Select SYS [System] (DIR [Non-System] otherwise)
Comments:
None.
Selected Error Messages:
None.
Chap. 3 TO O LSET OF ZCPR3 75
Examples of Use:
PROT b7:*.com rs — set all *.COM files in B7:
to R/0 and SYS
PROT text:*.txt — set all *.TXT files in TEXT:
to R/W and DIR
P R O T E C T (version 2.0)
Syntax:
PROTECT dir:afnl,dir:afn2,... keys o...
Function:
The P RO TE CT command replaces the at tri b u te set capabilities of the STAT
transient and adds more flexibility. PR O TE CT allows the user to set/reset not
only the read-only, system, and archive att rib ut e bits (bit 7 of the three filetype
characters), but also the tag bits (bit 7 of each of the eight characters in the
filename) of a file or set of files. PR OT ECT always operates on both system and
non-system files.
Options:
The KEYS are the attributes selected. The following keys are allowed:
R, S, A Enable read /on ly, system, and archive bits
n Set tag bit n(1 <= n <= 8)
I Inspect
C Control
Inspect Mode allows the user to look at each file before it is "protected" and permit
or disallow the fun cti on to be performed on a case-by-case basis.
Control Mode allows the user to see the name of each file selected and manually set
its at tributes and tag bits. In response to the Control Mode prompt, the user can
type in any combination of the letters A, R, S, and the digits 1-8 (the tag bits).
Comments:
None.
Selected Error Messages:
Self-explanatory.
Examples of Use:
PROTECT A4:*.COM,ROOT:*.COM RSI
Set the Attributes of all COM files in directories A4 and RO OT to R e a d / O n l y and
System. T u r n o f f the Archive attr ibu te and all tag bits. Allow the user to inspect
76 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
PW D (version 1.0)
Syntax:
PWD o
Function:
PWD displays the names of all named directories to the user. If the P (Password)
option is included, then the passwords to the directories will be included in the
display (but only if the Wheel byte is set).
Options:
P Display Passwords
Comments:
If the Wheel byte is not implemented for a system, then its address is 0, where the
JMP instruction to the Warm Boot routine in the BIOS is located. Since JMP is n on
zero in value, the Wheel Byte is TRU E, and passwords will be displayed by PWD.
Selected Error Messages:
"Password Request Denied - Not Wheel" means that the P option was given but the
Wheel Byte was not set, so passwords will not be displayed.
"Named Directory B u f f er Not Available" means that named directories are not
implemented.
Examples of Use:
PWD - display named directories
PWD P — display named directories and passwords (Since only
P is valid as an option, the command could have been
"PWD PASSWORD",the last 7 characters being ignored).
C hap. 3 TO O LSET OF ZCPR3 77
Q U IE T (version 1.0)
Syntax:
QUIET o
Function:
QUIET sets, resets, and displays the Quiet flag in the ZCPR3 Environment
Descriptor.
Options:
D Display the Quiet Flag
R Reset (turn OFF) the Quiet Flag
S Set (turn ON) the Quiet Flag
Comments:
Many ZCPR3 utilities read the Quiet flag in the ZCPR3 Envi ro nme nt Descriptor
and respond accordingly. If the Quiet flag is set (ON), then certain inform ative
messages are suppressed in order to cut down on the "noise" created by the
command. If the Quiet flag is reset (OFF), then all messages are displayed.
Selected Error Messages:
No Error Messages are generated. An invalid command results in the Help screen
being displayed.
Examples of Use:
QUIET R -- turn OFF (reset) the Quiet flag
QUIET DISPLAY — Display the Quiet Flag
R EC O R D (version 3.0)
Syntax:
RE CO RD ON or OFF <—Console Recording
or
RE CO RD ON or OFF P R I N T E R < - P rinter Recording
Function:
RE CO RD controls the Disk Ou tput Facility of the Redirectable I /O Drivers.
Copies of Console and P rinter outputs can be created in disk files by the use of this
facility, and it may be extended into a number of other applications as well.
Options:
ON Enable Recording
OFF Disable Recording
P Refere nce Printer
78 U sing Z C P K 3 a n d C o m m a n d D e fin itio n s Sec. 1
Comments:
For RE C O R D to p erf or m its function, it must be implemented in the redirectable
I /O drivers. This is left as an exercise for the reader. The subroutines executed by
the RE C O R D functions are implemented as simple R E T u r n instructions in the
redirectable I / O drivers supplied with ZCPR3.
Four routines are accessed in the Redirectable I / O Driver package to control the
R E C O R D function. They are:
COPEN Enable Recording Console Outpu t
LOPEN Enable Recording List Outpu t
CCLOSE Disable Recording Console Output
LCLOSE Disable Recording List Output
REN (CP-Resident)
REN (RCP-Resident)
Syntax:
RE N d i r : u f n l = u f n 2
Function:
RE N changes the name of a file. The f or ma t is newname=oldname (the standard
C P /M order). The directory prefix on the first unambiguous file name indicates in
which directory the original (and renamed) file resides. RE N cannot rename a
re ad / o n ly file, but can rename a system file. If the new name ( u f n l ) already exists
in the directory, the user is asked whether the file having that name should be
deleted.
Transient Counterpart:
REN AME
Options:
None.
Comments:
None.
Selected Error Messages:
None.
Examples of Use:
REN newfile.txt=oldfile.txt — rename OLDFILE.TXT to
NEWFILE.TXT in current dir
REN root:sys.rcp=sysl.rep — rename SYS1.RCP to SYS.RCP in ROOT
R EN A M E (version 3.0)
Syntax:
RE NA ME dir:afnl=afnol,dir:afn2=afno2,... o...
Function:
RE NA ME changes the names of one or more files. Ambiguous file names and
inspection are permitted.
Options:
C Control Mode; manually specify each file name
I inspect and approve each rename
S Include System files
C hap. 3 T O O LSET OF ZCPR3 81
Comments:
The RE NA ME command is a brother to the RE N resident command. There are
many major differences, however:
■ RENA ME allows ambiguous file names to be used.
■ RENAME supports an Inspect Mode, which presents the user with each name
change and allows him to approve it before the change is made.
■ RENA ME supports a Control Mode, which presents the user with each file to be
REN A ME d and allows him to enter the new name or to cancel the renaming.
■ RE NA ME accepts a list of files.
■ RE N A ME docs not "see" System files unless told to
■ REN AME can rename R e a d / O n l y files
■ RE N A ME sets the attributes ( R /O and SYS) of the new file names to be the same
as those on the old file names
S A K (version 2.0)
Syntax:
SAK o...
Function:
SAK (Strike Any Key) provides some simple utility functions, one of which is
associated with the Multiple Command Line feat ur e of ZCPR3. The functions are:
1. Allow the user to program a wait in a multiple command line until he instructs the
system to continue.
2. Allow the user to abort a multiple command line.
3. Allow the user to program an int erruptible delay in the execution of a multiple
command line.
82 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
Options:
A DO NO T allow the user to abort the command line
B Ring the bell at the user’s terminal occasionally
Pn Pause n seconds a nd continue if no response by tha t time
Comments:
If no options are given, SAK waits for user input, and if the user strikes a AC, then
the multiple command line is aborted and control is re tu rn e d to the user.
SAK is parti cula rly useful if the user wishes to interject a delay in a multiple
command line generated by a Menu. One such application is to display the time to
the user, call his at tention to it (via ECHO), give him a delay (via SAK), and then
invoke dBASE II with an initializing command file.
Selected Error Messages:
Self-explanatory.
Examples o f Use:
S A V E (CP-Resident)
Syntax:
SAVE n u f n <—save n pages (256 bytes) to file
or
SAVE n u f n S <—save n sectors (128 bytes) to file
Function:
The SAVE command saves the contents of the TPA onto disk as a file. It accepts
two arguments: a number and a file name. The file name may optionally be
followed by the letter "S" to indicate that the number is the number of 128-byte
Sectors (Blocks) to be saved. If this option letter is omitted, the nu mber is assumed
to be the number of 256-byte pages to be saved.
If the number, n, is followed by the s u ff ix "H", as in "FH" or "2DH", then n is taken
to be a hexadecimal value. If no s u ff ix is given, n is assumed to be decimal. This
hexadecimal option eliminates the need for conversion fr o m the values supplied by
debuggers such as DDT.
C hap. 3 TO O LSET OF ZCPR3 83
If the indicated file already exists, SAVE will ask the user if he wishes to erase it
with the prompt "Erase ufn?".
Options:
S Select sectors (128 bytes) instead of pages (256 bytes)
Comments:
None.
Selected Error Messages:
None.
Examples of Use:
SAVE 10 MYFILE.BIN — save 10 pages into MYFILE.BIN
SAVE 2FH HISFILE.BIN — save 2F hex pages into HISFILE.BIN
S E T F IL E (version 1.0)
Syntax:
SETFILE n afn
or
SETFILE n
Function:
SETFILE sets the name of ZCPR3 System File n (where n is I to 4) to the indicated
ambiguous file name. If no AFN is given, the curre nt contents of the indicated
System File are displayed. A file number is required.
Options:
None.
Comments:
ZCPR3 System Files are referenced by some of the ZCPR3 utilities, M ENU and
ALIAS in particular. SETFILE is a means by which the contents of these file name
b u f f e r s are defined.
Selected Error Messages:
"Invalid File Name N um ber (not 1-4)" means that a valid file number was not given
a f te r the SETFILE verb (SETFILE n afn).
Examples of Use:
SETFILE 1 myfile.txt — System File 1 is set to MYFILE.TXT
SETFILE 4 — the name of System File 4 is displayed
84 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
SH (version 1.0)
Syntax:
SH
Function:
SH is a Named Variable Shell fo r ZCPR3. It prompts the user for a command line,
performs an int erp ret at ion on the command line, and either executes the command
line itself or passes the line on to the ZCPR3 Command Processor.
Options:
None.
Comments:
See Chapter 6, Shell Subsystem.
S H C T R L (version 1.0)
Syntax:
SHCTRL o
Function:
SHCTRL provides some control of the ZCPR3 Shell Stack fr o m the command line.
The contents of the Shell Stack can be displayed and popped one level or cleared
completely.
Options:
C Clear the Shell Stack (no Shell is in effect)
D Display Shell Stack
P Pop the Shell Stack (the current Shell is stopped
and the next Shell on the stack is invoked)
Comments:
Only one option may be used in conjunction with the SHCTRL command. Any
characters following this option are ignored.
SHCTRL is intend ed for use in situations where a directory change is desired and a
Shell, such as MENU, is in execution. The Shell Stack can be popped, the directory
change performed, and the original Shell explicitly reinvoked.
For additional inform ation, see Chapter 6, Shell Subsystem.
Selected Error Messages:
None —Help is printed if invalid option is given.
Examples of Use:
SHCTRL P - pop the Shell Stack one level
SHCTRL D - display the contents of the Shell Stack
C hap. 3 T O O LSET OF ZCPR3 85
S H D E F IN E (version 1.0)
Syntax:
SHDEFINE u f n <—define variables within file
or
SHDEFINE <—define variables within SH.YAR
Function:
SHDEFINE allows the user to interactively display and edit the assignment of
variables in a Shell Variable file. He may add, delete, and rede fi ne Shell Variables
as well as list all cu rr en t definitions on the CRT or prin t them on the printer.
Options:
None.
Comments:
Use of SHDE FIN E is explained within the program itself. It is menu-driven and
the error and instructional messages are intended to be clear.
The most complex command is the E (for Edit) command. A fte r issuing this
command, the user is prompted for a variable name. If he gives the name of a
variable not yet defined, the user is prompted for a definition, and the variable is
so def ine d unless the user responded with just a R E T U R N at this point. If the
name of the variable has already been defined, the user is asked if he wishes to
delete (D) or redef in e (R) the variable. Appropriate action is taken in response to
the user input.
The user must be a Wheel to run the SHDEFINE command.
Selected Error Messages:
Self-explanatory.
Examples of Use:
SHDEFINE myvars — define variables in MYVARS.VAR
S H F IL E (version 1.0)
Syntax:
SHFILE <—display name of Shell Variable File
or
SHFILE uf n <—set name of Shell Variable File
86 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Function:
SHFILE displays or sets the name of the Shell Variable File to be used by SF1.
SHFILE may be executed while SH is not running, if desired.
Options:
None.
Comments:
SHDE FIN E and SHVAR defin e variables to be placed into Shell Variable Files.
SHFILE defines which Shell Variable File will be used by SH when it executes.
When SH and SHVAR execute, the named variable file they deal with must reside
in the RO O T directory.
Selected Error Messages:
Self-explanatory.
Examples of Use:
SHFILE — display name of Shell Variable File
SHFILE myvars.var — define name of Shell Variable File
SH O W (version 1.0)
Syntax:
SHOW o
Function:
SHOW is the ZCPR3 En vi ro nm ent Display utility. SHOW generates numerous
displays which include: details of the ZCPR3 Envi ro nme nt Descriptor, what
system facilities are available, and the status of these facilities.
SHOW can be invoked as an Error Handler, in which case its Error H and ler display
can give the command line status and its other displays, such as memory examine,
may prove useful to analyze the state of the ZCPR3 System.
Options:
E Install SHOW as an Erro r Han dler (no SHOW displays are invoked)
Comments:
SHOW provides the following displays to the user:
1. Package Data 3 . ZCPR3 System
Flow Command Package - Environment Descriptor
Input/Output Package - Message Buffers
Resident Command Package - CRT and Printer Data
System File Definitions
C hap. 3 TO O L SE T O F ZCPR3 87
2. Environment Data
Error Handler
Memory Display Utility
Named Directory Display
Path Expression
Shell Stack
SHOW is screen-oriented and will not functi on correctly wi tho ut proper Z3TCAP
support. The En vi ro nm en t Descriptor MUST be installed with a valid Z3TCAP entry.
Try it—yo u’ll like it! SHOW is totally screen-oriented and will not f u nc ti o n correctly
without proper Z3TCAP support. If the user enters SHOW with ou t proper support, the
X command exits SHOW.
Selected Error Messages:
Self-explanatory.
Examples of Use:
SHOW E — install SHOW as an Error Handler
S H S E T (version 1.0)
Syntax:
SHSET cmdl;cmd2;...
Function:
SHSET defines the commands which follow it as the command sequence to be
placed on the top of the shell stack. It places this sequence there. Consequently,
once SHSET is executed on a sequence of commands, these commands will be
cycled thru time and time again until the shell stack is cleared or popped.
Options:
None.
Comments:
SHSET provides a simple mechanism through which the user can make any
command sequence into a shell. Consequently, non-ZCPR3 programs, like
MBASIC, DBASE II, WORD STAR, and others can become shells un d er ZCPR3.
When using SHSET, care should be taken to provide an exit f r o m the shell (e.g., an
exit to ZCPR3 and the system); unless this is done the system, once booted, will
remain perma nen tly in the application program. The CMD utility is sometimes
useful for providing such an exit.
88 U sing ZCPR.3 a n d C o m m a n d D e fin itio n s Sec. 1
S H V A R (version 1.0)
Syntax:
SHVAR <—list variables
or
SHVAR var <—delete variable
or
SHVAR var text <-- d e f i n e / r e d e f i n e variable
Function:
SHVAR can list all Shell Variables in the cur rently def ined Shell Variable File, or
can edit this file to delete or change one variable at a time. SHVAR is sometimes
more convenient than SHDEFINE, which is intended for editing groups of
variables in one sitting.
Options:
None.
Comments:
The user must be a Wheel to run SHVAR. SHVAR may be used whe ther SH is
r u nn in g or not. If a Shell Variable File is already def ine d to the ZCPR3 System,
SHVAR uses this file. If one is not defined, SHVAR uses SH.VAR (always located
in the RO OT directory).
Selected Error Messages:
Self-explanatory.
Examples of Use:
SHVAR — l i s t sh ell v ariab les
SHVAR VAR2 — d e l e t e t h e v a r i a b l e VAR2
SHVAR VARX T H I S I S A TEST — d e f i n e VARX t o " T H I S I S A TEST "
S U B (version 3.0)
Chap. 3 TO O LSET OF ZCPR3 89
Syntax:
SUB or SUB / / <—Print Help Message
or
SUB / A Text <-- Abort $$$.SUB File Processing at User ’s Discretion
or
SUB /AB Text <—Same as / A but Ring Bell to Alert User
or
SUB /1 <-- Enter Interactive Input Mode
or
SUB filename params <—As in Standa rd SUBMIT
Function:
SUB builds a command file on disk (named $$$.SUB). Each time ZCPR3 is ready
for a command line, it looks for such a file and, if it finds one, extracts the next
command fro m it.
SUB can be used in any situation where the user would normally use the CP/M
SUBMIT command. XSUB will execute in conjunction with SUB if desired. SUB
can also be used to sound alarms to the user.
Options:
A Permit abort
AB Permit Abort and Ring Bell
I Interactive Input
Comments:
The "SUB /A" and "SUB /AB" forms allow the user to gracefully abort a $$$.SUB
file. As un de r CP/M, entering AC at the console can be used to abort such
processing, but the / A fo rm allows the luxury of starting a command stream and
suspending it at one or more critical points. At each pause, the user can inspect
wh at has happened, and then decide whether to proceed or not.
The "SUB /1" fo rm allows the user to create a .SUB file with ou t having to invoke an
editor. If the user has a command stream he wants to execute immediately and
doesn’t care to do it again, he can use this option. In response, SUB allows him to
enter his command stream (sorry, no parameter passing) a line at a time. When it is
all entered (user enters an empty line), the $$$.SUB file is built and executed.
The "SUB filename params" fo rm is identical to the form of the SUBMIT command
supplied with CP/M. The "filename" specifies the name of the .SUB file to be
executed, and the parameters are associated with the substitution variables $1, $2,
etc. Up to 20 parameters may be specified. The sequence "$$" places a into the
command line, and the character sequence "Ac" places the indicated control
chara cter into the command line (uparrow C places Control-C).
The SUB command may be nested into a $$$.SUB file. If a "SUB filename params"
command is encountered in a $$$.SUB file, SUB runs, realizes that this has
happened, and inserts the indicated command file, with para me ter substitution,
into the r un ni ng command stream at the appropriate place. This may be nested as
many levels deep as desired.
90 U sing ZCir’RS a n d C o m m a n d D efin itio n s Sec. 1
SU B Error Messages:
SUB provides a num ber of in fo rm ativ e diagnostics to the user. In p articu la r, when
an erro r is encountered during processing of a com mand file, the user is inform ed
of the line num ber at w hich the error occurred. The error messages presented by
SUB are:
"Control Character" means th a t the Ac fo rm was not followed by a letter A-Z
"Directory Full" means th a t there is no directory space for the SSS.SUB file
"Disk Full" means th a t there is no room to w rite the SSS.SUB file
"Line too Long" means th a t the cu rre n t line in the com m and stream exceeds 128
bytes
"Memory Full" means th a t there is not enough memory in w hich to build the
com m and stream to be placed into the SSS.SUB file
"Param" means th a t a param eter was referen ced and none was given on the
com m and line.
"Parameter" means th a t an Invalid P aram eter was specified
"SUBMIT File Empty" means th a t the .SUB file specified in the com m and line was
fo u n d to be em pty
"SUBMIT File Not Found" means th a t the .SUB file specified in the com mand line
could not be fo u n d along the ZCPR3 path
"Too M any Param eters" means th a t more than 20 param eters were on the com mand
line
Chap. 3 TO O LSET OF ZCPR3 91
T C C H E C K (version 1.0)
Syntax:
TCCH ECK u f n <—d e fa u lt file type is TCP
or
TCCH ECK < - check Z3TCAP.TCP
Function:
TCCH ECK checks a Z3TCAP.TCP file fo r valid fo rm at and reports any errors and
statistical in fo rm a tio n on it.
Options:
None.
Comments:
TC C H EC K is in ten d ed to ru n in a non-installed environm ent (such as when the
user firs t receives ZCPR3), so the Z3TCAP.TCP file being checked must be in the
c u rren t directory.
Selected E rror Messages:
Self-explanatory.
Examples of Use:
TC C H E C K is used to check the Z3TCAP file fo r consistency. Its sole fu n c tio n is to
ensure the v alid ity of the Z3TCAP file and provide some statistics on it. The
com m ands and responses displayed d u rin g a sample ru n are shown below.
B4:SCR2>tccheck
TCCHECK, Version 1.0 File Z3TCAP .TCP Not Found - Aborting
Note: Z3TCAP.TCP MUST be in the same directory
B4:SCR2>root:
A15:ROOT>tccheck
TCCHECK, Version 1.0
Z3TCAP File Check of Z3TCAP .TCP Version 1.1
File Checks with 44 Terminals Defined
T C M A K E (version 1.0)
Syntax:
TCM A KE u fn <~ d e fa u lt file type is Z3T
Function:
TCM A K E allows the user to interactively d efin e the characteristics of his term inal
and store this in fo rm a tio n in the file referenced. This file may then be loaded by
the LD R utility.
92 U sing Z C F R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Options:
None.
Comments:
None.
Selected Error Messages:
Self-explanatory.
Examples of Use:
TCM A K E is used to create a *.Z3T file. Once created, the ZCPR3 u tility LD R can
load it into memory at the proper location (command is "LDR filename.Z3T"). The
commands and responses displayed during a sample ru n of TCM AKE are shown
below.
B4:SCR2>tcmake //
TCMAKE, Version 1.0
TCMAKE - Create a Z3T File
Syntax:
TCMAKE outfile -or- TCMAKE outfile.typ
B4:SCR2>tcmake myterm2
TCMAKE, Version 1.0
Command? 2
Command? 6
1. Arrow UP? AK
2. Arrow DOWN? AV
3. Arrow RIGHT? AL
4. Arrow LEFT? AH
Command? S
Command? 1
Command? 2
*
96 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
Command? 6
Command? X
TCSELECT
Command:
TCSELECT 1.0
Syntax:
TCSELECT u f n <—d e fa u lt file type is Z3T
or
TCSELECT <—selection stored in Env Desc
Function:
TCSELECT allows the user to interactively review the contents of a Z3TCAP.TCP
file a n d select a te rm in al fro m it. If an unam bigous file nam e is specified in the
com mand line, TCSELECT stores the selection into the in d icate d file. If no file
name is given, TCSELECT stores the selection directly into the TCAP section of
the m emory-based E n v iro n m en t Descriptor.
Options:
None.
Comments:
None.
Selected E rro r Messages:
Self-explanatory.
Examples of Use:
TCSELECT is used to select a term inal fro m the s ta n d a rd Z3TCAP file. The
selected te rm in al may be loaded directly into memory or a *.Z3T file may be
created. If a *.Z3T file is created, the ZCPR3 u tility LD R can load it into memory
at the proper location (command is "LDR filename.Z3T").
Sample ru n of TCSELECT:
B4:SCR2>tcselect //
TCSELECT, Version 1.0
TCSELECT - Select Entry from Z3TCAP.TCP
Syntax:
TCSELECT outfile -or- TCSELECT outfile.typ
Syntax:
TCSELECT
A. VC 404
B. VC 415
C. Visual 200
D. WYSE 50
T Y P E (CP-Resident)
T Y P E (RCP-Resident)
Syntax:
TYPE u f n <—type file and page it
or
TY PE u f n P <—type file but do not page
T ransient C ounterpart:
PAGE
Function:
TY PE displays one or more files on the console. The file is paged (by d efau lt) or
scrolled continuously if the P option is enabled. Flow control (X O N /X O F F or
AS /AQ) is in effect.
Options:
P disable paging
Comments:
The C P-R esident version of TYPE accepts only an unam biguous file name. The
R C P -R esident version accepts an am biguous file name, so several files can be
displayed successively w ith a single command.
Selected E rror Messages:
None.
Examples of Use:
TYPE MYFILE.TXT — print file on console with paging
TYPE MYFILE.TXT P — print file on console without paging
U N E R A S E (version 1.0)
102 U sing Z C F A 3 a n d C o m m a n d D e fin itio n s Sec. 1
Syntax:
U N E R A SE afnl,afn2,... o...
Function:
U N E R A SE recovers files w hich have been previously erased if it is possible to do
so. As a rule, U N E R A SE has a much greater chance of success if it is used
im m ediately a f te r the files were erased. If any th in g is w ritten to the disk a fte r
erasing a file, the directory entry or portions of the erased file may be overw ritten.
Options:
L List Erased Files Only (do not attem pt recovery)
P Pause fo r Disk Change and then try
Z Place Recovered Files in User A rea 0 (d efau lt is cu rre n t user area)
Comments:
When ZCPR3 (and CP/M ) erases a file, the in fo rm a tio n contained in the file and
the directory referen c e to th a t in fo rm atio n is not deleted im m ediately. Instead,
the d irec to ry entry is simply m arked as being deleted. As a result, by changing this
delete m ark back to a user num ber, the file is recovered.
A fte r a file has been deleted, the directory entry and the blocks allocated to the
deleted file all become av ailable to the system for reallocation. Thus, a simple
expansion of an o th er file can overw rite one or more blocks previously allocated to
the deleted file. C reation of a new file or expansion of an existing file that
requires a new extent, may overw rite the directory e n try of the deleted file. In all
these cases, recovery of the deleted file is a complex process quite beyond the scope
of UNERASE.
U N E R A S E is not always successful, however. If, for instance, the follow ing events
took place:
1 the files M Y FILE.TX T, H ISFILE.TX T, and T.TX T were created and then erased
2 a new file T .TX T was created and then erased
3 U N E R A SE T.TX T was issued—it is possible th a t both previous T .TX T files would
be recovered, and a "weird" dual file nam ed T .TX T would be in your directory
U N E R A SE prints the names of the files it is recovering, and, if a name appears two
or more times, then these earlier files of the same name are being recovered. Those
experienced w ith DU3 can probably id e n tify the blocks allocated to the desired
file, reconstruct the proper directory entry, and delete the incorrect directory
entry. O thers will simply have a corrupted directory w hich can only be restored by
erasing T.TX T, thereby losing both files again. Occasional use of the command
C LE A N D IR can keep the directory clear to the point where U N E R A S E will
fu n c tio n correctly most, if not all, of the time.
Selected E rror Messages:
Self-explanatory.
C hap. 3 T O O LSET OF ZCPR3 103
Examples of Use:
UNERASE myfile.txt,hisfile.txt
— try to recover MYFILE.TXT and HISFILE.TXT
UNERASE myfile.txt Z
— try to recover MYFILE.TXT and place it in User 0
UNERASE myfile.txt L
see if MYFILE.TXT can be recovered (duplicates
may also appear in this way)
V F IL E R (version 1.0)
Syntax:
V F IL E R <—install V F IL E R as a shell
Function:
V F IL E R is a general-purpose, screen-oriented file m an ip u latio n utility. It allows
the user to display, print, copy, renam e, delete, and compute the size of files which
are listed on the screen. The user can move his pointer about the list, using the
WordStar cursor convention or, if the ZCPR3 TCAP fo r the user’s term inal
supports it, his own arrow keys may work.
Options:
None.
Comments:
For a detailed description, see Chapter 7.
Selected E rror Messages:
Self-explanatory.
Examples of Use:
See C hapter 7.
V M EN U (version 1.0)
Syntax:
V M EN U <-- ru n MENU.VMN on all files in dir
or
V M EN U a fn <—ru n MENU.VMN on files selected by a fn
or
V M ENU a f n u f n <—ru n menu (ufn) on selected files
104 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Function:
VM ENU is the ZCPR3 menu fro n t-en d processor. It is a ZCPR3 Shell w hich reads
a *.VMN file and processes commands fro m it.
Options:
None.
Comments:
For a detailed description, re fe r to C hapter 5, Menu Subsystem.
Selected E rror Messages:
See C hapter 5.
Examples of Use:
See C hapter 5.
W H E E L (version 3.0)
Syntax:
WHEEL password S
or
WHEEL password <—Set Wheel Byte
or
WHEEL password R <—Reset Wheel Byte
or
WHEEL /S or / R <—E n ter Password w ith o u t echo
Function:
The WHEEL com m and enables or disables certain privileged com mands and
com m and features. It does this by setting or resetting the Wheel Byte.
Options:
R Reset Wheel Byte
S Set Wheel Byte
Comments:
The Wheel Password is hard-coded into the WHEEL.COM file. It may be changed
by D D T or reassembly.
WHEEL has an RCP c o u n terp art, WHL, w hich may also be in effect. WHEEL and
WHL can respond to d if f e r e n t passwords.
Selected E rror Messages:
"Invalid Password" means th a t the given password was not correct.
Examples of Use:
WHEEL mypass — set Wheel Byte if MYPASS is the
correct password
Chap. 3 TO O LSET OF ZCPR3 105
W HL (RCP-Resident)
Syntax:
WHL <—make user non-privileged
or
WHL password <—make user privileged
or
WHLQ <-- determ ine status
Transient Counterpart:
WHEEL
Function:
The WHL com m and is used to tu rn the Wheel Byte o f f (make the user non-
privileged) or on (make the user privileged). The Wheel password is built into the
RCP.
To f in d out the c u rre n t status of the Wheel byte, use the WHLQ command
(described below).
Options:
None.
Comments:
None.
Selected Error Messages:
Self-explanatory.
Examples of Use:
WHL — make user non-privileged
WHL mypass — make user privileged if password is MYPASS
WHLQ — determine status of user (privileged or not)
X D (version 1.2)
Syntax:
X D d ir:afn ooo...
or
X D /ooo...
106 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Function:
XD displays a fo rm atted , alphabetized listing of the contents of a disk directory.
Options:
Aa Indicate attrib u tes of files to be selected.
a=A fo r All Files (System and Non-System)
a=N for Non-System Files [default]
a=S for System Files
Oo Select O u tp u t F eatures
o=A to Disable D isplay of File A ttributes (R, S)
o=F to Form Feed P rin te r when Display Done
o=G to G roup Files by Name and Type
o=H to Display Files in H orizontal F orm at
P Send D isplay to P rin te r
PF Send D isplay to P rin te r w ith T railing Form Feed
Comments:
It has been fo u n d th a t the more exotic featu res of X D IR (p a rticu la rly the file
scanner and disk ou tp u t facility) are not used often in some environm ents. Because
these featu res increase the size of XDIR.COM and reduce its execution speed,
another version of XDIR.COM, called XD.COM, has been created.
XD is completely com patible w ith X D IR in terms of the options it accepts and how
it operates. However, the file scanner and disk ou tp u t facilities have been
removed from XD. Hence, the D, F, and I options are not available. All other
options of X D IR are reta in ed in XD and p erfo rm in the same way. As a result, XD
is smaller than X D IR (4K vs 8K), and th e re fo re has a larger memory b u f f e r in
w hich to load files. In very large hard-disk systems, X D IR may not have enough
b u f f e r space to p e rfo rm its functions, but XD almost certainly will.
The d efau lts of XD can be changed in the same fashion as those of X D IR; for
details, see the "Comments" section of the X D IR command.
Selected E rror Messages:
"TPA Error" means th a t there was not enough room in memory to load the disk
directory.
Examples of Use:
XD — Display the non-system files in the current
directory in the following fashion:
1. sorted by file type and name
2 . vertical format
3 . R/0 and SYS attributes included
XD * .COM AAOA — display both non-system and system files
which match *.COM in the following fashion:
1. sorted by file type and name
2 . vertical format
C hap. 3 TO O L SE T OF ZCPR3
3. no attributes included
XD ROOT:*.COM AAOA — same as above, but display only
files in directory named ROOT
X D IR (version 2.0)
Syntax:
X D IR d ir:afn ooo...
or
X D IR /ooo...
Function:
X D IR displays a disk d irectory to the user and acts as a file name scanner.
Options:
Aa Indicate attrib u tes of files to be selected
a=A fo r All Files (System and Non-System)
a=N fo r Non-System Files [default]
a=S fo r System Files
D Send O u tp u t to Disk File X D IR .D IR
Ff E nable a File Scanner F unction
f=L to Log File Names to FNAMES.DIR
f=P to P rin t File Names Stored in FNAMES.DIR
f=S to Scan Disk and Compare to FNAMES.DIR
I Inspect Logged Files (use w ith FL option only)
N Negate Selection of Files
00 Select O u tp u t Features
o=A to Disable D isplay of File A ttributes (R, S)
o=F to Form Feed P rin te r when D isplay Done
o=G to G roup Files by Name and Type
o=H to D isplay Files in H orizontal F orm at
P Send D isplay to P rin te r
PF Send D isplay to P rin te r w ith T railing Form Feed
U Select All User Areas
Comments:
X D IR is approxim ately 8K in size. The principal reasons to use X D IR
p reference to the other directory display utilities are:
1 X D IR is able to send its output to disk.
2 X D IR provides the File Scanner Function.
3 X D IR can display all user areas of a disk.
108 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
If the d e f a u lt a ttrib u te s of X D IR are not to the user’s liking (e.g., if a listing by file
name and type is p referred ), there are three alternatives:
1 X D IR can be reassembled
2 The a ttrib u te s can be patched via DDT (they start at the 6th byte fro m the
f r o n t of the program)
3 An ALIAS can be created w hich selects the desired a ttrib u te s for the user
XDIR Summary
X D IR runs in two basic modes:
a d irec to ry display u tility
as a file scanner u tility
As a directory display u tility , X D IR displays in fo rm a tio n about the files on a
p a rtic u la r disk in all user areas or a p a rtic u la r user area. It provides the following
inform ation:
Name of File
- Sizeof File (in Kb)
A ttrib u tes of File (R ead /O n ly or System)
Sum of Sizes of All Files Displayed
T otal N um ber of Files on Disk
A m ount of Space R em aining on Disk
C hap. 3 TO O LSET OF ZCPR3 109
are grouped and AA.T X T comes before BB.COM. If the display is by file type and
name, then files of the same type are grouped and BB.COM comes before AA.TXT.
OH allows the user to switch from vertical to horizontal fo rm a t and vice versa.
The display is divided into three columns; vertical fo rm a t lists files first down
column 1, then dow n column 2, and fin ally down column 3. H orizontal fo rm a t lists
the files sequentially across columns 1, 2, and 3 in row A, then columns 1, 2, and 3
in row B, and so on.
X D IR provides such a wide variety of output displays th a t the user is advised to
experim ent w ith the various X D IR options to see w hich fo rm a t he prefers. The
d e fa u lt settings for the various options can be changed to generate the p referred
fo rm a t by intelligent use of DDT or by reassembly of the XDIR.M AC source.
XDIR File Selection
The follow ing options (and the DIR: field) control file selection:
Aa Select attrib u tes of the files to be displayed
a=S fo r system files
a=N for directory (non-system) files
a=A fo r all files (both system and directory))
N N egate selection; select those files w hich do NOT m atch the am biguous
file name
U Select all user areas
The A option selects the attrib u tes of the files to be displayed. AA displays both
non-system and system files; AS displays only system files; and AN displays only
non-system files.
The N option selects all files w hich do not m atch the am biguous file name. The
scope of the N option is w ith in the attrib u tes selected, so if the a ttrib u te s are AS,
only system files are shown.
The U option selects all user areas on the specified or d e fa u lt drive. On the
display, each file nam e is preceded by the user area in w hich it resides.
XDIR File Name Scanner
The options of X D IR w hich deal w ith the file name b u f f e r fa c ility are:
F f Engage file nam e b u f f e r facility
f=L to log file names to disk
f=P to p rin t names logged to disk
f=S to scan disk for file names and compare to log
I Inspect files selected by FL option
The FL option w rites the user num bers and file names of the selected files into the
disk file nam ed FNAMES.DIR. If FNAMES.DIR alre ad y exists, then it is
rew ritten. The FNAM ES.DIR files is used by the FP and FS options. Note th a t the
a ttrib u te selection options may also play a p art in selecting the files to be logged.
The FP option prints out the user numbers and names of all the files stored in
FNAMES.DIR. If FNAMES.DIR is not in the cu rre n t directory, FP will search
C hap. 3 TO O LSET OF ZCPR3 111
along the ZCPR3 p ath u n til it fin d s it or reaches the end of the path.
The FS option scans FNAMES.DIR and the files selected by the user (or implied if
no specific file selection option is given) and compares them. If a file exists in
FNAMES.DIR but not in the selected files, its name is p rin ted as a missing file. If a
file exists on disk but not in the FNAMES.DIR file, then its name is printed as an
ad d itio n al file.
Note th a t the user should keep in m ind w hat he is scanning for when he uses the
file name b u f f e r facility. For instance, if he selects both non-system and system
files w ith the FL option and then defaults to Non-System w ith the FS option, it is
likely th a t several files will be shown missing even though this may not be true.
The I option (for inspect) allows the user to m anually approve each file before its
name is placed into FNAMES.DIR.
X IF (version 1.0)
Syntax:
X IF an y tex t
Function:
If the c u rre n t Flow State is T R U E , X IF exits all pending IFs. It reduces the IF
Level to 0 (no IF in effect).
If the c u rre n t Flow State is FALSE, X IF does nothing.
Options:
None.
Comments:
None.
Selected E rror Messages:
None.
Examples of Use:
; =LOOP
X IF
<statements>
IF 1 3
GOTO LOOP
FI
112 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
Comments:
If the Z option is given (Z should only be given if ru n n in g Z3LOC un d er ZCPR3),
the follow ing ad d itio n al address in fo rm a tio n is provided:
o E x tern al P ath o R esident Com m and Package
o I n p u t/O u tp u t Package o Flow Com m and Package
o N am ed D irectory B u ffe r o Comm and Line B u ffe r
o Shell Stack o E nvironm ent D escriptor
o E x tern al FCB o ZCPR3 Message B u ffe r
o E x tern al Stack o Wheel Byte
Z E X (version 3.0)
Syntax:
ZEX / / <~ P rin t Help
or
ZEX <—E nter In teractiv e Mode
or
114 U sing Z C I R 3 a n d C o m m a n d D e fin itio n s Sec. 1
ZEX myemds pi p2
processing of the file 'myemds.ZEX', or, if not
found, 'myemds.SUB' is performed; 'pi' is
substituted for $1 and 'p2' for $2
C hap. 3 TO O L SE T OF ZCPR3 115
The follow ing com mands simply insert characters into the Z E X com m and stream
and will not be discussed in any greater detail.
1 inserts a <CR> Al inserts a <CR> <LF> pair
$$ inserts a single $ $A inserts a single A
$1 inserts a single | Ac inserts a control ch aracter
The A* com m and causes ZEX to ring the bell. It does not insert a BELL character
into the com m and file, as a AG sequence would. It simply rings the bell and
continues processing.
The ;; com m and introduces a Z E X comment. It and all characters following it up
to and including the follow ing <LF> are simply trea ted as a comment in the ZEX
Com m and File and ignored. U nlike a conventional ZCPR3 comment, the ZEX
comment does not take up space in the com mand stream and does not appear when
the com m and stream is executed.
The A< and A> com mands are used to bracket characters w hich are simply echoed
by the ZEX m onitor and not passed back to the calling program. This causes the
characters between these commands to be echoed to the user d u rin g execution but
not processed by any program. This fe a tu re is very useful fo r em bedding
comments to be p rin ted at execution time into the com mand stream. U nlike the
ZCPR3 com ment form , w hich is a line beginning w ith a semicolon, comments
enclosed by A< and A> may appear anyw here, such as w ith in an editor session.
The A# com m and toggles suppression of in fo rm ativ e messages generated by ZEX.
The A. com m and causes console output to cease u n til the next A. is encountered.
C h arac ter in p u t fro m the Z E X M onitor continues, but the user does not see it on
the screen.
The A: com m and causes the ZEX m onitor to restart execution of the loaded
com m and stream. The entire com mand stream, as in itia lly processed by ZEX, is
executed again fro m the beginning.
116 U sing Z C F R 3 a n d C o m m a n d D efin itio n s Sec. 1
$n, where l<=n<=9, will cause the corresponding specified or d e fa u lt param eter to
be substituted fro m the com mand line.
The A$ com m and defines or redefines the set of in p u t com m and param eters. The
rest of the line follow ing the A$ is treated as a set of param eters separated by
blanks.
The A? and A/ commands replace the /A and /A B options of SUB. A? causes ZEX
to stop processing and w ait for the user to strike either the space bar or the
R E T U R N key before continuing. The user can exam ine the display at leisure and,
if he does not wish to continue, a AC will abort the com m and stream. The A/
com m and is like A?, but it periodically rings the bell at the console, sum moning the
user at critical points in the processing.
F inally, the A" com m and causes ZE X to stop providing in p u t fro m the com mand
stream; the user can then enter w hatever he wishes u n til a special ch ara cter is
output, at w hich time Z E X will resume providing input. In this case, Z E X can be
intim ately linked w ith ZCPR3, and it is in ten d ed th a t the special c h ara cter that
ZEX is w aiting fo r be associated w ith the ZCPR3 prompt. In my system, I defined
the ZCPR3 prom pt as a ">" ch ara cter w ith the most s ig n ifican t bit set. This is
unique and appears only when the prom pt comes up on my system.
ZEX Examples:
The follow ing examples illustrate applications employing ZEX. Comments appear
out to the side, p re fix e d by <—.
Bl>zex
ZEX, Version 1.3
1: A$ this is fun <— Define 3 params
2 : echo $1 $2 $3
3 : A$ hello from happy acres <— Define 4 params
4 : echo $1 $2 $3 $4
k •
THIS IS FUN
Bl>echo hello from happy acres
NEW FILE
C hap. 3 TO O LSET OF ZCPR3 117
*i
1 ed demo. txt <— Edit DEMO.TXT
2 i <— Insert text while in ED
3 This is a test
4 This is only a test
5 This is a demo of ZEX Control
6 AZ <— AZ is 2 chars, xlated into
7 bOlt <— Ctrl-Z by ZEX
8 11
9 Olt
10 i <— Input More Text
11 A II
<— Allow user to input text
12 type demo.txt <— When ZEX continues, this
13 era demc .txt <— is what it does next
14
*e
NEW FILE
*i <— ZEX is typing this in
1 This is a test
2 This is only a test
3 This is a demo of ZEX Control
4
*b01t
1 This is a test
1 *11
2 *01t
2 This is only a test
2 *i <— Now user input begins
2 I am now typing this line of my own volition <- User
3 ZEX will allow me to continue doing this until
4 it sees the ZCPR3 prompt
5 <— User types Ctrl-Z
5 *e <— User types "e"
118 U sing ZCF R.3 a n d C o m m a n d D efin itio n s Sec. 1
(ZEX Active)
Bl>era demo.txt
DEMO .TXT
Bl>
(ZEX Completed)
By Your Command >
; Assembly Complete
No Fatal error(s)
(ZEX Active)
Bl>; Please Type AC if Error(s) Exist - <— User can abort now
<— if he wishes
B1>ERA DEMO.BAK
DEMO .BAK
B1>ERA DEMO.COM
No File
B1>L80 /P:100,DEMO,A:SySLIB/S,DEMO/N,/U,/E
(ZEX Active)
B1>ERA DEMO.REL
DEMO .REL
Bl>; Assembly Complete
Bl>
(ZEX Completed)
By Your Command>demo <— Run pgm now
120 U sing Z C P K 3 a n d C o m m a n d D e fin itio n s Sec. 1
1. Under ZCPR3, HELP w ill f o llo w the command-search path, searching the current
directory (disk and user) first.
2. If the HLP f ile is not fou n d in the current directory, HELP w ill search along the
ZCPR3 path for it.
3. If the HLP f ile is not fou n d along the ZCPR3 path, then HELP w ill look in the
directory named "HELP" for the indicated file. This is a major d iffe r e n c e
between HELP and other ZCPR3 utilities.
4. If the HLP f ile is not found, HELP w ill print an error message.
Moving Around within the HELP Command
Once the user is running HELP, he is given a set o f commands by w h ich he can
display the particular items o f inform ation he is interested in.
A fter issuing the HELP command, the user w ill come up in one o f two modes
(depending on the type o f HELP f ile referenced). In indexed mode, a menu o f topics is
displayed to the user and he can select the desired topic by typing the character in
front o f the topic title. In non-indexed mode, no menu is displayed; instead, the entire
f ile is v iew ed as one "information section."
An i n f o r m a t i o n s e c t i o n is a collection o f screen displays (one screen fu ll o f text)
called f r a m e s . T yp ically, an inform ation section should contain a logical grouping o f
related data on a particular topic. In indexed mode, each menu topic refers to an
inform ation section. By selecting a topic, the user is placed into the corresponding
inform ation section. In non-indexed mode, the entire HELP f ile is one inform ation
section.
Moving From the Menu
At the menu o f a HELP file , the user has two basic choices: to select a menu topic
for review , or to exit to ZCPR3. If a menu topic is selected, the user is placed into the
corresponding inform ation section.
A third choice is sometimes available at the menu level: to move up to the
previous HELP Level. Some inform ation sections are entire HELP file s in their own
right, w h ich can be accessed independently o f the HELP f ile the user is currently in.
If the user enters one o f these inform ation sections, the name o f the current HELP file
is saved and the new HELP f ile is loaded. When this happens, the user is placed at the
next HELP level.
HELP levels start at 0 and increase each time the user calls a new HELP f ile from
his current level. Thus, he starts at level 0, and the first HELP f ile he calls puts him at
level 1. If he now calls another HELP file , this puts him at level 2. From level 2 he
may have the option o f exiting, either to ZCPR3 (which w ould return him to help level
0) or to the previous level (1).
The HELP file s are organized in a tree data structure. To get to a particular
HELP file , the user starts at the root o f the tree and then climbs up and down the trunk
and branches to various levels, or nodes. From each node, the user may only move up
or down the tree—he can ’t cross over to a node at the same level w ithout first moving
down the tree and then back up. To illustrate, consider the follow ing:
C hap. 4 O n -L in e H E L P S u b sy stem 123
In the above example, the user must alw ays start at the root o f the tree (Node J).
This is analogous to HELP Level 0, w hich is where the user is placed when he issues the
HELP Command. To get to N od e C, for example, the user has to clim b the tree from
Node J to N od e H to Node F to Node D to N od e C. This w ould be like the user entering
four node-type inform ation sections, in w h ich d iffe r e n t HELP file s are successively
loaded.
N ow that the user is at N ode C, let’s say that he wants to go to N od e E. U nder the
HELP System, there are two w ays to do this:
1. Jump to the ground and then clim b back up to N od e E. Here, the user would jump
from N od e C to N od e J and then go to N od e H to N od e F to N od e E. U nder HELP,
the user can do this by e x itin g to ZCPR3 and then reissuing the HELP Command
or by issuing the Root Command (.); once at the root o f the tree, he then climbs it
again by entering the appropriate inform ation sections.
2. Climb dow n the tree and then back up. The user w ould m ove from Node C to
Node D to N od e F and then back up to N ode E. The HELP user can go to the
previous level by issuing the Up Level (A) command. In this exam ple, he would
issue the U p Level comm and tw ice and then go back down.
Moving Within an Information Section
Once the user is w ith in a textual inform ation section, he has several capabilities
for m oving w ith in this section or to another in form ation section.
First, to leave an inform ation section, the user can return to the menu (if the
current HELP f il e is indexed) or return to ZCPR3. A d d ition ally, i f the user is not on
the root (HELP Level 0), he can return to the previous HELP Level (Up Level). If the
user is not in an Indexed HELP file , m oving forw ard beyond the End o f Inform ation
(EOI) w ill return him to ZCPR3 i f he is at HELP Level 0, or to the previous HELP
Level i f not.
The data w ith in an inform ation section is arranged sequentially. Consequently,
the user can m ove forw ard to the next fram e, or backward to the previous fram e or to
the beginning o f the inform ation section. The user cannot move backward beyond the
124 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
beginning o f the inform ation section; i f he tries to do so, a bell is sounded. Also, i f the
user tries to m ove forw ard beyond the End o f Inform ation (EOI), he is returned to the
menu, returned to ZCPR3, or returned to the previous HELP Level as described above.
HELP Status and Command Prompts
Whenever the HELP system is in use and an inform ation section is being
displayed, the bottom line o f the screen displays some status inform ation and the
prompts for HELP commands available to the user.
The status indicators appear at the extreme le ft o f the bottom line; they are
fo llow ed by the command prompts. The status indicators may take the fo llo w in g
forms:
<Nothing>.... command prompts....
\__The user is at the menu of Level 0
For instance, a HLP f ile w h ich refers to a new program may include an
inform ation section or one fram e w h ich contains a command summary. The user can
simply print this w ith ou t having to print the entire HLP file.
As another example, the HELP subsystem may be used by a homemaker to store
her recipes. If these are organized, using the tree structure, into reasonable categories
(such as roasts, desserts, etc), w h ile r eview in g the recipes she may f in d one she wishes
to try for the ev e n in g ’s meal or to pass on to a friend. I f the recipe covers only one
screen, a Frame Print is very convenient.
HELP Error Messages
The fo llo w in g are the error messages issued by HELP, and their meanings:
File not Found The sp ecified HELP File cannot be found.
AFN Not Allowed The sp ecified HELP File is ambiguous (contains the character
or "?"). This is not allowed.
<BELL> The user issued an in valid command.
EOF on HELP File In searching for an inform ation section, HELP ran into the
end o f the HELP File. The Indexed HELP f ile is improperly structured (more index
entries than inform ation sections).
Node Level Limit The lim it o f the nesting o f the HELP Levels is exceeded. HELP
lim its the number o f HELP Levels that can be traversed to 10 (d efault, w h ich can be
changed), and an attempt was made to enter HELP Level 11 (or d e fa u lt + 1).
Mem Full The selected HELP File is too large to load into the available memory in
the user’s computer system. The HELP File should be reduced in size; using HELP
Levels (N ode references) in the inform ation sections is a good way to do this.
How to Write HELP Files
Files used by the HELP program are either simple C P/M -standard file s o f ASCII
text or ASCII file s generated by the WordStar text ed itor/form atter. These files are of
two basic types: ind exed or non-indexed; both types have the same basic format.
Grouping o f Inform ation. Inform ation displayed to the user is grouped by the
index in indexed HELP file s and may also be grouped by lines beginning w ith fo rm
feed (AL) characters. Grouping is an e f f e c t iv e way to organize inform ation logically
so that m eaning w ill be more clear to the user and units o f inform ation w ill not
overrun screen display boundaries.
The inform ation displayed to the user is organized into logical units called
information sections, and screen-sized displays called frames. U sin g a text editor, the
user can create his own HELP files and organize his inform ation as he desires for
display by the HELP subsystem.
N on-Indexed HELP Files. N on -indexed HELP file s are id e n tifie d by having a
colon (:) as the first character of the first line in the file. The f ile consists o f ASCII
text lines, each line being term inated by a carriage return (ODH) fo llo w e d by a line
feed (OAH). The inform ation section in such a help f ile consists o f the text fo llo w in g
the leading colon; this text may be term inated either by a new line that starts w ith a
colon (thus beginning a new inform ation section), or by the e n d -o f-file marker
(control-Z, 1AH).
Indexed HELP Files. Indexed HELP file s are simple ASCII file s w h ich do not
start w ith a colon (:) as the first character o f the file. An indexed HELP f ile may be
H ELP-indexed or user-indexed.
Chap. 4 O n -L in e H E L P S u b sy stem 127
[ Menu lines]
:x
[ Information Displayed for Selection X ]
:a
[ Information Displayed for Selection A ]
:1 b
[ Information Displayed for Selections 1 or B ]
:f tHELPFILE [ HELPFILE.HLP is invoked by Selection F ]
: z
[ Information Displayed for Selection Z ]
EOF marker
Accessing Video Attributes
The displays generated by HELP are screen-oriented. U n der ZCPR3 w ith a
properly installed TCAP entry in the Environm ent Descriptor, HELP is able to
highlight inform ation on the screen and create "flashy" displays by using the clear
screen command appropriate to the user’s terminal. U se o f this feature is automatic;
each fram e is preceded by a clear screen.
The writer o f a HELP f ile can turn text h ighlighting on and o f f anyw here in the
HELP f ile by em bedding the fo llo w in g commands into the text:
AA (binary 1) — turn highlighting ON
AB (binary 2) — turn highlighting OFF
C hap. 4 O n -L in e H E L P S u b sy stem 129
DEMO.HLP
D E M 02.H L P
D E M 03.H L P
5 Menu Subsystem
Overview
The menu subsystem provides two menu-oriented command preprocessors, M ENU
and V M ENU. Each o f these draws its menu data from an associated f ile designated
*.MNU (for M E N U ) or *.VMN (for VM ENU). For those users who wish to construct
their own menus, two diagnostic tools are available to check the syntax o f a new data
file: M E N U C K validates *.M NU files, and V M E N U C K validates *.VMN files.
The d iffe r e n c e between the two preprocessors is that M E N U is basically line-
oriented, and can be used whether or not TCAP data is included in the environment
descriptor, whereas V M E N U is screen-oriented, relies h eavily on screen characteristics
d e fin e d in TCAP, and can generate more elaborate and "flashy" displays. Generally
speaking, anything that can be done w ith M E N U can also be done w ith V M E N U , but
the reverse is not true.
G iven the sim ilarities between the two preprocessors, this chapter describes the
menu subsystem in terms of the capabilities of V M E N U , pointing out the d ifferen ces
between M E N U and V M E N U where these are sign ifican t. Thus, all references to
V M E N U also apply to M E N U except where otherw ise stated. When discussing areas
that are identical for both programs, we shall refer to "(V)MENU" as a shorthand
notation for "VMENU a n d /or MENU" (or some sim ilarly cumbersome inclusive
expression). V M E N U works w ith menu file s of type *.VMN; M E N U works w ith files
o f type *.MNU. This chapter w ill refer to all menu file s w ith the VM N f ile type, and
the reader should be aware that i f he is dealing w ith M EN U, the f ile type is MNU.
Preprocessor Operation
(V )M E N U is a ZCPR3 M enu-Oriented Command Preprocessor. It acts as a front-
end to ZCPR3, providing a m enu-oriented user in terface to ZCPR3. Its fu n ction can
be represented by the fo llo w in g diagram:
IV | |Z | |B | |P
User | M | | C | | D | | g
Menu --- >| E |-- >| P |--->| O |--->| m
Command | N | | R | | S | | s
I U| | 3| | | |
The "User Menu Command" is a single character that the user strikes which
instructs (V )M E N U to perform a function. Once (V )M E N U begins processing this
fu n c tio n , it builds a command line for ZCPR3, option ally asking the user for further
input (such as a f ile name), and then passes the command line to ZCPR3 via the
Command Line B u ffer. ZCPR3 then runs the command line and returns to (V)MENU.
(V )M E N U builds command lines based on simple input from the user. The user
need never know what the actual command line is. The command line its e lf is always
o f the form:
<command> coptional user input>
134 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Command (<CR>=Menu) -
Strike AR at this time to refresh the Menu D isplay or strike the character o f a
Menu Option. These are the only choices, and striking a character w h ich is not the
R E T U R N key or a menu option causes the bell to sound.
If the the option to exit to ZCPR3 is available and there is only one Menu in the
M E N U .V M N f ile , then the command line w ill look like this:
Command (<CR>=Menu,AC=Z3) -
The option o f aborting to ZCPR3 by striking Control-C (hold dow n on the
Control, or CTRL, key and strike the letter C) is now available. This w ill exit V M E N U
and return to ZCPR3.
On a brief note on option letters before going on. If one o f your options is a letter
in the range A-Z, then case is not sign ifican t, and you can invoke the option A, for
example, by striking either an upper- or a lower-case A.
If there is more than one menu in the *.VMN f ile , the comm and line options
become slightly more complex, but they are still quite easy to follow .
In the fo llo w in g examples, assume that the option to exit to ZCPR3 is o f f , so the
"AC=Z3" option w ill NO T appear.
From the first menu in the file , the command line w ill look like the follow ing:
Command (<CR>=Menu,>=Next Menu) -
To advance to the next menu, strike the ">" or the character. On most
keyboards, ">" is the s h ift o f the so V M E N U permits easy m ovem ent w ithout having
to worry about s h iftin g the keyboard all the time.
If the last menu in the f ile is on the screen, the comm and line w ill look like the
following:
Command (<CR>=Menu,*=lst Menu,<=Prev Menu) -
This allow s the user to strike the character to jump back to the first menu in
his *.VMN file. If "<" or is struck ("<" is usually the s h ift o f the ","), then the user
w ill back up one menu to the previous menu in the file.
If the user is som ewhere in the middle o f the M E N U .V M N file , his comm and line
w ill look like this:
##
Options. Y M E N U has only one option character—"X"—w h ich tells Y M E N U to allow
the user to exit to ZCPR3. In using it, case is not sign ifican t. The X option enables the
f a c ility w h ich permits the user to type AC and return to ZCPR3.
M E N U has three additional options, not available to VMENU:
C D isplay command line to user
D D isplay menu to user
P Page Out menu display
The C option displays the command line built by M E N U to the user. This option is
primarily intended for debugging purposes; however, it can also be instructive to the user.
The D option displays the menu to the user; i f the display fu n c tio n is not turned on, we are
in the Expert mode and the commands are available w ithout a menu display. The display
can be turned on at any time by striking Return. The P option clears the screen by issuing
24 successive <CR-LF> sequences to scroll the menu up o f f the screen. It is u sefu l for
keeping only the current commands and options on the screen, but annoying to a user
accessing the system via a 300-baud modem; the menu programmer therefore is given a
means o f turning o f f this scrolling.
When (V )M E N U first comes up, all options are turned o f f. The user cannot exit to
ZCPR3. The global options line w hich, i f present, is the first line o f the file , turns on the
specified options for the course o f the session in general. That is, i f a global options line
like
-DPx
is used (case is in sig n ific a n t), then menu display, paging, and exit to ZCPR3 are enabled
for all menus. H owever, i f some o f the menus in the f ile ought to deny e xit to ZCPR3,
then the -x option may be temporarily turned o f f for those menus. This is done by
presenting the X option on the first line o f each such menu im m ediately after the "#"
character. If the X option is N O T included in the global options line, it is turned OFF for
all menus in general. The d e fa u lt selected by using the global options line is overridden on
a per-menu basis by the local menu options.
Example:
-x
#x
No exit to ZCPR3 is permitted
#
commands
#x
No exit to ZCPR3
#
commands
#
The user may exit to ZCPR3.
C hap. 5 M e n u S u b sy ste m 139
#
commands
##
*.MNU and *.VMN Commands
This section describes the technique and options available for creating command
lines in menu files. The inform ation herein is organized into the fo llo w in g subject areas:
o Syntax o f the command line
o :nn Option
o ! Option
o "text" prompts and input
o Variables ($D, $U , SFn, $Nn, $Tn, $Pp, $$)
o H igh ligh tin g (AA, AB)
Command Structure
The commands in a menu f ile f o llo w a simple structure. Each comm and occupies only
one line, and blank lines in the command group are not permitted. The command line is
structured as follows:
1 [o][command]
where:
1 is the single character used to invoke the command;
note that it may be upper- or lower-case,
o is an opening option, w hich is one of:
:nn — go to Menu nn
! — have (V )M E N U w ait when the command is fin ish ed
command is an optional ZCPR3 command; note that i f the option is ":nn",
then a comm and here makes no sense.
:nn Option
The ":nn" option tells (V )M E N U to move to a d iffe r e n t menu in the *.VMN file. The
first menu is number 1. Example:
-x
#
1st Menu: A - Goto Menu 2 3 - Goto Menu 3
#
a: 2
3 :3
#
2nd Menu Command: 3 Goto Menu 3
#
3 :3
#x
3rd Menu Command: 2 Goto Menu 2
140 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
#
2:2
##
In the first menu, the user may strike:
"a" or "A" to goto Menu 2
"3" to goto Menu 3
">" or to goto the next menu (Menu 2)
AC to goto ZCPR3
In the second menu, the user may strike:
"3" to goto Menu 3
or "<" or to goto Menu 1
«>" Qr <<i. tQ goto M enu 3
AC to goto ZCPR3
In the third menu, the user may strike:
"2" or ”<" or to goto Menu 2
to goto Menu 1
! Option
The "!" option causes (V )M E N U to pause after the command line has been processed
and ask the user to "Strike A n y Key" before continuing. In this w ay, i f a command
generates in form ation to be read by the user before (V )M E N U clears his screen, the "!"
option may be used to give the user all the time he wants to read this display.
" Pr ompt
Embedded w ith in any command line may be a prompt for user input. This prompt
takes the form of
"prompt to user"
When encountered, (V )M E N U w ill advance to the next line and print the text
contained w ith in the quotes. (V )M E N U w ill then w ait for the user to enter any text he
desires fo llo w e d by a R E T U R N . At this point, the text entered by the user is capitalized
and placed into the command line at the point o f the prompt.
If the prompt appears at the end o f a (V )M E N U comm and line, the trailing quote is
not required. As m any prompts as desired may appear w ith in a (V )M E N U command line.
Examples:
-x
#
A - Run XDIR without Pause or Input
B - Run XDIR and Pause before Returning to (V)MENU
C - Run XDIR, Allow User Input, and Pause before
Returning to (V)MENU
M - Run MCOPY, Allow User Input of Dest Dir, Allow
User Input of Source Dir and File, and Pause
before returning to (V)MENU
Z - Run Any ZCPR3 Command and Pause before
Chap. 5 M en u S u b sy stem 141
Returning to (V)MENU
#
mlmcopy "Destination Dir? "="Source DIR:AFN? "
z!"Enter Command Line —
axdir
blxdir
clxdir "Enter Ambiguous File Name —
##
Note the space right before the "Prompt form in the C command. This space is
significant to keep the command and user input from running together. This "run
together" is desired for the Z command. Also note the dual prompt for the M command.
With the M command, the fo llo w in g prompts w ill appear (and sample input):
Destination Dir? BACKUP:
Source DIR:AFN? *.TXT
and the fo llo w in g command line is built:
MCOPY BACKUP:=*.TXT
The comm and text sp e c ifie d in the (V )M E N U command line can contain embedded
variables w h ich (V )M E N U w ill expand when the command line is processed. These
variables, w h ich are denoted by a dollar sign ($) fo llo w e d by one or two characters, are
defined as follows:
Variable Expands as
$D Current Disk
$U Current User Area
$Fn FILENA M E.TYP for ZCPR3 System File n
$N n FILE NA M E for ZCPR3 System File n
$Tn TYP for ZCPR3 System File n
$Pp Nam e o f File being Pointed to (V M E N U only)
$$ Place a single $ in command line
These variables can also be used in the menu display itself, and their values w ill be
substituted w hen the display is generated. Example:
-x
#
Menu to Run M80 Assembler
Current File: $F1
Directory: $D$U
F - Define File
E - Edit $F1 P - Page $F1
A - Assemble $F1
142 U sing ZCPR.3 a n d C o m m a n d D e fin itio n s Sec. 1
#
fsetfile 1 "Filename? "
eedit $fl
azex m80 $nl
ppage $fl
##
Notes:
1. The ZCPR3 utility SETFILE is used to d e fin e the name o f a ZCPR3 System File.
Four System Files are available, and they can be referenced by $F1 to $F4, $N1 to
$N4, and $T1 to $T4.
2. The A command shows the execution o f ZEX. (V )M E N U is a true ZCPR3 Shell,
and therefore ZEX commands can be issued from it and w ill run on top o f it. The
prompt for the Z E X command lines will be "Menu>".
3. Assum ing that "MYFILE.MAC" is assigned to the ZCPR3 System File 1 and the
user is logged into disk B user 1, the fo llo w in g screen shows how the display and
the resulting command lines w ill be expanded when execu tion occurs:
Display
Command Lines
Example:
#
AAThis is highlightedAB and this is not
#
3. Assum ing that MYFILE.MAC is being pointed to by the user, the fo llo w in g shows
the expansion o f the command lines for this example:
M enu C o m m a n d E x p a n sio n
eedit $pf EDIT MYFILE.MAC
azex m80 $pn Z E X M80 MYFILE
ppage $pf PAGE MYFILE.MAC
The first entry in any (V )M E N U f ile display is named "No File", and this entry,
when pointed to by the user and expanded into the comm and line, is translated into a
prompt for the user to input the name o f a file. This feature is provided as a
conven ien ce to the user so that he w ill have the ability to easily sp e c ify new files
w h ich do not yet exist to the (V )M E N U commands (such as for an editor command in
w hich the user wants to create a new file).
If the pointer is at "No File" and the command line uses several references to the
pointer (as in the ECHO command example above), then the user is prompted only once
for the name o f the file , and each reference derives its in form ation from this name.
Closing Notes
As many comm ands as the printable ASCII character set (w ithou t lower-case
letters and the (V )M E N U command characters) w ill allow are permitted by (Y)MENU.
The text, how ever, for each menu must be able to f i t on a screen w ith the f il e directory
display at the top and the command prompt at the bottom. This means that the text
cannot exceed 16 lines for V M E N U or 20 lines for MENU.
(V )M E N U fits in nicely to the ZCPR3 System o f programs. The section on
"Relationship o f M E N U and V M E N U to the ZCPR3 System" (fo llo w in g ) explains how
(V )M E N U and the other ZCPR3 programs work together.
The fo llo w in g ASCII characters may n o t be used as commands since they are used
elsewhere:
<SPACE> # % , . < > * <DEL>
<Any Char Less than Space>
(V)M E NU Programming Command Summary
Each (V )M E N U command occupies only one line, and blank lines in the command
group are not permitted. The command line is structured as follows:
1 [o][command]
where:
1 is the single character used to invoke the command;
note that it may be upper- or lower-case,
o is an opening option, w h ich is one of:
:nn — go to Menu nn
! — have (V )M E N U wait when the command is fin ish e d
comm and is an optional ZCPR3 command; note that if the option is ":nn",
then a comm and here makes no sense.
C hap. 5 M e n u S u b sy stem 145
#
A - Enter ZCPR Directory
B - Enter AO:
#
acd zcpr:
baO:
#
Here, i f A is issued, then CD w ill move into ZCPR: and execute ST.COM i f there
is one there. If B is issued, the user is logged into AO:. (Y )M E N U is the next command
in both cases (invoked as a Shell), so (V )M E N U autom atically reinvokes and looks for
M ENU.VM N. If it fin d s it, we are in another (V )M E N U system, and, i f it doesn’t, we
arc back to ZCPR3 command level.
U nder the A option, i f CD fin d s ST.COM, ST w ill execute its fu n c tio n and, unless
this fu n c tio n pops the Shell Stack (SHCTRL POP command), (V )M E N U w ill reinvoke
after it is complete.
U nder the B option, we w ill run (V )M E N U next and sim ply e xit if a M EN U.VM N
f ile is not found.
V M E N U (but not M E N U ) interacts h eavily w ith the ZCPR3 System Files which
are d e fin e d as a part o f the ZCPR3 Environm ent Descriptor. There are four System
Files, and three o f them are used by V M E N U for various purposes:
File Purpose
2 Nam e o f Current File
3 Nam e o f Menu File
4 Nam e (containing wild cards) used to Select Files for V M E N U File D isplay
System File 2 contains the name o f the current V M E N U file. By changing this
name, a transient can cause the pointer o f V M E N U to point to some other f ile when
V M E N U is reinvoked.
System File 3 contains the name o f the menu f ile w h ich V M E N U is using to derive
menu displays and command from. By changing this entry, a transient can select
d iffe r e n t menu file s dynam ically.
System File 4 is used to indicate w hich files (such as *.TXT or *.*) are selected for
display by V M E N U w hen it is invoked. By changing this entry, the nature o f the file
display can be changed dynam ically.
Chap. 5 M e n u S u b sy stem 147
6 Shell Subsystem
A number o f d iff e r e n t shells are supplied w ith ZCPR3, includ ing VFILER and
MENU. The principal shell processor is SH, w h ich permits the user to use Named
Variables. These are expanded in a manner similar to macros in his command lines.
Two programs, SH DE FINE and SH VA R, allow the user to d ynam ically create Named
Variables, and the SFIFILE command allows N am ed Variable d e fin itio n s to be
grouped into sets o f variables.
A conventional C P /M command line could look som ething like this:
ED M Y FIL E .T X T
can be generated, and, as SH substitutes the d e fin itio n o f the variable WORKFILE
when it interprets the command line, "ED %WORKFILE" could be expanded into "ED
MYFILE.TXT" i f WORKFILE=MYFILE.TXT. By changing the value o f the variable
WORKFILE, the m eaning o f the command "ED %WORKFILE" is correspondingly
changed.
Once SH is invoked (by typing the command SH), any command typed by the user
is passed thru SH first, expanded as required, and then, i f the command is not an SH-
resident command, the expanded command line is passed to ZCPR3 for processing.
SH variables may be nested to any depth. Recursion, how ever, should be avoided,
and it is the responsibility o f the user to ensure that recursion does not occur.
’%%’ is interpreted by SH as a single ’%’. For example, SH variables may be
assigned as follows:
VAR1 = "ED %%VAR2" VAR2 = "M YFILE.TXT"
VAR1 is expanded as "ED %VAR2" w hich is, in turn, expanded to "ED MYFILE.TXT".
This command is then passed to ZCPR3 for execution.
S H -B ased Commands
There are three SH-resident commands:
SHCMT sw itch SH to run in comment mode; in comment mode, all lines w hich do
not begin w ith the character ! are treated as comments and flu sh ed
SHECHO w ith Echo enabled, all expanded command lines are printed to the user to
show him what the line looked like after expansion
SHEXIT SH is popped from the Shell Stack, enabling the next lower Shell for
execution
Comment Mode. The normal prompt for SH is "DU:NAME>>", as opposed to
"DU:NAME>" for ZCPR3. If the SHCMT (SH Comment) f a c ilit y is enabled, the SH
prompt becomes "DU:NAME;".
150 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Any text issued by the user or from a command f ile (such as ZE X ) w ill be
processed as a comm ent unless the first character o f the line is an exclam ation mark (!),
which is an indicator to process the command text that follows.
The command SHCMT sw itches to comment mode, and ISHCMT switches back.
SH ECHO , SH EX IT , and ?. The SHECHO command is also a toggle, enabling and
disabling the echo o f command lines after all variables have been resolved.
The SH EX IT command causes the Shell Stack to be popped one level, w hich in
turn causes the SH Shell to be term inated since it was on the top o f the stack.
Both SHECHO and SH EXIT can be executed from SH Comment mode by
p r e fix in g these commands w ith an exclam ation mark.
The ? command (a line beginning w ith a quesiton mark) invokes the built-in help
fa c ility o f SH, w h ich sim ply reminds the user o f what the built-in commands are for
SH.
Other Shells. SH is just the beginning o f the possible ZCPR3 shell stack
applications. M E N U and VFIL ER are both shells also, and they execute like SH. All
three shells can pass command lines to ZCPR3, have ZCPR3 execute these commands
in its normal fash ion (com plete w ith the command-search hierarchy), and then return
to the appropriate shells when done. A shell imposes a new in itial command line
interpretation on the input command line.
Selected Error Messages. "No Shell Stack" means that a Shell Stack has not been
installed in the ZCPR3 System and SH cannot run.
"Shell Stack Full" means that there is not enough room on the Shell Stack for SH to
push itse lf and SH cannot run.
"Shell Stack Entry Size" means that the shell stack entries are too short for SH to
d e fin e the parameters it needs to control its operation. SH cannot run.
P otential Problems. Only one noted problem exists w ith SH. Certain ZCPR3-
rcsident and SYSRCP-resident commands should be avoided. These commands
include:
GO because the TPA has been changed since the desired command executed
SHCTRL This command can take direct control o f the Shell Stack o f ZCPR3. It
can display the contents o f the stack, pop the top-most shell o f f o f it
(thereby term inating the current shell), or clear the stack entirely
(thereby term inating all shells on the stack).
SHFILE This comm and d efin es the name o f the shell variable f ile in the ZCPR3
Environm ent Descriptor. As many shell variable files as desired may be
d e fin e d , each containing their own set o f variables.
and YFILER.COM w ill be about IK shorter. Enabling the built-in docum entation
feature provides the user w ith online help that is more concise but is available much
more rapidly since it is m em ory-resident w h ile VFIL ER is running.
VO
1
Cursor — P - Print V - View - Execute # - Help
0
AE
A
— Movement Commands — _ ——
Miscellaneous --
AS <-+-> AD <SP> - File Forward A - Toggle Alpha Sort
V <BS> - File Backward H - Help File
AX + - Screen Forward N - New DIR
- - Screen Backward S - Disk Status
Screen — J - Jump to a File Z - ZCPR3 Command
AA Left Q - Refresh Screen AC - Exit
AF Right
Movement Commands —
User Functions
The VFILER user may invoke up to ten extra commands that he has previously
defined, by means o f a set o f user-definable functions. These functions are executed
by striking a d igit from 0 to 9. To im plem ent user-defin ed fu nctions, perform the
following steps:
1. Create a f ile called VFILER.CMD containing your extend ed command set.
2. Place VFILER.CM D in some directory along your command search path.
3. When in VFIL ER , i f you strike a digit or a pound sign (# ) for help, VFILER
searches along the path for the first VFILER.CMD f ile it fin d s and extracts the
inform ation from it.
Since V F IL ER searches for VFILER.CMD along the path, several VFILER.CMD
files may be available for the user. For instance, i f the path is $$ -> A$ -> A15, then
VFILER w ill look for VFILER.CMD in the current directory, disk A /c u r r en t user, and
disk A /u ser 15. A general-purpose VFILER.CMD f ile may be placed in A15, and
special-purpose VFILER.CMD file s (e.g., for assembler language developm ent, C
development, word processing, etc.) may be placed in selected user areas on A. For
instance, A7 m ight contain WordStar and be used for word processing, w h ile B7 is the
scratch area for text files. With this path, a user editing file s in B7 w ill f in d WS in A7,
VFILER.CMD (for word processing) in A7, and his system commands in A 15.
If any o f the extend ed commands require the selection o f options, the user is
prompted to supply them. When values for all o f the m andatory options have been
supplied, V F IL ER chains to the new command via the ZCPR3 Command Line B u ffer
feature, executes the command line generated, and returns. V F IL ER is a true shell
under ZCPR3.
The structure o f VFILER.CMD is quite simple. It can be created by any CP/M
text editor, and consists o f the fo llo w in g types o f lines:
1. a command line, w h ich begins w ith a digit (0-9) and contains the text o f the
command to be executed should that digit be typed by the user.
2. a help block, w h ich is printed whenever the user types a pound sign (#); this block
is denoted by a line w h ich begins w ith a pound sign, and it extends to the end of
the file.
3. a comm ent line, used for em bedding explanatory comments, w h ich are for
referen ce purposes only and are not seen by the VFIL ER user.
Command Line. A command line consists o f a digit, zero or more spaces (which
are ignored), and the text o f the command w ith embedded prompts for user input.
These prompts are enclosed in single- or double-quotes (’ or "). When V FIL ER executes
these command lines, it prints the prompt contained w ith in the quotes as they are
encountered, and w aits for the user to input a line o f text (terminated by a R E T U R N ).
At this point the text is substituted in the command line containing the prompt. If a
prompt extends to the end o f a command line, it need not be terminated. For example
the fo llo w in g line:
1 copy 'Source File? ' 'Destination Dir? '
156 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
d efines user fu n c tio n 1. The user is prompted w ith "Source File?", he enters his text, it
is substituted in the command line, he is prompted for "Destination Dir? ", he again
enters a response, it is substituted, and the resulting command line is executed. In the
above exam ple, i f the user responds w ith "myfile.txt" and "CO:", respectively, then the
command line
copy myfile.txt CO:
is built. Note that spaces and other characters between the prompts are sign ificant.
If the comm and line in VFILER.CMD contains the following:
1 mcopy 'Dest Dir? '='Source File? '
then the same responses w ill generate the command line
mcopy CO:=myfile.txt
Param eter Passing. Three parameters may be passed from VFIL ER into the
command line being generated. These parameters and their symbols are:
Symbol Parameter
%D Current Disk Letter
%U Current User Number (1 or 2 digits)
%F Current File Nam e (pointed to by arrow)
%$ DU:FILENAM E for Current File
If the user must insert a ’%’ character into the command line he is building, ’%%’
places one ’%’ into the line. For example:
echo Disk is %d, User is %u, File is %f
prints (if the user is in A15 and pointing to MYFILE.TXT):
Disk is A, User is 15, File is MYFILE.TXT
Help Block. The Help Block in the VFILER.CMD f ile is sim ply a block o f text
w hich extends from the pound sign (#) in the f ile to the end o f the file. This help
inform ation is displayed to the user as one screen, and it is the responsibility o f the
person who writes the VFILER.CMD f ile to see that this body o f text (including the
line the pound sign is on) does not exceed 22 lines. Example:
# Help for Word Processing
1 - Run WordStar
2 - Run WordMaster
3 - Run ROFF4
Comment Line. A comm ent line is any line w hich does not begin w ith a digit or a
pound sign. The text o f that line is the comment. It is not displayed to the VFILER
user and is used only for reference to aid in m aintaining the VFILER.CM D file. For
C hap. 7 V F IL E R a n d F ile M a in te n a n c e 157
example:
! This is a comment
This is also a comment
Running ZEX from VFILER. Like all standard ZCPR3 Shells, V F IH E R pupports
the execution o f the the ZEX command f ile processor on top o f itself. If ZEX is
running, VFIL ER w ill sim ply prompt Z E X for input rather than entering its normal
screen-oriented display mode. In this way, a comm and executed from the
VFILER.CMD f ile may invoke ZEX, and all o f the ZE X command f ile processing will
be performed before VFILER is reentered.
Sample VFILER.CMD File. To cla r ify the use o f the user-defin ed functions, A
sample VFILER.CM D f ile is shown below.
! VFILER Command File for Richard Conn
1 xdir 'XDIR Options? '
2 protect %D%U:%F 'PROTECT Attributes? •
3 wm %$
4 t2a
5 echo Disk=%d User=%u File=%f DU:FILENAME = %$
#VFILER Command File for Richard Conn
T Tag f ile for inclusion for mass f ile operations (group operations). The file
remains tagged until either a disk log-in or ’U ’ is used to untag it. A ’t’
marker is placed by the tagged f ile name as a reminder the f ile is tagged for
mass copy or mass delete.
U U n tag a f ile previously tagged for mass f ile operations. ’U ’ can be used to
m ove cursor ’forw ard ’ for quick untagging o f files. Logging-in drive again
w ith ’N ’ also untags all files.
G T or U Group (Mass) Tag or Untag. The user is prompted for the operation, and
two o f his options are T and U. If either operation is selected, tagging or
untagging occurs autom atically from the cursor position to the end o f the
screen on all file s in this area. If the user then wishes to see the
158 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
accum ulated sizes o f the tagged files, the G F (Group F ile Size) command
may be issued.
File Display Commands
V V iew text f ile on console, w ith pagination and single-line turn-up. <CTRL-
C> cancels function. <SPACE> advances to next line, and any other
character advances the screen. Only ASCII characters are processed.
D etails on CRT and Printer sizes (number o f lines on screen, number of
lines on printer, etc.) are derived from the ZCPR3 E nvironm ent Descriptor
and need not be o f concern to the user. The command CPSEL can be used to
select the CRT or Printer characteristics from the E nvironm ent Descriptor
as desired.
File Operation Commands
C Copy f ile to another DIR area w ith autom atic CRC v e r ification . The
standard ZCPR3 DIR form is allow ed, and a colon after the sp e c ific a tio n is
optional. System reset occurs for disk change. The user is prompted to erase
an already existin g f ile on another drive or in other user areas. Before
attem pting a copy, check to see that there is enough room on the destination
disk.
D D elete f ile from disk. R econ firm ation is requested before the deletion is
performed.
G Invoke Group (Mass) command. The three options o f interest here are C
(Copy all Tagged Files), D (Delete all Tagged Files), and F (File Size o f all
Tagged Files).
GF Group f ile size summary. Adds up the f ile sizes o f all tagged file s and
displays this sum.
C hap. 7 V F IL E R a n d F ile M a in te n a n c e 159
<SP> A d vance to next f ile name. Wraparound from last to first may occur. The
WordStar AD character or your right arrow key (if available in the
Z3TCAP) perform the same function.
<BS> Back up to last f il e name. Wraparound from first to last may occur. The
WordStar AS character or your le ft arrow key (if available in the Z3TCAP)
perform the same function.
J Jump to a file. U sed to quickly jump to a sp e c ific file. User is prompted for
a f ile name, and w ild cards (? and *) may be used. User is positioned at
first f ile w h ich matches w ild cards if found; user is positioned at first file
in ring i f not found.
+ Jump to N ext Screen (if any). If there is more than one screen o f files, the
user is advanced to the next screen. If at the last screen, wraparound occurs
to the first. AF also performs this fu n ction i f not overridden by arrow keys.
Jump to Last Screen (if any). Similar to + but in the opposite direction.
Wraparound to last screen may occur. AA also performs this fu n c tio n if not
overridden by arrow keys.
Arrows WordStar arrow key m ovem ent (if not overriden by arrow keys in Z3TCAP):
AE
A
AS < - + - > AD
V
AX
Miscellaneous VFILER Commands
A Toggle Alpha Sort. This command reverses the sense o f the sort o f the
current directory, reloads the directory, and refreshes the screen, having
sorted it in the new sense. Sorting is done by f ile name and type or by file
type and name.
H Invokes external HELP Inform ation. VFILER w ill chain to HELP and
display the inform ation in VFILER.HLP. VFIL ER checks to see if HELP
can be fou n d along path (external if available, internal if external path is
not available) and does not attempt to chain if HELP.COM cannot be found.
160 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
N Login new D U area for display and reset system for disk changes. Format
o f D U form is same as ’C’ for copy.
S Status o f requested drive, shows rem aining disk storage in kilobytes and
number o f file s in current directory.
Z Run any ZCPR3 Command Line. User w ill be prompted for command line,
and Y FIL ER w ill be reentered in same D U area as w hen command was
executed. Command w ill execute in the original D U area as indicated by
the prompt.
DU 3 is intended for use on a ZCPR3 system, and is designed for installation with
a minimum o f trouble. In fact, in almost all cases, no changes to the source file should
be necessary to get D U 3 up and running. This is because D U 3 uses the disk parameter
block o f C P /M to determ ine the characteristics o f the disk environment.
D U 3 is installed by running the ZCPR3 u tility Z3INS on it. To perform its
functions, D U 3 needs only a pointer to the ZCPR3 Environm ent Descriptor. D U 3 is
assembled w ith VLIB, Z3LIB, and SYSLIB3.
The screen displays shown on the fo llo w in g pages are very close to the actual
screen displays the user w ill see on his terminal when he runs DU3. The differen ces
will be cosmetic in nature.
DU3 Command Summary. A command line may consist o f one or more commands
separated by commas; the commands are executed sequentially, in the order in which
they appear. The only exceptions to this rule are the rntext command (w hich stores the
command line aw ay as a macro) and the *nn command (w hich repeats the command
line). The commands are listed below in the order in w hich experience shows that they
are most freq u en tly used.
Editing
E Invoke Editor
Positioning
Tn Position to Track n (dec) Sn Position to Sec n
Gn Position to Group n (hex) G Show position
+n A d van ce to N ext Sector -n Back up to Last Sec
Displaying
An-n ASCII Dump Hn-n Hex Dump
Dn-n ASCII and H ex Dump Vn V iew n Blocks
M D isplay Disk Map Mn D isplay File in Group n
Data M odification
Exiting DU3
X E xit to ZCPR3 AC Exit to ZCPR3
162 U sing ZCPR.3 a n d C o m m a n d D e fin itio n s Sec. 1
Macros
n Exec Macro (0<=n<=9) :nt D e fin e Macro n w /s tr t
:Pn Print Macro n :PA Print All Macros
:P@ Print Prev Command
Queue Control
Q Print Q ueue Statistics QZ Zero (Empty) Queue
QSf Save Q ueue as File f
Data Searching
Ff F ind File f =str Search for String
Un Set User Area for Find
Printer Output
P Toggle Printer
Command Manipulation
@ Exec Prev Command *nn Repeat Command Line
S ta tis tic s /H e lp
# D isplay D isk Stats ? D isplay Help Info
H alt/S Ieep
! Halt and Wait for User Zn Sleep n Seconds
DU3 Commands: Log In, New Disk, Stats
The f o llo w in g commands are discussed in this section:
L Log in Disk
N N e w Disk (Reset Disk System)
M Map Disk D irectory
U Select User Number
# Print Disk and Queue Statistics
Command: L[d]. The simple "L" command re-logs in the current disk. The user may
pull out a disk, put in a new, and "L" just to log it in. The form "Ld" (where d is a valid
drive letter) is used to log in a sp e c ific disk and permit the user to work on that
C hap. 8 D U 3 D isk U tility 163
| | Filename Extent
| User Number
Group Range
Command: Uu Logs user ’u’ for next F (Find File) command.
Exam ple (actual D U 3 session):
DU3 Bl? u7
DU3 B7? ul
164 U sing Z C P R 3 a n d C o m m a n d D efin itio n s Sec. 1
DU3 Bl? g4
Group = 0004:00, Track 122, Sector = 129, Physical Sector = 12!
DU3 Bl? g
Group = 0004:00, Track 122, Sector = 129, Physical Sector = 12!
DU3 Bl? go
Group = 0000:00, Track 122, Sector = 1, Physical Sector = 1
Command: Tnn and Snn. "Tnn" does a seek to track nn but does not read a block. "Snn"
positions to sector nn on the current track and reads the block there. Exam ple (actual
DU 3 session):
DU3 Bl? tl24
Group = 0015:00, Track = 124, Sector = 1, Physical Sector = 1
Command: R and W. R reads the block currently positioned to into memory. Note R
(Read) is im plicit in the G, +, and - commands, but NO T in the S and T commands.
W writes back the current block (NOTE: may not be used after an F command, as
CP/M was used to f in d the f ile in the directory).
Examples:
DU3 B l ? r
DU3 B l ? W
Command: +[nn] and -[n n j."+" advances 1 sector (if below track 2, this advances to next
numerical sector and i f 2 or more, advances based on the system ’s sector skewing
algorithm, i.e. so + w ill get the next logical sector o f the file). backups up 1 sector
in the same sense.
N ote that "+" and may take an amount: for example, +15 steps in 15 sectors.
Note also that issued at the first logical sector o f the disk w ill wrap back to the last
and "+" issued at last sector w ill wrap forw ard to the first.
Exam ples (actual D U 3 session):
DU3 B l ? gO
G roup = 0 0 0 0 : 0 0 , T r a c k = 1 2 2 , S ecto r = 1, P h y sic a l S ecto r
DU 3 B l ? d
00 0 7 5 3 5 4 4 4 2 0 2 0 2 0 2 0 2 0 4 D 5 3 4 7 00000002 | .S T D MSG. .
10 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00000000 1 ..................... ••I
20 004C 4449 5 2 2 0 2 0 2 0 2 0 4 3 2 0 2 0 00000038 | . LDIR C . . .8 |
30 1 3 0 0 1 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00000000 1 ..................... •• 1
40 0 8 4 3 5 0 4 D 5 5 4 7 2 0 2 0 2 0 4 3 4 1 5 4 01000046 | . CPMUG CAT. . .F |
50 1C 001E 00 38003D 00 4 1 0 0 4 3 0 0 45000000 1 • • • • 8 • “■• *A. C . E . •• 1
60 0 0 4 3 4 F 4 D 4D 414E 44 2 0 4 C 4 2 5 2 01000080 | . COMMAND LBR. . •• 1
70 1 4 0 0 1 6 0 0 1 7 0 0 1 8 0 0 19001A 00 1B001D 00 1 ..................... .. 1
DU3 B l ? + d
G roup = 0 0 0 0 :0 1 , T rack = 122, S e c to r = 2, P h y sic a l S e c to r
00 0 7 5 4 4 1 4 C 4B202020 2053554D 0 0 0 0 0 0 4 9 |.T A L K SUM. . • I |
10 1 1 0 0 2 3 0 0 24000000 00000000 00000000 I • ••I
20 0 0 5 5 4 E 4 5 52413135 2041534D 0 0 0 0 0 0 6 0 | . UNERA15 ASM. . 1 I
30 3E 003F 00 40000000 00000000 00000000 ! > . ? . § . . • ••1
40 075A 3249 4E532020 20575348 0 0 0 0 0 0 2 A | . Z 2IN S WSH. . • * 1
50 2 1 0 0 2 5 0 0 00000000 00000000 0 0 0 0 0 0 0 0 | ! .% ............ •• 1
60 0 7 5 A 3 2 4 3 4F4E2020 20575348 0 0 0 0 0 0 3 F | . Z 2 CON WSH. . . ? |
70 1 2 0 0 2 2 0 0 00000000 00000000 00000000 1 I» ••I
DU3 B l ? +d
166 U sin g Z C P K 3 a n d C o m m a n d D e fin itio n s Sec. 1
DU 3 Bl? +2
Group = 000C :04, Track = 122, Sector = 5, Physical Sector
DU3 Bl? d
00 084D4153 54455220 20434154 01000080 |.MASTER CAT. *** 1
10 2D002F00 3A003B00 3C004200 44004600 .F. |
PQ•
Q
V
••
1
•
•
•
•
20 00464958 54455820 2041534D 0100001E |.FIXTEX ASM. . . . |
30 65006600 69006B00 6C000000 00000000 |e.f.i.k.l.. . . . . . |
40 00554E45 52413135 20434F4D 00000007 | . UNERA15 COM. . . . |
50 52000000 00000000 00000000 00000000 |R .............................. . . . |
60 084D454E 55202020 20C35052 00000008 | .MENU CPR. . . . |
70 53000000 00000000 00000000 00000000 | S .............................. . . . |
DU 3 Bl? -3d
Group = 000C :01, Track = 122, Sector = 2, Physical Sector
00 0754414C 4B202020 2053554D 00000049 |. TALK SUM. . .I|
10 11002300 24000000 00000000 00000000 ! . . # . $ ................... ... |
20 00554E45 52413135 2041534D 00000060 | . UNERA15 ASM. 1I
30 3E003F00 40000000 00000000 00000000 | > . ? . @ ...................... |
40 075A3249 4E532020 20575348 0000002A | . Z2INS WSH. . . 11
50 21002500 00000000 00000000 00000000 |I. %........................ ...|
60 075A3243 4F4E2020 20575348 0000003F I.Z2CON WSH. . . ? |
70 12002200 00000000 00000000 00000000 1 " •••I
DU3 Commands: Searching
The comm ands for searching for data on the disk are:
F filenam e.typ — f in d all dir entries for f ile
=string —f in d next occurrence o f string
Command: Ffilenam e.typ. Print directory for f ile "filename.typ". This command
presents the directory entries for all extents o f the indicated file . See the section on
"Interpreting the D U 3 Directory Display" for in fo on how to interpret the inform ation
C hap. 8 D U 3 D isk U tility 167
DU3 Bl? d
00 075A3243 4F4E2020 20575320 05000080 |.Z2CON WS .... |
10 3D 013E 01 3 F 0 1 4 0 0 1 4 1 0 1 4 2 0 1 4 3 0 1 4 4 0 1 |=. > .? .@ .A . B . C. D. |
20 0 7 5 A 3 2 4 3 4 F 4 E 2 0 2 0 2 0 5 7 5 3 2 0 0 6 0 0 0 0 7 7 | . Z2 CON WS ...w |
168 U sing Z C I R.3 a n d C o m m a n d D e fin itio n s Sec. 1
DU3 B l ? + = D U 3 , d
G roup = 0 0 0 0 : 1 1 , T r a c k = 1 2 2 , S ecto r = 18, P h y sic a l S ecto r =
= a t 24
G roup = 0 0 0 0 : 1 1 , T r a c k = 1 2 2 , S e c to r = 18, P h y sic a l S e c to r =
00 E 547454E 494E 5 3 2 0 204D 4143 01000080 eG E N IN S MAC. . . . |
10 D 700E F00 F 0 0 0 F 4 0 0 F 5 0 0 F 6 0 0 F700F800 W.o.p.t. u.v.w.x.|
20 E 5 4 4 5 5 3 2 2 0 2 0 2 0 2 0 2 041534D 01000080 eDU3 ASM____ |
3 0 EC00ED00 EE 00FA 00 0 7 0 1 0 B 0 1 0E011301 1.m .n.z. • ••••••• I
4 0 0 4 4 4 5 5 3 2 2 0 2 0 2 0 2 0 20C3CF4D 0000004E . DU3 COM. . . N|
50 F 100F 200 F 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00000000 q . r . s . ..
60 E 547454E 4 9 4 E 5 3 2 0 204D 4143 02000039 eG E N IN S MAC. . . 9 |
70 F 9 0 0 0 F 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00000000 y .......
DU3 Commands: Saving, Restoring, Queue
The fo llo w in g commands are discussed in this section:
< Save Current Block
> Restore Saved Block
<B Save Current Block at Tail of Queue
>B Load Current Block from Head o f Queue
<G Read and Save Group at Tail o f Queue
>G Copy Group from Head o f Queue and Write
Q Print Queue Statistics
QZ Zero (Clear) Queue
QS Save Q ueue as a File
Command: < and >. "<" saves current block in an internal save b u ffer. ">" copies
the internal save b u ffe r into the current block area (but does NO T write it out to disk).
Command: <B and >B. "<B" saves the current block onto the tail o f the D U 3
Queue. This Queue, a FIFO (First In-First Out) data structure, can be used to collect a
number o f blocks for later copy to a disk f ile or explicit placem ent som ewhere on the
disk. ">B" extracts the block at the head o f the D U 3 Queue and places it into the
working b u ffe r area.
Command: <G[nn] and >G[nn]. "<G" reads the current group and saves it on the tail
o f the D U 3 Queue. The size o f a group is dependent on the form at o f the disk, and
D U 3 autom atically adjusts to the proper group size w ithout the user h aving to worry
about what it is. ">G" copies the group at the head o f the D U 3 Queue onto disk. If nn
is sp ecified (as in "<Gnn" or ">Gnn"), then the indicated group is read from or written
to. If nn is not given, then the group the user is currently positioned to is affe c te d .
Chap. 8 D U 3 D isk U tility 169
Command: Q, QZ, and Q S file. Q reports the status o f the D U 3 Queue, namely how
many blocks are stored in it and how much space remains. QZ zeroes (clears) the DU3
Queue. "QSfilename.typ" saves the D U 3 Q ueue on disk in the current user area as the
indicated file. Examples (actual D U 3 session):
DU3 Bl? gO
Group = 0000:00, Track = 122, Sector = 1, Physical Sector
DU 3 Bl? d
00 07535444 20202020 204D5347 00000002 |.STD MSG..
10 10000000 00000000 00000000 00000000 1............. •• 1
20 004C4449 52202020 20432020 00000038 |.LDIR C .. .8 |
30 13001500 00000000 00000000 00000000 1............. •• 1
40 0843504D 55472020 20434154 01000046 |.CPMUG CAT.. .F |
50 1C001E00 38003D00 41004300 45000000 •• I
<
W
CO•
d
II
•
•
•
•
60 00434F4D 4D414E44 204C4252 01000080 |.COMMAND LBR..** 1
70 14001600 17001800 19001A00 1B001D00 1............. •• 1
DU 3 Bl? <
DU 3 Bl? chO-■7f e5
DU 3 Bl? d
00 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
10 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
20 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
30 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
40 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
50 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
60 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
70 E5E5E5E5 E5E5E5E5 E5E5E5E5 E5E5E5E5 |eeeeeeeeeeeeeeee|
DU 3 Bl? >,d
00 07535444 20202020 204D5347 00000002 |.STD MSG..
10 10000000 00000000 00000000 00000000 1............. ••1
20 004C4449 52202020 20432020 00000038 |.LDIR C .. .8 |
30 13001500 00000000 00000000 00000000 1............. •• 1
40 0843504D 55472020 20434154 01000046 |.CPMUG CAT .. .F |
50 1C001E00 38003D00 41004300 45000000
CO•
<
W
U
** 1
II
•
•
•
DU3 Bl? q
** Queue Status Summary **
0 Blocks in Queue
249 Blocks Left in Queue
Address of Head of Queue: 3E00 Hex
Address of Tail of Queue: 3E00 Hex
DU3 Bl? gl
Group = 0001:00, Track = 122, Sector = 33, Physical Sector = 33
DU3 Bl? q
** Queue Status Summary **
64 Blocks in Queue
185 Blocks Left in Queue
Address of Head of Queue: 3E00 Hex
Address of Tail of Queue: 5E00 Hex
DU3 Bl? qz
** Queue Status Summary **
0 Blocks in Queue
249 Blocks Left in Queue
Address of Head of Queue: 3E00 Hex
Address of Tail of Queue: 3E00 Hex
DU3 Bl? go
Group = 0000:00, Track = 122, Sector = 1, Physical Sector = 1
C hap. 8 D U 3 D isk U tility 171
DU 3 B7? d
00 07535444 20202020 204D5347 00000002 |.STD MSG. .
10 10000000 00000000 00000000 00000000 1....... •• 1
20 004C4449 52202020 20432020 00000038 |.LDIR C . ..8 |
30 13001500 00000000 00000000 00000000 1....... ••I
40 0843504D 55472020 20434154 01000046 |.CPMUG CAT. ..F |
50 1C001E00 38003D00 41004300 45000000 I••••8 •“ •A.C.E .
60 00434F4D 4D414E44 204C4252 01000080 |.COMMAND LBR. .
70 14001600 17001800 19 001A00 1B001D00 1....... •• 1
DU 3 B7? d0- #f
00 07535444 20202020 204D5347 00000002 |.STD MSG. .••1
DU 3 B7? h0- #f
00 07535444 20202020 204D5347 00000002
DU 3 B7? a0- #f
00 |.STD MSG___ |
DU 3 B7? fdu2.hlp
20 07445532 20202020 20484C50 01000039 |.DU3 HLP. .•9|
30 28009800 99009B00 9C009D00 00000000 1(...... ••I
Group = 0000:00, Track = 122, Sector = 1, Physical Sector
C hap. 8 D U 3 D isk U tility 173
DU3 B7? d
00 496E766F 6B696E67 20445533 2 0616E64 Invoking DU3 and
10 20445533 20496E73 74616C6C 6174696F DU3 Installatio
20 6E0D0A44 55332043 6F6D6D61 6E642053 n..DU3 Command S
30 756D6D61 72790D0A 436F6D6D 616E6473 ummary..Commands
40 20666F72 204C6F67 67696E67 20446973 for Logging Dis
50 6B732061 6E642045 78616D69 6E696E67 ks and Examining
60 20446973 6B205061 72616D65 74657273 Disk Parameters
70 0D0A436F 6D6D616E 64732066 6F722050 .. Commands for P
DU3 B7? v
Invoking DU3 and DU3 Installation
DU3 Command Summary
Commands for Logging Disks and Examining Disk Parameters
Commands for P
Group = 0028:00, Track = 125, Sector = 273, Physical Sector = 273
DU3 B7? V3
Invoking DU3 and DU3 Installation
DU3 Command Summary
Commands for Logging Disks and Examining Disk Parameters
Commands for Positioning and Reading Data
Commands for Searching for Data
Commands for Saving and Restoring Data
Commands for Viewing data
Commands for Altering Data
Commands for Manipulating Macros and the @ Command
Miscellanea
Examples of command use
Interpret
Group = 0028:02, Track = 125, Sector = 275, Physical Sector = 275
DU3 B7? d
00 496E766F 6B696E67 20445533 20616E64 |Invoking DU3 and|
174 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
DU 3 B7? d
00 00000000 00000000 00000000 00000000 1............... 1
10 00445533 20496E73 74616C6C 6174696F |.DU3 Installatio|
20 6E0D0A44 55332043 6F6D6D61 6E642053 |n..DU3 Command S|
30 756D6D61 72790D0A 43 6F6D6D 616E6473 |ummary.. Commands|
40 20666F72 204C6F67 67 696E67 20446973 | for Logging Dis|
50 6B732061 6E642045 78616D69 6E696E67 |ks and Examining|
60 20446973 6B205061 72616D65 74657273 | Disk Parameters j
70 0D0A436F 6D6D616E 64732066 6F722050 |..Commands for P|
DU3 B7? 1
Group = 0000:01, Track = 122, Sector = 2, Physical Sector = 2
00 0754414C 4B202020 2053554D 00000049 |.TALK SUM...I|
10 11002300 24000000 00000000 00000000 |..#.$.......... |
DU3 B7? 1
Group = 0000:02, Track = 122, Sector = 3, Physical Sector = 3
00 07444953 4B4F5554 20434F4E 00000000 |.DISKOUT CON___ |
10 00000000 00000000 00000000 00000000 I .............................................I
DU3 B7? 1
Group = 0000:03, Track = 122, Sector = 4, Physical Sector = 4
00 04584449 52202020 20C3CF4D 00000054 |.XDIR COM.,.T|
10 2C002E00 48000000 00000000 00000000 |, ..,H.......... |
DU3 B7? 1
Group = 0000:01, Track = 122, Sector = 2, Physical Sector = 2
176 U sing ZCPiv.3 a n d C o m m a n d D e fin itio n s Sec. 1
1: +,d0-#lf
2:
DU3 B7? 0
Command —
g0,d0-#lf,+,d0-#lf,+,d0-#lf,+,d0-#lf
Group = 0000:00, Track = 122, Sector = 1, Physical Sector = 1
00 07535444 20202020 204D5347 00000002 |.STD MSG___ |
10 10000000 00000000 00000000 00000000
Group = 0000:01, Track = 122, Sector = 2, Physical Sector = 2
00 0754414C 4B202020 2053554D 00000049 |.TALK SUM...I|
10 11002300 24000000 00000000 00000000 ! . . # • $ .............................I
DU3 B7? gl
Group = 0001:00, Track = 122, Sector = 33, Physical Sector =
DU3 B7? AC
B7>
DU3 Command: Editor
DU3 contains a built-in, screen-oriented editor. This ed ito r derives its screen-
oriented fu n ctio n s fro m the ZCPR3 TCAP, so the DU3 E d ito r should be invoked only
on ZCPR3 Systems th a t support a valid TCAP for the user’s term inal.
The DU3 E d ito r is a complete subsystem un d er DU3 in its own right. It provides a
varie ty of u s e r-frien d ly editing featu res fo r the m a n ip u latio n of d a ta w ith in the
cu rre n t sector (block) as well as allow ing the user to issue any DU3 com m and line he
desires, re tu rn in g to the editor when it is completed.
The DU3 E d ito r presents a screen display to the user w hich is stru c tu re d to
include a line showing the contents of the sector at the cursor, several lines of
hex/A SC II (sim ilar to the D com m and output) w hich display the entire sector, a menu
of commands, a cursor (w hich initially points to the f ir s t byte in a sector), and a
com mand prompt.
Command: E. The com m and "E" invokes the editor. If any other com mands follow
E on the same line, these com mands are flushed.
The user may employ the WordStar cursor movement com m ands to move the
cursor about in the c u rre n t sector. These com mands are:
AE = Cursor UP
A
The follow ing com mands are also available un d er the DU3 Editor:
A E n ter ASCII Text into block s tartin g at cursor
H E n ter H ex/D ec N um bers into block starting at cursor
+ A dvance to N ext Logical Sector and Edit
Backup to Last Logical Sector and E dit
AW Write the C u rre n t Sector to Disk
C Issue A ny DU3 Com m and Line
X E xit to DU3
AC E xit to ZCPR3
All of these com mands are self-explanatory except fo r the A and H commands.
T he A com m and enters ASCII text into the sector startin g at the cursor position.
In response to this com mand, the DU3 E ditor will prom pt the user fo r input. He may
then type any text he wishes; upon striking the R E T U R N key, this text is entered
literally into the sector. If it overflow s the end of the sector, it is truncated. If the
user wishes to em bed hexadecim al values (such as OD fo r C arriage R eturn), he may use
the fo rm "<hh>". Example:
this is a test<0D><0A>
The H com m and enters a group of hexadecim al a n d / o r decimal values into the
sector startin g at the cursor position. Numbers, separated by spaces, are hexadecim al
unless the the fo rm "#nn" is used, in which case decim al values are entered. Example:
1 2 3 3A b7 #25
T he E d ito r is one of the most pow erful featues of DU3. It is highly recom mended
th a t the user experim ent w ith it and become a c q u a in te d w ith its capabilities.
DU3 Examples
M ultiple com mands may be separated by
A ny valid com m and string may be placed as an operand of the original DU3
com mand, e.g.: A>DU3 G O ,D ,G 2 ,= O K < D x A x lA > ,D
Example: the follow ing com mands will fill the B disk directory w ith E5’s:
lb log in b drive
go position to dir.
ch0-7f e5 fill with e5
< save the sector
>/W,+,/16 restore, write, next,
repeat 16
This could be shortened to:
Ib,g0,ch0-7f e5,<
> ,w,+,/16
I f we d efin e the follow ing two macros:
180 U sing Z C P R 3 a n d C o m m a n d D e fin itio n s Sec. 1
Macro 0 —
:0g0,ch0-7f e5,<
Macro 1 —
i1>,w,+,/16
To initialize the directory firs t on D rive A: and then on D rive B:, we could issue
the follow ing commands:
La, 0 <— Log in A and Initialize first block
1 <— Perform write
Lb, 0 <— Log in B and Initialize first block
1 <— Perform write
n, 0 <— Declare New Disk and Initialize first
1 <— Perform write
Directory Interpretation
The follow ing dia g ra m explains the fo rm a t of a C P /M d irec to ry entry. Use DU3
w ith either the F (Find File) com mand or the D (Dump) com m and to display the
directory sectors, w hich are located in groups 0 and 1 on a single density disk. Sample
result of "FSID.COM" command:
First 40 00534944 20202020 20434F4D 0000003A |.SID COM.
line II III I II II I
|| || A---- file name--------A || || Afile name
|| || in hex || || in ASCII
|| || extent-AA ||
|| || file size in sectors-AA
|| AA-oo = file active
|| E5 = file erased
AA-displacement of line in directory sector
A ZCPR3 System Segment is a package or d ata file w hich can be loaded by the
LD R tool into memory fo r use by the ZCPR3 System. T here are several types of
ZCPR3 System Segments:
*.ENV E nv iro n m en t Descriptors
S e c tio n 2
Inside Z C P R 3
Inside ZCPR3
This section presents details of the in te rn a l operation of various components of
the ZCPR3 System. In p articu la r, the ZCPR3 com mand processor, ZEX , the system
segments, shells, erro r handlers, screen-oriented utilities, and elements of the toolset in
general are discussed.
This section is in tended m ainly fo r people who w ant to program utilities for
ZCPR3. It is assumed th a t the reader is thoroughly fa m ilia r w ith C P /M and has
experience in program m ing 8080/Z80 assembly language.
181
182 In sid e Z C P R 3 Sec. 2
Inside Z C P R 3 Sec. 2 183
This ch ap ter describes the in tern al operations of the ZCPR3 Comm and Processor,
the h e a rt of the ZCPR3 System. The ZCPR3 C om m and Processor runs in place of the
C P/M CCP, and it is located directly un d er the BDOS. To ensure com patibility with
CP/M, the ZCPR3 Com m and Processor is 2K bytes in size or smaller and supports some
stru c tu ra l a n d fu n c tio n a l similarities. In order to pack all of the fu n ctio n s necessary
to support a fu ll ZCPR3 System into the Com m and Processor, it is m a n d ato ry that the
Comm and Processor ru n on a Z80 microprocessor. The size reduction a ffo rd e d by
using ju m p-relative an d other Z80-specific instructions in the C om m and Processor is
sig n ifican t, but, fo r the sake of those users who do not have Z80s, there is a flag at the
f ro n t of the C om m and Processor w hich can select 8080 code. The resulting larger code
forces a red u ctio n in features, but very useful ZCPR3 systems can still be created for
the 8080.
Operation of the ZCPR3 CP
F igure 1-1 illustrates the location and s tru ctu re of the ZCPR3 Command
Processor (CP). At various points in this book, the CP may also be r e fe rre d to as a
C om m and Processor R eplacem ent (CPR), and the terms CP and CPR can be used
interchangeably.
The m ain fu n c tio n of the ZCPR3 Com m and Processor (CP) can be described in a
few high-level pseudo code instructions. The follow ing is an English-like expression
of the CP’s operation:
initialize-environment
loop forever
input (command_line)
while command_line is not empty
parse (next_command)
resolve (next_command)
end while
end loop
As the reader can see, the overall view of the ZCPR3 CP is quite simple. The
m ajor fu n ctio n s p erfo rm e d by the ZCPR3 CP are:
1. In itialize the environm ent
2. In p u t the com m and line
3. Parse the next com m and in the com m and line
4. Resolve the next com mand
We shall now discuss each of these functions in more detail.
Initialize_Environment
E n v iro n m en t in itia liza tio n is discussed w ith referen c e to Listing 9-1, Code
Sections 1 through 4.
The in itia liz a tio n of the the ZCPR3 CP env iro n m en t can be expressed in the
follow ing pseudo-code:
184 In sid e Z C P R 3 Sec. 2
e n try
s e t_ c u rre n t_ u s e r_ a re a
se t_ c u rre n t_ d is k
se t_ D M A _ a d d re ss
se t_ ru n n in g _ S U B M IT _ in d ic a to r
Entry. The ZCPR3 Com m and Processor supports two entry points (see Code Section 1).
The firs t six bytes of the CP contain two jum p instructions. The firs t jum p is usually
used for e n try on cold boot, and the second jum p is usually used on w arm boot. In the
original C P /M CCP, the firs t jum p allowed a d e fa u lt com m and stored in the com mand
line b u f f e r in te rn a l to the CCP to be executed im m ediately and the second jum p did
not allow this com m and to be executed. This was useful in allow ing C P /M to come up
ru n n in g a p a rtic u la r com mand line on cold boot (or even w arm boot, fo r th a t m atter,
since the e n try into the CCP was controlled by the cold boot and w arm boot routines in
the BIOS).
If ZCPR3 is im plem ented w ith an external M ultiple Com m and Line b u f f e r , these
two entry points have the same m eaning—to continue com m and line processing.
Without an external M ultiple Comm and Line b u f f e r , the ZCPR3 CP contains a
com mand line b u f f e r im m ediately a f te r these two jumps. This b u f f e r is stru c tu re d as
follows:
Z C P R 3_C P : ; b e g i n n i n g o f ZCPR3 CP
JMP RUNCMD ; f i r s t JM P i n s t r u c t i o n i n CP
JMP NOCMD ; s e c o n d JMP i n s t r u c t i o n i n CP
An external routine, such as the cold boot or w arm boot routine, can store a
com mand line (term inated by a b in a ry 0) into this b u f f e r at the symbol CMDLIN. Care
should be taken not to exceed the c h ara cter count at the symbol BUFSIZ (this count
includes the te rm in atin g bin a ry 0). Once the com mand line is stored, the routine may
enter the ZCPR3 CP at the first JMP instruction and this com m and line will be
executed. If the ZCPR3 CP is entered at the first JMP instruction, the pointer at
N X T C H R will be set to the first byte in CMDLIN, and when the ZCPR3 CP is ready to
Chap. 9 In sid e th e Z C P R 3 C o m m a n d P ro c e sso r 185
o f the tw o entry points. The C register contains the new current user area num ber in
its upper fou r bits and the new current disk in its low er fou r bits. The routines
set_curren t__user__area and set_current_disk derive their in fo rm a tio n from the C
register and log the ZCPR3 CP into this directory. T his becom es the user’s current, or
w orking, directory at cold or warm boot tim e. By the C P /M d e fin itio n , m em ory
location 4 (the U D B y t e ) in the b u ffe r area in low m em ory con tain s the current U D
(user a r e a /d isk ) o f the user, and the cold boot routine both sets this valu e in itia lly and
stores this valu e in the C register for entry into the ZCPR3 CP. The warm boot routine
ty p ica lly reads this valu e from location 4, stores it into the C register, and enters the
ZCPR3 CP.
S e t_ D M A _ a d d r e ss. T his routine sets the address for the load o f the next block
from disk to 80H. T his is done through BDOS calls.
S e t_ r u n n in g _ S U B M IT _ in d ic a to r . T his routine checks to see i f a f ile nam ed
"$$$.SUB" exists on disk A and sets a fla g to in d ica te the result. The BDOS disk reset
fu n c tio n returns a code in the A register w h ich is non-zero i f the current user area on
disk A contains a f ile begin n in g w ith a "$" character, and this clue is used to determ ine
w hether it is necessary to check disk A for a f ile nam ed "SSS.SUB". I f this clu e is non
zero, the current user area on disk A (w h ich is auto-logged by the fir st byte o f the
SUBFCB b u ffe r ) is checked for a $$$.SUB file , and the R N G SU B fla g is fin a lly set as a
true in d ica tio n that a $$$.SU B f ile exists on disk A, current user area. T his fla g is later
used w hen the R E A D B U F routine is used to input the next com m and line.
Input (C om m an d _L in e)
O nce the in itia liz a tio n is perform ed, the ZCPR3 CP is ready to input a com m and
lin e and process it. U nder the recom m ended ZCPR3 CP c o n fig u ra tio n , how ever, the
M ultiple Com m and L ine B u ffe r is availab le, so a com m and lin e m ay already be in
existen ce and processing should continu e w ith this line. N ote that Code Section 4 o f
the in itia liz a tio n code branches to the entry point lab elled RSI: a fter the in itia liz a tio n
is com plete; this is w here the status o f the com m and lin e b u ffe r is determ ined. L istin g
9-2, Code Sections 1-2, extracted from the ZCPR3 CP, show s the input com m and lin e
processing routine.
The label RSI: is the entry point for processing the next com m and in the
com m and lin e b u ffer. T his point is reached w hen a cold or warm boot occurs and
w hen a routine sim ply issues a R E T instru ction to return to the ZCPR3 CP a fter it has
com pleted its fu n ctio n . RSI: is the principal entry point for com m and processing
w ith in the ZCPR3 CP.
U pon com p letion o f any com m and under ZCPR3, the ZCPR3 CP perform s tw o
fu n ctio n s as it resum es control:
1. reset the DM A address
2. reset the current d irectory
These fu n c tio n s insure that the system is stable and any undesired states le ft by a
process are negated. The process is in vok ed by a subroutine call ("CALL TPA"
in struction, w h ich m ay be translated into a call to some other location i f the com m and
is resolved w ith in the ZCPR3 CP its e lf, w ith in an RCP, or w ith in an FCP) tow ard the
end o f the ZCPR3 CP source. If the process returns to the CP via a sim ple RET
instruction, the com m and a fter this call is a com m and w h ich restores the DM A address.
If the process returns to the CP by m eans o f a warm boot or cold boot, code in the fron t
Chap. 9 Inside th e Z C P R 3 C o m m a n d P ro c e sso r 187
of the ZCPR3 CP also perform s a restoration o f the DM A address. Just after the label
RSI: is a call to the D LO G IN routine w h ich restores the current directory (d efin ed at
memory location 4).
Once this is com plete, the pointer to the next character in the com m and line
buffer is obtain ed (the LH LD N X T C H R in stru ction ) and the com m and lin e from that
point on is cap italized . T his insures C P /M co m p a tib ility (all C P /M com m and lines are
interpreted as upper case) and protects the system in the ad ven t that the com m and line
buffer was m o d ified by the last com m and and the conten t was not cap ita lized in the
process (see the code at CAPBUF: for details).
Now that the com m and lin e is secured, processing resum es at label RS2: by
skipping over space characters and testin g the last non-space character for (1) end of
line and (2) abort. A d d itio n a lly , i f the M ultiple Command L ine B u ffe r is availab le, a
test is made for the com m and separator character (a sem icolon by recom m endation), in
which case the separator is skipped and RS2: is reentered at the character a fter the
separator. The routine at RS2: is exited in one o f tw o directions:
1. to the label RESTRT:, w here a new com m and lin e is input
2. to the label RS3:, w here the next com m and in the current com m and lin e is processed
A new com m and lin e is input into the Command L ine B u ffe r (w hether it is
internal to the ZCPR3 CP or extern al as a M ultiple Com m and L ine B u ffe r) at the label
RESTRT: (see Code Section 1).
A sim ple stack reset occurs at the label RESTRT:, and this is fo llo w e d by the label
RSO:, w h ich is used as an entry point to flu sh com m ent lin es (lin es b egin n in g w ith a
sem icolon).
The fo llo w in g steps are perform ed at the label RSO:
1. Indicate that the ZCPR3 CP is in norm al execu tion mode. T his in d ica tio n is made
to the input service routines by storing a zero valu e in byte 3 o f the ZCPR3
M essage B u ffers. T his m essage is then le ft on unless con d ition s elsew h ere w ith in
the ZCPR3 CP change it, and its purpose is to pass in fo rm a tio n to the process
w h ich is next in vok ed w h ich states that it was in vok ed as a con ven tion al
com m and. T h is m essage m ay be changed b efore the process is fin a lly invoked,
and this change w ill be exp lain ed as this com m entary proceeds.
2. In d icate to Z E X ( if it is running) that the ZCPR3 CP is now prom pting for an
input. T his in d ica tio n is m ade by storing the num ber 1 in byte 7 o f the ZCPR3
M essage B u ffers. On the n ext call to input, i f Z E X is running it w ill see this
m essage and ex it a h ib ern atin g state if it is in one.
3. The pointer to the next character in the com m and lin e is set to the fir st character
p osition and th is byte is zeroed. The storing o f th is zero is m ost im portant should
the in p u t rou tin e be aborted and no input stored in the b u ffer . The zero w ill
mark an end to the input lin e and a resum ption o f control by the ZCPR3 CP.
4. Input the com m and lin e via the R E A D B U F routine. The R E A D B U F routine
accepts a com m and lin e from one o f fou r sources in the order indicated: (1) the
running SUBM IT f ile i f one is in execu tion , (2) the sh ell stack if a com m and lin e
is stored in it, (3) the Z E X m onitor i f it is running, and (4) the user. If the
com m and lin e at the top o f the shell stack is selected , the m essage at Z3MSG+3
188 In sid e ZCPR.3 Sec. 2
Parse (N ext_C om m an d )
The com m and lin e is input and residing in the Com m and L ine B u ffe r at this tim e,
and the tim e has com e to parse the non-em pty com m and lin e a fter the label RS3:. The
code for th is parse is in vok ed by the fo llo w in g sim ple call:
Command L ine. T he ZCPR3 Command L ine can contain one o f several form s of
commands at any one time:
1. The com m and lin e can be em pty
2. The com m and lin e can be a com m ent line: ; com m ent text
3. The com m and lin e can contain one command: com m and
4. The com m and lin e can contain a sequence o f com m ands, separated by
sem icolons: com m and__l;com m and__2 ; . . .
The ZCPR3 com m and consists o f the fo llo w in g general structure:
verb d ir file n a m e .ty p d in filen a m e.ty p text
Exam ples o f ZCPR3 commands:
WS M Y FIL E .T X T
X D IR R O O T :*.T X T
RENAME TE X T: F I L E 1 . T X T = F 1 . TXT
The ZCPR3 CP Parser parses each com m and into b u ffer s as per the fo llo w in g
extended form o f the C P /M CCP parsing standard:
V e r b : The verb is stored in the F ile N am e fie ld o f the E xternal FCB i f one exists.
The F ile T ype fie ld is set to COM. A n y process can determ ine its nam e by exam ining
the F ile N am e fie ld o f the E xternal FCB.
D i r : f i l e n a m e . t y p : The fir st token after the verb is assum ed to be in this general
form at, and it is taken apart as per the C P /M con ven tion and stored in the FCB at
m emory lo cation 5CH. If the p r e fix is DIR: or DU:, the disk referen ce is placed in the
first byte (disk A = 1) and the user area referen ce is placed in the 13th byte (FCB+13),
w hich is the SI fie ld . If the disk is not referen ced , then the fir st byte is set to 0 (at
FCB) to in d ica te the current disk. If the user area is not referen ced , the 13th byte (at
SI) is set to the current user area. T he fie ld at FCB+16 (at DO) is set to zero (a side
e ffe c t o f the general algorithm and not o f general u tility ).
S e c o n d D i r : f i l e n a m e . t y p : The second token after the verb is also assum ed to be in
this general form at, and it is parsed in the same m anner as described for the first
token. A gain , the disk referen ce and user area referen ce are stored in relative
positions 0 (at FCB2) and 13 (at FCB2+13). The fie ld at FCB2+16 (at CR) is zeroed, and
this is sig n ific a n t sin ce it assures that a subsequent open o f the f ile position s the FCB
to the fir st block o f the file .
T a il: The part o f the com m and starting w ith the space d elim iter im m ediately
fo llo w in g the verb is stored into the b u ffe r area starting at 81H. A character count is
190 In sid e Z C P R 3 Sec. 2
stored at 80H, and the byte im m ed iately fo llo w in g the last byte o f the ta il is set to a
binary 0 value. T his is as per the C P /M con ven tion . T his b u ffe r is set during the
CALLPRO G routine as opposed to the PA R SE R routine; PA R SER sim ply saves the
location o f the fir st byte o f the tail.
N o t e 1: I f eith er o f the tw o tokens fo llo w in g the verb are om itted in the com m and,
the f ile nam e and f ile type fie ld s are fille d w ith spaces as per the C P /M convention.
The disk and user areas are z e ro -fille d in this case.
N o t e 2 : In resolvin g the Dir: p r e fix in either o f the tw o tokens, the PARSER
routine can be m ade to scan for D U form s b efore D IR form s or vice-versa. This
provides a m eans o f resolvin g c o n flic ts betw een the tw o form s, such as w hen a disk
nam ed C is av a ila b le and a d irectory nam ed C is also availab le. I f the D U form is
resolved fir st, then a d irectory nam ed C can never be referen ced . I f the D IR form is
resolved fir st, any referen ces to the disk C must in clu d e the user area num ber to
d istin gu ish from the d irectory nam ed C. A password check is also done w hen a DIR:
referen ce is resolved.
R esolve (N ext_C om m an d )
The fin a l step in the m ain ZCPR3 CP fu n c tio n a l loop is the resolution o f the
parsed com m and. The code for this step is show n in L istin g 9-4.
D u ring the execu tion o f the R E A D B U F routine, the m essage at Z3MSG+3 (the
ZCPR3 Com m and Status m essage) was set to a 1 i f the com m and lin e associated w ith a
sh ell was selected . The sam e m essage was cleared to a zero b efore the R E A D B U F
routine was called.
S h ell Com m and. The fir st step in resolvin g a com m and is to see i f the source of
the com m and is the sh ell stack, and, i f so, to proceed to com m and resolu tion for CP-
resident, R C P -resident, and transient com m ands at the label RS4:. T his enables the
shell to be in vok ed regardless o f the F low Command State; i f the F low Com m and State
is FALSE, the ZCPR3 Shell must still be in vok ed so that a com m and lin e can be
presented. If this is not allow ed for, i f the F low Com m and State ever becom es FALSE
during the execu tion o f a shell, the system w ill deadlock. T h erefore, this test for a
shell in v o ca tio n is perform ed im m ediately.
FCP R esolution. If the com m and is not a shell, the com m and scanner is run on the
FCP com m and table. It is im portant that FCP-based com m ands are alw ays execu ted
because they control the Flow Command State. I f a com m and (FCP-based or
otherw ise) ever sets the F low Com m and State to FALSE, the only w ay to set it back to
T R U E is to execu te an FCP-based com m and. T his is w h y the test for an FCP-based
com m and is perform ed b efore the F low Com m and State is checked.
Command Scanner. The Com m and Scanner in the ZCPR3 CP is used to resolve
FC P-based, R C P-based, and ZCPR3 CP-based com m ands. Each o f these are
im plem ented as C o m m a n d P a c k a g e s , w here a package is a co llectio n o f com m ands in
one logical grouping. L ike a package in the Ada program m ing language, a Command
Package in ZCPR3 is d iv id ed into two parts—the v i s i b l e s e c t i o n and the h i d d e n s e c t i o n .
The v isib le section consists o f a table o f com m and nam es and the addresses o f the
routines w h ich im plem ent these com m ands. The h idden section contains the bodies of
the com m ands, w here each com m and acts as a COM f ile w ou ld, extractin g the
in form ation it needs, such as its verb, the two FCBs, and the com m and tail, from the
b u ffers set up by the PA R SE R routine. U n lik e the C P/M CCP, all parsing is done in
one routine, the PA R SE R , and every com m and in the ZCPR3 System acts just as a
C hap. 9 In sid e th e Z C P R 3 C o m m a n d P ro c e sso r 191
DB 0 ; 0 terminates table
CMD1_ADR:
; body of command
RET ; or JMP 0 to end
CMD2 ADR:
• • • ; body of command
RET ; or JMP 0 to end
Flow Command S ta te. R eturning to the m ain train o f thought, the FC P-resident
com m and table has now been scanned. I f a m atch is fou n d , the ZCPR3 CP execu tes the
comm and im m ed iately. I f not, a test is done to determ ine i f the current Flow State is
TR UE. The bytes at Z3MSG+1 (the current IF lev el) and Z3MSG+2 (the A ctiv e IF
indicator) are checked. I f the current IF lev el is 0 (the byte at Z3MSG+1 is zero), then
com m and ex ecu tio n is allow ed and w e proceed. If not, a check has to be done to see
that the current IF lev e l is T R U E . T his is done by A N D in g the bytes at Z3MSG+1 and
Z3MSG+2. The current IF level A N D ed w ith the A ctiv e IF in d icator tells the ZCPR3
CP w hether the current F low Com m and State is T R U E or not. I f not T R U E , the
com m and is flu sh e d and processing is resum ed at R SI. I f T R U E , the com m and
processing resum es at RS4.
A t RS4, a check is m ade to see i f the com m and w as p re fix e d w ith a directory
reference; that is, the form o f the verb was:
DIR:VERB or DU:VERB
If so, the resident com m and check is bypassed and the search for a COM f ile begins
im m ediately. T his featu re allow s the ZCPR3 C P-resident and R C P-resident Command
Packages to be bypassed. If not, a check is fir st done to see i f the com m and is in the
192 In sid e Z C P R 3 Sec. 2
ZCPR3 C P-resident Com m and Package and, i f not, i f the com m and is in the RCP-
resident Com m and Package. F in a lly , i f both o f these tests fa il, a search is done for the
comm and as a COM file .
COM File Processing
N o d escrip tion o f the ZCPR3 Com m and Processor (CP) w ou ld be com plete
w ith ou t a d escrip tion o f the algorithm used to locate and load COM file s. T h is code is
im plem ented near the end o f the CP in Section 51. L isting 9-5, Code Sections 1-3 shows
this code.
The entry point at COM DIR (see Code Section 1 below ) is entered i f a p r e fix is
attached to the verb in the command:
DIR:VERB or DU:VERB
U pon entry at COM DIR, a check is m ade to see i f the com m and nam e (verb) is
blank. If so, then a com m and to log into a new directory was given:
DIR: or DU:
The d irectory referen ce is processed im m ediately. N ote that a check is m ade o f
the selected user area (at FC BD N +13) to ensure that the user area is w ith in range. With
directories under ZCPR3, th irty-tw o user areas (num bered 0-31) can be referen ced , but
only sixteen (num bered 0-15) can be logged into. If the user area referen ce is v a lid , the
directory is logged into and com m and processing is resum ed at RSI.
The resolution o f a COM f ile begins at the label COM: (see Code Section 2). The
TPA is selected as the load address, and the M LOAD routine is called to locate the
COM f ile and load it into m em ory at the load address (w h ich is in HL upon entry to
M LOAD). If M LOAD returns, then the COM f ile has been loaded su ccessfu lly and the
ZCPR3 CP is logged into the current directory. A new lin e is issued, the com m and lin e
tail is stored in the b u ffe r at 80H, the DMA address is set to 80H, and the TPA is called.
Invoking Any Command
Once a com m and has been resolved, regardless i f it is ZCPR3 C P -resident, RCP-
resident, FC P-resident, or tran sient, the routine CA LLPRO G (see Code Section 2) is
used to in vok e it. R C P-resident and transient com m ands are in vok ed at the label
CALLPROG, w h ich issues a new lin e b efore begin n in g, and C P -resident and FCP-
resident com m ands are in vok ed at the label CALLP, w h ich does not issue a new line.
The C A L L PR O G /C A L L P routine is called w ith the execu tion address in HL, and the
fu n ctio n o f CA LLPRO G is as follow s:
1. Set the ex ecu tio n address for a subroutine call.
2. Store the com m and tail into the b u ffe r at 80H. The PA R SER routine m arked the
b eginning o f the com m and tail in the TA ILSV b u ffe r during the parse.
3. Set the DM A address to 80H.
4. Call the routine. If the routine is a transient, a call is m ade to the TPA (100H).
O therw ise, a call is m ade to the address returned by CM DSCAN, the ZCPR3 CP
Command T able Scanner.
C hap. 9 In sid e th e Z C P R 3 C o m m a n d P ro c e sso r 193
5. R estore the DM A address and resume com m and lin e processing at the label R SI.
T h is point is reached i f the com m and routine com pleted w ith a sim ple RET
in stead o f a JMP 0 (Warm Boot) or other technique.
D u ring the execu tion o f M LOAD, i f the COM f ile is not fou n d , then either the
CM D R U N fa c ility w ill be in vok ed or the ER R O R routine w ill be invoked ( if
CM D R U N is not availab le). In the case o f C M D R U N , the entire com m and is passed as
a com m and ta il to the C M D R U N u tility .
P ath A n alysis
The M LOAD routine in the ZCPR3 CP loads a COM file , and, in so doing, it
fo llo w s the Com m and Search Path in searching for the COM file . If the M INPATH
option is not selected , the M LOAD routine sim ply fo llo w s the sym b olic path, resolving
each sym bol as it goes. T his can lead to w asted e ffo r t i f the same directory is
encountered more than once as the path is resolved. For in stance, i f the path is "A$
A15" and the user is logged into A 15, then the path resolves into "A15 A15", and the
directory A15 is logged into tw ice.
The M IN PA TH option elim in ates this poten tial in e ffic ie n c y by passing over the
sym bolic path once, b u ild in g an absolute path into the b u ffe r at M PATH. For each
sym bolic elem ent encountered, M L O A D /M IN PA T H checks to see i f the absolute path
already con tain s that directory referen ce and does not in clu d e it i f such is the case.
When com plete, it is this absolute path w h ich is scanned during the search for the COM
file.
Error H andling
I f the com m and cannot be sa tisfa c to r ily resolved, the ER R O R routine is execu ted
to determ in e how to process the current error con d ition . L istin g 9-6, Code Sections 1-2,
shows the code for the ER R O R processor.
The ER R O R routine fir st term inates any running SUBM IT f ile sin ce, i f there is
one, the $$$.SUB was the source o f the error. It then issues a new lin e and checks to see
if the error was caused by an attem pt to in vok e a shell. If Z3MSG+3 (the ZCPR3
Command Status m essage) is set to 1, then the last com m and was in vok ed as a shell by
the ZCPR3 CP. If the error was caused by trying to in vok e a shell, the shell stack is
cleared (at ER R SH ) and com m and processing is restarted (at RESTR T).
I f a shell was not in v o lv ed , the Error H andler in d icator m essage at Z3MSG is
checked. I f this m essage is non-zero, then an Error H andler w as in stalled . If zero, then
there is no Error H andler and the com m and in error is sim ply echoed fo llo w e d by a
question mark (the C P /M con ven tion ) and the com m and processing is restarted from
scratch (at RESTR T).
If an Error H andler is availab le, then the ZCPR3 Com m and Status m essage (at
Z3MSG+3) is set to 2 to in d ica te that an Error H andler is being in vok ed , the pointer to
the com m and in error is set at Z3MSG+4 and Z3MSG+5 (the error lin e address), and the
com m and lin e at Z3M SG+10H (the Error H andler com m and lin e) is in vok ed as any
other com m and w ould be at R SI. T his, n atu rally, assum es that the Error H andler
its e lf can be resolved. It is best to place all Error H andlers in the ROOT directory (at
the end o f the Com m and Search path) to ensure that the ZCPR3 CP does not enter an
in fin ite loop in tryin g to in vok e a non -existen t Error H andler.
ZCPR3 Command Processor— Wrapup
194 In sid e Z C P R 3 Sec. 2
T his conclu des the tech n ical presentation on the ZCPR3 Com m and Processor
(CP). As the reader has seen, the ZCPR3 CP perform s a high degree o f in teraction w ith
the m essages o f the ZCPR3 System , and all m ust be in tune for the system to work
correctly. O f m ost im portance is that the ZCPR3 m essages must be properly in itia liz e d
at Cold Boot and that all o f the tools must contain a proper pointer to the ZCPR3
E nvironm ent D escriptor in order to fu n c tio n correctly. From the ZCPR3 E nvironm ent
D escriptor, the d etails o f the ZCPR3 System , in clu d in g the ZCPR3 M essage B u ffers,
can be determ in ed , and the tools can adapt them selves to any ZCPR3 System
c o n fig u ra tio n in this m anner.
The fo llo w in g chapters in this section address other key item s in the ZCPR3
System . Em phasis is placed on how various classes o f tools, such as Error H andlers and
Shells, in teract w ith the ZCPR3 System .
ORG CPRLOC
ELSE
< Com m ents om itted >
C hap. 9 In sid e th e ZCPR.3 C o m m a n d P ro c e sso r 195
/•
DS BUFLEN- ( $ -CMDLIN)+ 1 ; TOTAL I S 'BUFLEN' BYTES
NXTCHR:
DW CMDLIN ; POINTER TO COMMAND INPUT BUFFER
/
•
!
ENDIF ;MULTCMD
/;•
t
• * * * * 2 . FILE TYPE FOR COMMAND
COMMSG:
/•
COMTYP ;USE MACRO FROM Z3HDR.LIB
SUBFCB:
DB 1 ;DISK NAME SET TO DEFAULT TO DRIVE A:
DB '$ $ $ ' /F IL E NAME
DB i i
SUBTYP ;USE MACRO FROM Z3HDR.LIB
DB 0 /•EXTENT NUMBER
DB 0 ;si
SUBFS2:
DS 1 ;S 2
SUBFRC:
DS 1 /‘ RECORD COUNT
DS 16 ; DISK GROUP MAP
196 In sid e Z C P R 3 Sec. 2
SUBFCR:
DS 1 ;CURRENT RECORD NUMBER
•
f
ENDIF 7 SUBON
•
/
FCBDN:
DS 1 ;DISK NAME
FCBFN:
DS 8 ;FILE NAME
FCBFT:
DS 3 ;FILE TYPE
DS 1 ;EXTENT NUMBER
DS 2 ;S1 AND S2
DS 1 ;RECORD COUNT
FCBDM:
DS 16 ;DISK GROUP MAP
FCBCR:
DS 1 ;CURRENT RECORD NUMBER
/
ENDIF ;EXTFCB
>
IF LTON
PAGCNT:
DB N LIN ES-2 ; LINES LEFT ON PAGE
•
t
ENDIF ; LTON
ENDIF ; SUBON
RESTRT:
LXI SP,STACK ; RESET STACK
/
; READ INPUT LINE FROM USER OR $ $ $ .S U B
I
RSO:
IF Z3MSG NE 0
XRA A ?SET NO OUTPUT MESSAGE
STA Z3MSG+3 ; ZCPR3 COMMAND STATUS
I NR A ;SET ZCPR3 INPUT PROMPT
STA Z3MSG+7 ;ZEX MESSAGE BYTE
ENDIF ; Z3MSG NE 0
IF Z3MSG NE 0
XRA A ; NORMAL PROCESSING RESUMED
STA Z3MSG+7 ;ZEX MESSAGE BYTE
ENDIF
R S I:
LX I SP,STACK ; RESET STACK
9
CAPBUF:
MOV A,M /CAPITALIZE COMMAND CHAR
CALL UCASE
MOV M, A
INX H ;PT TO NEXT CHAR
ORA A ; EOL?
JRNZ CAPBUF
POP H ;GET PTR TO FIRST CHAR IN LINE
9
RS2 :
CALL SKSP /S K IP OVER SPACES
ORA A /END OF LINE?
JRZ RESTRT
CPI CTRLC /ABORT CHAR?
JRZ RESTRT
•
9
JR RS2
ENDIF ;MULTCMD
«
t
RS3:
SHLD NXTCHR ?SET PTR TO FIRST CHAR OF NEW COMMAND LINE
SHLD CURCMD ;SAVE PTR TO COMMAND LINE FOR ERROR RETURN
READBUF:
CALL CLOSE
JRZ RBI ; ABORT $ $ $ . SUB IF ERROR
CALL PROMPT ; PRINT PROMPT
MVI A,SPRMPT 7PRINT SUBMIT PROMPT TRAILER
CALL CONOUT
LXI H,CMDLIN 7PRINT COMMAND LINE FROM $ $ $ .S U B
CALL PRIN1
CALL BREAK 7CHECK FOR ABORT (ANY CHAR)
RNZ ; I F NO AC, RETURN TO CALLER AND !
CALL SUBKIL ;KILL :$ $ $ . SUB IF ABORT
JMP RESTRT ; RESTART CPR
RBI:
CALL SUBKIL ; ERASE $ $ $ . SUB IF PRESENT
7
ENDIF ; SUBON
•
9
IF SHSTK NE 0
•
9
ENDIF ; SHSTK NE 0
9
IF (SHSTK NE 0) OR (Z3MSG NE 0)
•
/
RUNBUF:
LX I D,CMDLIN 7PT TO FIRST CHAR OF COMMAND LINE
MVI B ,SH SIZ E 7COPY SHELL LINE INTO COMMAND LINE
CALL LDIR ; DO COPY
XCHG ;HL PTS TO END OF LINE
Chap. 9 In sid e th e Z C P R 3 C o m m a n d P ro c e sso r 203
IF Z3MSG NE 0
LDA Z3MSG+3 7GET COMMAND STATUS
CPI 1 7 SHELL?
JZ RS4
ENDIF 7 Z3MSG NE 0
; IF IFON, THEN CHECK FOR RUNNING IF AND FLUSH COMMAND LINE IF ENABLED
•
t
IF IFON
LX I H,Z3MSG+1 ;PT TO IF BYTE
MOV A,M ;GET IT
ORA A ;SEE IF ANY IF
JRZ RS4 .•CONTINUE IF NOT
INX H 7PT TO IF ACTIVE BYTE
ANA M ,'SEE IF CURRENT IF I S ACTIVE
JRZ R SI 7SKIP IF NOT
ENDIF ; IFON
RS4 :
IF RCP NE 0
LXI H,RCP+5 ;PT TO RCP COMMAND TABLE
CALL CMDSCAN .•CHECK FOR RCP
JZ CALLPROG
ENDIF
»•Section 51
»•Command: COM file processing
»•Function: To load the specified COM file from disk and execute i1
»•Forms: ccommand line>
< Comments O m itted >
COMDIR:
IF DRVPREFIX
ENDIF ; DRVPREFIX
206 In sid e ZCPR.3 Sec. 2
; PROCESS COMMAND
/
COM:
9
CALLPROG:
CALL CRLF ; LEADING NEW LINE
CALLP:
SHLD EXECADR ; PERFORM IN-LINE CODE MODIFICATION
JRZ TAIL1
STAX D ; PUT CHAR
INX H ,'PT TO NEXT
INX D
INR B »'INCREMENT COUNT
JR TAIL
TAIL1:
XRA A »•STORE ENDING ZE:
STAX D
POP H »•GET PTR
MOV M, B »•SAVE COUNT
; ERROR PROCESSOR
t
ERROR:
t
ENDIF ; SUBON
ERRO:
•
ENDIF ; Z3MSG NE 0
/•
CURCMD EQU $+1 7POINTER FOR IN-THE-CODE MODIFICATION
LXI H, 0 7PT TO BEGINNING OF COMMAND LINE
Chap. 9 In sid e th e Z C P R 3 C o m m a n d P ro c e sso r 209
ERRlS
MOV A,M ;GET CHAR
ORA A ;END OF LINE?
JRZ ERR2
CALL CONOUT ; PRINT COMMAND CHAR
INX H ;PT TO NEXT CHAR
JR ERR1 »•CONTINUE
ERR2 :
CALL PRINT ;PRINT ' ? '
DB ' ? ' +80H
ERR3 :
JMP RESTRT /•RESTART CPR
A ZCPR3 System Segment is a package or d ata file w hich can be loaded by the
LDR tool into memory fo r use by the ZCPR3 System. There are several types of
ZCPR3 System Segments:
*.ENV E n v iro n m en t Descriptors
*.FCP Flow Com m and Packages
*.RCP R esident Com m and Packages
*.IOP I n p u t/O u tp u t Packages
*.NDR N am ed D irectory D ata Files
*.Z3T T erm inal (TCAP) D ata Files
Environment Descriptor
The m ain purpose of the E nvironm ent D escriptor is to provide in fo rm a tio n about
the ZCPR3 System environm ent to the ZCPR3 tools in a convenient, transportable
form so th a t the tools can be moved fro m one ZCPR3 System to an o th er at the binary
level. The only installation requirem ent fo r tra n s p o rta b ility is th a t the toolset be
installed via the Z3INS tool; this process takes less th a n five m inutes fo r the
installation of over 70 tools. The ZCPR3 E nvironm ent D escriptor, w hich includes a
Z3TCAP e n try fo r the user’s term inal, provides a sig n ific a n t extension over the
conventional C P /M facilities fo r porting programs at the b in a ry level from one
computer system to another.
Flow and Resident Command Packages
Like the package fe a tu re of the Ada program m ing language, a Com m and Package
is divided into two parts: the visible section, w hich defines the names and addresses of
the com mands in the package, and the hidden section, w here the commands are
implemented. Both Flow Com m and Packages and R esident Com m and Packages are
written in the same general form at:
DB ' Z3xCP1 ; Z3RCP f o r R e s i d e n t C om m and P a c k a g e
; Z 3F C P f o r F l o w C om m and P a c k a g e
DB NAME_SIZE ; n u m b e r o f c h a r a c t e r s i n com m and nam e
DB ' CMD1' ; n a m e o f c o m m a n d (NAME_SIZE c h a r s l o n g )
DW CMD1_ADR ; a d d r e s s o f com m and
• • •
DB 0 ; end o f ta b le
CMD1_ADR:
• • • ; c o d e w h i c h i m p l e m e n t s com m and
RET ; s i m p l e RET i n s t r u c t i o n i s a d e q u a t e
; w h en com m and i s c o m p l e t e d
The ro u tin e CMDSCAN in the ZCPR3 CP searches for com mands stored in these
packages and selects routines contained therein fo r execution. The resident commands
inside the ZCPR3 CP are also in the form of a com m and package, and they are
resolved in the same way.
212 In sid e Z C P R 3 Sec. 2
Input/Output Packages
I n p u t/O u tp u t Packages (IOPs) execute in conjunction w ith the low-level,
ch aracter-oriented in p u t /o u tp u t routines in the BIOS. The BIOS simply directs its
calls fo r console, list, punch, and reader in p u t/o u tp u t to the routines in the c u rren t
IOP fo r execution.
CP/M Redirectable Input/Output
Redirectable Input/Output refers to the ability of the user to sw itch between
various I n p u t/O u tp u t devices d u rin g the course of a session.
C P /M supports fo u r logical I /O devices: a console, a p rin ter, a reader, and a
punch. Each of these f o u r logical devices may have any one of fo u r physical devices
assigned to it, giving the user up to sixteen physical devices. The I /O Byte (at memory
location 3) is used to specify the assignment of physical to logical devices. For f u r th e r
details, r e fe r to the discussion of I /O in C hapter 2.
By using the STAT command, the C P /M user may change these assignments from
time to tim e w ith o u t actually changing the h a rd w a re co n fig u ra tio n of his system. For
instance, my system comes up w ith the CRT as the prin cip al console device. I f I so
wish, how ever, I can assign my p rin tin g term inal as the console by issuing the
com mand "STAT CON:=TTY:"; I then enter all my com mands at the p rin tin g term inal
keyboard and, w hen finished, move back to the C R T by issuing the com m and "STAT
CON:=CRT:".
ZCPR3 Redirectable I/O System
U n d er ZCPR3, a slightly d if f e r e n t scheme fo r red ire ctab le I /O has been
im plem ented. However, the im plem enter has the choice of continuing to use the C P/M
scheme or of sw itching to this new one.
When a ZCPR3 system cold boots, the BIOS, as loaded fro m the system tracks of
the disk, contains only a few p rim itive I/O drivers. The C R T physical device is
assigned to the console, reader, punch, and list logical devices; thus all o u tp u t goes to
the CRT. No red ire ctio n is perm itted at this time.
The BIOS is stru c tu re d so th a t all the I/O entries in its jum p table branch to
corresponding entries in a second jum p table (which is in itia lize d by the Cold Boot
Routine). This second jum p table is placed on a page b o u n d ary at the beginning of a
scratch area. It is in this scratch area th a t the physical device drivers fo r the system
reside. It is recom m ended th a t this scratch area be approxim ately 2K in size, to perm it
m axim um flexibility. F igure 10-1 shows this new BIOS layout in memory.
What the Redirectable I/O System Buys You
As the reader can see, C P /M com patibility is m a in tain ed in th a t there are still
only the fo u r s ta n d a rd logical devices: Console (CON:), P rin te r (LST:), R ead e r (RDR:),
and Punch (PUN:). What the reader may not see yet is th a t the restriction of assigning
only fo u r physical devices to each of these logical devices is now gone, as well as the
rath e r obscure names given by C P /M to the physical devices (such as U R I:, UC1:,
BAT:, etc).
The advan tag e of this system is th a t it does not restrict the designer to the I/O
Byte s tru ctu re d e fin e d by D igital Research. Instead, the designer can stru c tu re the
I/O Byte any w ay he chooses or even select a d if f e r e n t structure, such as a 2-byte I/O
Word, to control his redirectable I/O .
Chap. 10 In sid e th e Z C P R 3 S y ste m S egm ents 213
1) STATUS Tells the calling program how m any physical devices are available fo r the
CON:, LST:, RDR:, and PUN: logical devices and w hich physical device is
cu rren tly assigned to each of the logical devices
Count Assignment
Device Byte Number Byte Number
CON: 0 1
RDR: 2 3
PUN: 4 5
LST: 6 7
Code Example:
STABLE:
DB 6,2 6 Devices, Device (3rd Device)
Assigned to CON:
DB 0,0 No RDR: Devices
DB 0,0 No PUN: Devices
DB 10,5 10 Devices, Device (6th Device)
Assigned to LST:
The SELECT routine assigns a physical device to a logical device. It is called with
the logical device num ber (where CON: is 0, RDR: is 1, PUN: is 2, and LST: is 3) in the
B Register and the physical device num ber in the C register. SELECT retu rn s with the
Zero Flag Set (Z) if an invalid selection was made (such as B > 3 or C > max device
number). Example:
MVI B,0 ;Select CON:
MVI C, 4 »•Physical Device 4
CALL IOBASE+3 /•SELECT Routine
JZ DEVERR ;Error Handler
MVI B,3 /•Select LST:
MVI C ,2 /•Physical Device 2
CALL IOBASE+3 /•SELECT Routine
JZ DEVERR ;Error Handler
F inally, the N AM ER routine retu rn s to the caller a text string (a vector of ASCII
characters te rm in ated by a bin a ry 0) th a t describes the physical device requested. On
input, B contains the logical device num ber and C contains the physical device num ber
(as in the SELECT routine). On output, HL points to the string and the Zero Flag is Set
(Z) if an in v a lid selection was made. This re tu rn e d text string contains the mnemonic
name of the device (up to eight characters long) followed by a space and any desired
text w hich describes the attrib u tes of the physical device. Example:
MVI B,0 /•Select CON:
216 In sid e Z C P R 3 Sec. 2
The E nv iro n m en t D escriptor contains the starting address of the memory image
for the N D R file and the num ber of 18-byte entries it contains.
TCAP Data Files
The *.Z3T overlays the second h a lf of the ZCPR3 E n v iro n m en t D escriptor w ith a
data entry e x tra cted fro m the Z3TCAP.TCP file or w ith an e n try created by the
TCMAKE command. The s tru ctu re of this d ata file is described elsewhere in this
book. The TCAP e n try is a p a rt of the ZCPR3 E nvironm ent D escriptor; fo r this reason,
the LDR com m and should load a *.Z3T file after it has loaded the *.ENY file. If the
*.Z3T file is loaded first, it will be overlaid by the *.ENV file and its e ffe c t will be
lost.
218 In sid e Z C P R 3 Sec. 2
Chap. 11 In sid e th e Z C P R 3 S y ste m S egm ents 219
The operation o f the ZCPR3 System is dependent upon the ZCPR3 Message
Buffers located at the symbol Z3MSG in the Z3BASE.LIB file. The messages are used
in so many d iff e r e n t contexts by several d iff e r e n t types o f ZCPR3 tools that the total
picture is som ew hat d i f f i c u lt to see. For this reason, the fo llo w in g is presented to
summarize the contents and application o f the ZCPR3 Message B u ffers. The follow ing
figure summarizes the ZCPR3 Message Buffers:
O ffset from Z3M SG F u n ction
0 Error Flag (Error Handler)
1 IF (Current IF Level)
2 IF A ctive
3 ZCPR3 Command Status
4-5 Error Address (for Error Handler)
6 Program Error Code
7 Z E X Message Byte
8 Z E X R unning Flag
9-10 Address o f N ext Z E X Char
11-12 Address o f First Z E X Char
13 Shell Control Byte
14-15 Shell Scratch
10H-2FH Error Command Line
30H-39H Registers
3AH -3FH Reserved
40H -4FH U se r-D efin ed
Error Handler Messages
The E r r o r F l a g at Z3MSG+0 is used to indicate i f an Error H andler is enabled. If
this flag is 0, there is no Error Handler; i f this fla g is not zero (OFFH), there is an Error
Handler, and the E r r o r C o m m a n d stored at Z3MSG+10H to Z3MSG+2FH (32 bytes
allowed, in clud ing term inating zero) is the command line executed when the ZCPR3
CP executes an Error Handler.
Both the Error Flag and Error Command are set by an Error Handler and read by
the ZCPR3 CP as required.
IF Messages
The I F message at Z3MSG+1 and the I F A c t i v e message at Z3MSG+2 are used to
indicate the number o f the current IF level and the Flow Command State at that and
all preceding levels. The IF message has either no bit set (w hich indicates that no IF is
active) or one bit set (w hich indicates w h ich IF level is active). Eight levels o f active
IFs are permitted. Bit position 0 indicates IF level 1 and bit position 7 indicates IF
level 8. The IF A c tiv e message indicates the Flow Command State o f each o f the eight
IF levels, and it tracks on a one-to-one relationship w ith the IF message.
The IF message assigns an IF level to each bit, and only one bit is set to indicate
which IF level is currently active:
220 In sid e Z C P R 3 Sec. 2
The IF A c tiv e message is used to hold the states o f all IF levels up to and
in clud ing the current one:
The fo llo w in g exam ple illustrates how the two IF message bytes work together:
ZEX Control
The message at Z3MSG+9 and Z3MSG+10 is the address o f the next character in
the ZEX m emory-based f il e image w h ich w ill be returned by Z E X on the next BIOS
console input call. The message as Z3MSG+11 and Z3MSG+12 is the address o f the
first character o f the Z E X memory-based f ile image, where the f ile im age is stored in
sequence from high memory to low memory.
These two messages are used to control the execu tion flo w o f commands under
ZEX. The GOTO command, for example, w ill search the Z E X m emory-based file
image for the label referenced in the command starting at the address o f the first
character (in Z3M SG +11 and Z3MSG+12) and, i f found, w ill set the address o f the next
character for Z E X processing in the message at Z3MSG+9 and Z3MSG+10. The end of
the Z E X m emory-based f ile image is flagged by a byte o f value OFFH.
Shell Control Byte
The S h e l l C o n t r o l B y t e is located at Z3MSG+13, and it is set by Shells and other
tools to control the features o f the Shell execution. The fo llo w in g convention has been
adopted for the usage o f this message:
Bit 0 set Shell to comment mode
Bit 1 have Shell echo the command lines it builds
Bit 7 have Shell w ait upon entry before execution
The use o f other bits is open to the discretion o f the designer.
Shell Scratch
The S h e l l S c r a t c h messages are at Z3MSG+14 and Z3MSG+15. Their use is
u n d efin e d and le ft open to the Shell designer.
Registers
The R e g i s t e r s are located from Z3MSG+30H to Z3MSG+39H. These are 10 one-
byte registers w h ich may be used to store any values desired. The REG tool can
directly set their values, and the IF tools can test them.
Reserved Messages
The messages from Z3MSG+3AH to Z3MSG+3FH are reserved for the ZCPR3
System designer (R ichard Conn) and should not be used by any other person. This will
leave an opening for futu re expansion o f the ZCPR3 System.
U ser-D efin ed Messages
The messages from Z3MSG+40H to Z3MSG+4FH are available for user d e fin itio n
and may be used for any purpose desired by the softw are designer.
Inside Z C P R 3 Sec. 2 223
12 Inside ZEX
BIOS
BDOS
Normal Ptr ->
to BDOS ZCPR3 Command Processor
ZEX Monitor
Command File
I Buffers
Low Memory -> ---------------------------------
Monitor. Operations w ith the ZEX Monitor, such as suspending its operation, enabling
its operation, in form in g it that a command prompt has appeared, and changing its
execution flo w w ith in the command f ile are possible by means o f these messages. The
messages w h ich a f f e c t the Z E X Monitor are summarized in the fo llo w in g table:
O ffset from Z3M SG F u n ction
7 Z E X Message Byte
8 Z E X R unning Flag
9-10 Address o f N e x t Z E X Char
11-12 Address o f First Z E X Char
ZEX Message
The Z E X Message byte is used to pass control in form ation to the Z E X Monitor if
it is in operation. This byte can have one o f three values:
0 normal operation
1 a ZCPR3 prompt has appeared
2 suspend Z E X Monitor activity
The Z E X Monitor provides input characters w h enever a BIOS console input call is
made. The ZCPR3 prompt message is used to tell ZEX that comm and line input is
being requested. The Z E X Monitor w ill leave a suspended state i f it is in one at this
point and provide input to the command line w ith whatever special command line
processing is needed to be done. The command to suspend Z E X Monitor a c tiv ity tells
Z E X to stop providing input characters and allow input to come from the console.
This state continues until the ZEX Message byte is set to some other value.
The Z E X Message byte is set by the ZCPR3 CP when it prompts for input from the
console and after this input is accepted. The ZE X Message byte should be set by any
ZCPR3 Shell as it w ould be by the ZCPR3 CP, and it may be set by any other tool.
ZEX Running Flag
The message at Z3MSG+8 is the Z E X R unning Flag, and it is set by Z E X to a non
zero value to ind icate that the Z E X Monitor is in operation. When the Z E X Monitor
terminates, it resets this message to zero.
ZEX Control Messages
The message at Z3MSG+9 and Z3MSG+10 is the address o f the next character in
the Z E X memory-based f ile image w h ich w ill be returned by Z E X on the next BIOS
console input call. The message as Z3MSG+11 and Z3MSG+12 is the address o f the
first character o f the ZEX memory-based f ile image, where the f ile image is stored in
sequence from high memory to low memory.
These two messages are used to control the execution flo w o f commands under
ZEX. The GOTO comm and, for exam ple, w ill search the ZE X m emory-based f ile
image for the label referenced in the command starting at the address o f the first
character (in Z3M SG +11 and Z3MSG+12) and, i f found, w ill set the address o f the next
character for Z E X processing in the message at Z3MSG+9 and Z3MSG+10. The end of
the Z E X mem ory-based f il e image is flagged by a byte of value OFFH.
Chap. 13 In sid e Z E X 225
Shell
A S h e l l is a special type o f tool under ZCPR3. It should generally conform to the
rules of a ZCPR3 tool (see the chapter on ZCPR3 Tools). A Shell performs one o f two
basic fu n ction s w hen it executes: (1) it installs itse lf or (2) it perform s its shell-
oriented fu n c tio n , accepting commands from the user and generating command lines
for the ZCPR3 CP to execute.
Shell S e lf-In sta lla tio n
When a Shell installs itself, its primary m ission is to push a command line onto the
Shell Stack. The ZCPR3 Environm ent Descriptor contains a pointer to the Shell Stack;
if there is no Shell Stack available (the value o f the pointer is zero), then the Shell
cannot fu n c tio n and should so indicate.
In pushing its comm and line onto the Shell Stack, a Shell can determ ine its name
from the External FCB. It should also in itialize any message b u ffer s it wants to use to
communicate w ith its e lf between invocations. There are several sets o f buffers
available w ith w h ich to do this.
At location Z3MSG+13 is a Shell Control Byte. It is structured as follows:
Bit 0 Enable Shell Comment
Bit 1 Enable Shell Echo
Bits 2-6 U se as Desired
Bit 7 Enable Shell Entry Wait
It is recom m ended that im plem entations o f Shells adhere to the indicated usage of
these bits. Their m eanings are described below.
Enable Shell Comment. The Shell should run in a comment mode when this bit is
set (if appropriate). All inputs should be flushed as comments rather than handed to
the ZCPR3 CP for processing unless preceded by a command escape character (which
is recommended to be the exclam ation mark). R efer to the description o f the Shell
named SH for an example.
Enable Shell Echo. The Shell should print the command line it builds to pass to
the ZCPR3 CP i f this bit is set.
Enable Shell Entry Wait. If this bit is set when the Shell is invoked by the ZCPR3
CP, the Shell should print a prompt to the user and w ait for his response before
resuming execution. The purpose o f this feature is to give the user time to look at the
results o f the last command executed before the Shell comes into play, possibly wiping
out the previous display (as when the Shell is screen-oriented).
Locations Z3MSG+14 and Z3MSG+15 are reserved for use by Shells. This usage is
undefined, but one intended application is to make a note o f the disk and user area the
user was in at the time the Shell exited to run a command line.
Other u sefu l b u ffer s for Shell-oriented messages are the registers at Z3MSG+30H
to Z3MSG+39H and the System-Wide File Names in the E nvironm ent Descriptor.
Some u sefu l Shell-oriented Z3LIB routines are:
GETSH2 determ ine i f a Shell Stack is available
QSHELL determ ine i f the process was invoked as a Shell
PUTSH M put values to Shell messages at Z3MSG+13 to Z3MSG+15
226 In sid e Z C P R 3 Sec. 2
the command. N ote that this command is term inated either by a binary zero (0) or a
semicolon
U s e fu l Z3LIB routines are:
E R R A D R get address o f command in error
GETCLn get data on the command line b u ffe r
Chap. 15 In sid e th e Z C P R 3 E rro r H a n d lers 229
Every ZCPR3 tool (COM file ) for a particular ZCPR3 System installation has the
same basic internal structure. There are two basic types o f tools: (1) those with
external Environm ent Descriptors and (2) those w ith internal Environm ent
Descriptors. The ZCPR3 System tools are distributed w ith external Environm ent
Descriptors, and this is the recommended configuration.
If a ZCPR3 tool uses an external Environm ent Descriptor, its internal structure is
as follows:
100H:
JMP START_OF_TOOL •
/ JMP to executable code
DB 1Z 3ENV' / Environment Descriptor
•
START_OF_TOOL:
... ; executable code
The Z3INS (ZCPR3 Installation) tool installs a ZCPR3 tool w h ich uses an external
Environment Descriptor by setting the pointer to the E nvironm ent Descriptor at
Z3EADR. Z3INS obtains the address o f the external Environm ent Descriptor from the
SYS.ENV f ile that is sp e c ifie d to it at execution time.
If a ZCPR3 tool uses an internal Environm ent Descriptor, then its internal
structure is as follows:
100H:
Z3EADR:
JMP START_OF_TOOL
DB 'Z3ENV
DB 0 ; Internal Env Desc
< Environm ent Descriptor >
START_OF_TOOL:
... ; executable code of tool
The body o f the tool can contain whatever code is necessary to perform the
function desired. In order to fa ll in line w ith the philosophy o f the ZCPR3 System, it
is recommended that all ZCPR3 Tools observe the fo llo w in g conventions:
1. The command invocation form o f a tool is:
verb argl arg2 ... option
230 In sid e Z C P R 3 Sec. 2
Installation
This section o f the book is devoted to the topic o f installing a ZCPR3 System,
which includes the ZCPR3 Command Processor, the System Segments, and the ZCPR3
Toolset. K n ow led ge o f assembly language and the basic programming concepts of
CP/M is required to f o llo w this section o f the book.
231
232 In s ta lla tio n Sec. 3
In stallatio n Sec. 3 233
Introduction
Installation o f ZCPR3 (unless you have the commercial product, Z3-DOT-COM) is
an involved process, and the installer must have a working know ledge o f the
following:
1. 8080 and Z80 assembly language programming
2. C P /M 2 .2
3. the C P /M SYSGEN procedure
Fortunately, Echelon, Inc. supplies a version o f ZCPR3 called Z3-DOT-COM that
is extremely simple to install on your system —a submit f ile does nine-tenths of the
work for you, and w h ile this is running, the installation program reports successful
installation o f all the major command processors, buffers, and utilities. Once the main
installation has completed, a simple command causes the installation program to install
the extended command processor ZEX, using the environm ent descriptor generated by
the main installation pass. These procedures can be perform ed even by a person with
minimal know ledge o f C P /M and assembly language programming.
Nevertheless, to get fu ll use o f Z3-DOT-COM, and to adapt it to your own needs
and preferences, you w ill require inform ation provided in this section. It is therefore
strongly recom m ended that, when you have become fam iliar w ith the operation and
major features o f Z3-DOT-COM, you carefu lly read this section so that you w ill be
able to install new features and change existing tools to suit your preferred working
habits.
Three parts o f the system must be created or in itialized during the installation
process:
1. the O p e r a t i n g S y s t e m or S Y S G E N i m a g e , w h ich is present on the system tracks for
most computers and includes a disk boot, the ZCPR3 Command Processor, the
C P/M 2.2 BDOS or ZRDOS, and a m o d ified BIOS.
2. the ZCPR3 S y s t e m S e g m e n t s , w h ich are independent file s that may be loaded
from disk into the appropriate places in memory by the ZCPR3 u tility named
LDR.COM
3. the various ZCPR3 u t i l i t i e s , each o f w hich has to be provided w ith the address of
the ZCPR3 E nvironm ent Descriptor
The ZCPR3 System is tied together by the ZCPR3 Environm ent Descriptor, which
is a set o f b u ffer s that passes inform ation between all elem ents o f a ZCPR3 System.
The ZCPR3 E nvironm ent Descriptor contains inform ation such as the addresses
of the System Segments, the addresses o f several b u ffer s w h ich are sig n ific a n t to
ZCPR3, data on w hat ZCPR3 resources are available, and inform ation about the
physical attributes o f some o f the in p u t/ou tp u t devices connected to the system (such
as the number o f columns and lines on the CRT screen).
Operating System Memory Images
The installer must build a proper SYSGEN Memory Image o f the target ZCPR3
System (the t a r g e t o p e r a t i n g s y s t e m is the system being built, as opposed to the h o st
o p e r a t i n g s y s t e m w h ich is the system used to build the target system). In building the
234 In s ta lla tio n Sec. 3
target system, the ZCPR3 Command Processor must be assembled and a BIOS
containing a m o d ified Cold Boot routine must be prepared.
System Segm ents
The installer must select and assemble the various ZCPR3 System Segments to be
used in conjunction w ith the target ZCPR3 System. A S y s t e m S e g m e n t is a f ile that is
loaded into a f ix e d location in memory by the LDR.COM utility. Each System Segment
remains m em ory-resident until a new System Segment is loaded over it. D epend ing on
the commands issued, the ZCPR3 Command Processor or a ZCPR3 u tility may call
upon a loaded System Segment to perform a fu n ction or provide inform ation.
All System Segments must be in itialized by the Cold Boot routine in the BIOS of
the target ZCPR3 System. This in itialization consists of zeroing out the first N bytes
o f each segm ent’s memory b u ffer , where N depends upon the segment being
initialized.
The fo llo w in g are the System Segments w h ich are supported by ZCPR3. Each
System Segment has a d istin ctive f ile type, and LDR.COM recognizes this and loads
each segment d iffe r e n tly .
S e g m e n t F ile T y p e F u n ctio n o f S y s t e m S e g m e n t
*.ENV Environm ent Descriptor, in clud ing a TCAP
*.Z3T ZCPR3 TCAP Entry
*.FCP Flow Command Package
*.IOP Inpu t/O utpu t Package
*.NDR Nam ed Directory File
*.RCP R esident Command Package
A p a c k a g e , as referred to above, is a set o f executable subroutines w h ich is
d ivid ed into two parts: the visible section, through w h ich an in terface to the routines
is provided, and the hidden section, w h ich contains the code o f the routines. As a
System Segment, a package can be loaded d ynam ically any time during a terminal
session by running the LDR.COM utility.
Flow Command P ackages. A F l o w C o m m a n d P a c k a g e is a package w hich
implements the ZCPR3 flo w commands. These commands are IF, ELSE, FI (same as
EN DIF), and X IF (exit all IFs), and their fu n c tio n is to control the f lo w o f command
execution by setting the F l o w S t a t e to T R U E or FALSE. If the F low State is T R U E , all
commands are allow ed to execute; i f the Flow State is FALSE, only Flow Commands
(IF, ELSE, FI, and X IF) are allow ed to run.
An exam ple o f a comm and sequence containing flo w commands is:
IF EXIST MYFILE.TXT
TYPE MYFILE.TXT
ELSE
ECHO MYFILE.TXT DOES NOT EXIST
FI
Input/O utput P ackages. An I n p u t / O u t p u t P a c k a g e is a package w hich contains a
set o f in p u t/o u tp u t drivers. An I/O Package provides the low -level d evice drivers,
referenced by the BIOS, that support console in p u t/ou tp u t, list output, punch output,
and reader input. Any I/O Package can support many more console, list, punch, and
Chap. 16 O verview of Z C P R 3 In s ta lla tio n 235
reader devices than the standard C P/M I/O byte; further, the package loaded at start
up can be replaced w ith a d iffe r e n t package that supports a d iffe r e n t set o f physical
devices, m erely by running the LDR.COM utility.
Resident Command Packages. A R e s i d e n t C o m m a n d P a c k a g e is a collection of
memory-resident commands that supplement the commands resident w ithin the
ZCPR3 Command Processor itse lf (the Z C P R 3 - R e s i d e n t C o m m a n d s ) . These commands
replace a number o f COM file s by one *.RCP file; because they are memory-resident,
they execute very quickly w ithout any need for additional disk accesses. When the
user issues a command, the current RCP is checked for a match o f the command before
a disk access is perform ed to search for a m atching COM file. For a fu ll description of
the process, refer to the section on "Command Search Hierarchy" in Chapter 2.
Environment Descriptor. The Z C P R 3 E n v i r o n m e n t D e s c r i p t o r is a data f ile that
contains in form ation on several attributes o f the ZCPR3 System. A d d ition ally, the
Environment Descriptor contains a Z C P R 3 T C A P ( T e r m i n a l C a p a b i l i t i e s ) entry that
describes various attributes o f the console CRT, such as the sequence o f characters to
cause its screen to clear or to position its cursor.
ZCPR3 Named Directories. The Z C P R 3 N a m e d D i r e c t o r y f ile contains data
relating a m nem onic, such as PASCAL or ROBERT, w ith a Disk and User Area (a
logical directory). U nder ZCPR3, either D is k /U s e r (D U ) form s or N am ed Directories
can be used to refer to logical directories:
DIR A15: DIR ROOT:
U tilitie s
To be used e f f e c t i v e l y as a part o f a ZCPR3 System, all ZCPR3 utilities must be
initialized to contain either (1) a pointer to the ZCPR3 E nvironm ent Descriptor (if
such a descriptor is available as a System Segment) or (2) the ZCPR3 Environm ent
Descriptor itself.
The ZCPR3 u tility Z3INS.COM performs this initialization. Z3INS.COM will
install a group o f u tilities w ith the required inform ation very quickly and make this
process relatively painless. Z3INS.COM itse lf does not need to be installed but can be
for the sake o f consistency.
O ther Basic Concepts
For a general description o f ZCPR3 basic concepts, refer to Chapter 2. In this
section, we give only technical inform ation required for installation or m od ification
of the system.
Command Search Path. The C o m m a n d S e a r c h P a t h is a b u ffe r w h ich contains an
expression (in the form o f byte pairs) o f the sequence o f directories to exam ine when
the ZCPR3 Command Processor searches for a COM file. It is recom m ended that this
b u ffer be placed outside the ZCPR3 Command Processor (be enabled as an E x t e r n a l
P a th ) so that the ZCPR3 utilities may readily access and m o d ify it.
The elem ents o f a Command Search Path are byte pairs. The first byte indicates
the disk, and the second byte indicates the user area, on w h ich to search. The value of
the first byte may be in the range 1-16 to indicate disks ’A ’ to ’P’, or the character to
indicate the current disk. The value o f the second byte may be in the range 0-31 to
indicate user areas 0 to 31, or the character to in dicate the current user area.
C u r r e n t D i s k and C u r r e n t U s e r A r e a refer to the disk and user area logged in at the time
236 In s ta lla tio n Sec. 3
the command was execu ted by the ZCPR3 Command Processor. A value o f 0 in the
first byte o f a byte pair indicates the end o f the Command Search Path.
The f o llo w in g is a sample Command Search Path expression:
DB '$',0 •
t Current disk, user area 0
DB 1, '$' / Disk A, current user area
•
DB 1,15 •
t Disk A, User Area 15
DB 0 •
/ End of Path
SYSGEN Memory Images
The SYSGEN memory images o f a conventional C P /M system and a ZCPR3-based
system are presented in Figure 16-1. The actual addresses o f the various components
may vary from system to system, and the installer should make a note o f the starting
address o f each com ponent in the target system.
Address CP/M Image ZCPR3 Image
System Segments
Installation o f the ZCPR3 System Segments involves selecting the features o f the
segments and then assembling each segment in turn. It is recom m ended that the MAC
assembler o f D igital Research or ZAS assembler o f Echelon be used to perform these
assemblies.
The ZCPR3 Environm ent Descriptor (*.ENV file ) is created by assembling the file
SYSENV.ASM. D u ring this process, the file s Z3BASE.LIB and SYSENV.LIB are read in
and used by the assembler. Z3BASE.LIB d efin es the memory con figu ration o f the system
and makes up most o f the environm ent descriptor inform ation. SYSENV.LIB contains
additional details on the system.
The ZCPR3 TCAP file s (*.Z3T) are created by running the TCSELECT or TCMAKE
programs. TCSELECT allows the user to select his terminal from a list o f predefined
terminals, w h ile TCM AK E allows the user to d e fin e the attributes o f his terminal directly.
TCMAKE is for users whose terminal does not appear in the standard Z3TCAP.TCP file.
Flow Command Packages (*.FCP) are created by assembling SYSFCP.ASM. During
this process, the file s Z3BASE.LIB and SYSFCP.LIB are read in and used by the assembler.
SYSFCP.LIB d e fin e s the features supported by the Flow Command Package being created.
Input/Output Packages (*.10?) are created by assembling SYSIOP.ASM. D uring this
process, the f ile Z3BASE.LIB is read in and used by the assembler. All features o f the I/O
Package are hard-coded into the source o f the package.
Resident Command Packages (*.RCP) are created by assem bling SYSRCP.ASM.
During this process, the file s Z3BASE.LIB and SYSRCP.LIB are read in and used by the
assembler. SYSRCP.LIB d efin es the features supported by the R esident Command
Package being created.
Named D irectory Files (*.NDR) are created in one o f two ways: (1) by assembling the
file SYSNDR.ASM or (2) by running the MKDIR.COM ZCPR3 utility. MKDIR.COM
allows the user to dynam ically edit and create new named directory structures while
online.
Utilities
The installation o f most o f the ZCPR3 u tilities involves setting up a f ile containing
the names o f the utilities to be installed and running the Z3INS.COM ZCPR3 u tility on an
Environment Descriptor and this file. Z3INS w ill install each u tility named in the file
with the inform ation it needs from the Environm ent Descriptor.
All ZCPR3 utilities may be installed in this way. In an earlier release o f ZCPR3,
ZEX 3.0 could not, but version 3.1 o f Z E X can, so all ZCPR3 tools are now installed via
Z3INS.
Installation Steps
The installation process for ZCPR3 involves these steps:
1. Selecting the features desired for the target ZCPR3 System
2. Planning the memory structure o f the target ZCPR3 System (the f ile
Z3BASE.LIB is created)
3. M odifying the Cold Boot routine in the BIOS o f the target ZCPR3 System
to in itialize the selected features w h ich require in itialization
4. Enabling the desired features in the ZCPR3 Command Processor (the file
Z3HDR.LIB is created)
5. Overlaying the CCP w ith ZCPR3 and the old BIOS w ith the new BIOS in the
238 In s ta lla tio n Sec. 3
SYSGEN Image
6. Placing the new SYSGEN Image onto the Operating System tracks o f the disk
7. Selecting the options for the desired System Segments and creating the System
Segments
8. Installing the desired ZCPR3 u tilities
Required Hardware
Hardware Required for Installation. The hardware requirements for the
installation o f ZCPR3 are as follows:
C P /M 2.2 - based system (or ZCPR3 - based system)
8080 or Z80 microprocessor
32K bytes o f memory
110K bytes o f disk space for source, BAK, and H E X files
computer terminal
Hardware Required for Running ZCPR3. The hardware requirements for running
ZCPR3 are:
ZCPR3 - based system
Z80 microprocessor
48K bytes o f memory
110K bytes per disk (recommended minimum)
computer terminal
Components of an Operational ZCPR3 System
Figure 16-2 shows an operational ZCPR3 System. The memory image, system
segments, and utilities are b r iefly discussed from an installation v iew p o in t in the
remainder o f this chapter.
Memory Image. The memory image in figure 16-2 shows the memory structure o f a
ZCPR3 System w hich includes all o f the major features.
Notes:
1. All Areas A bove E400H are in itia lize d by the Cold Boot R ou tin e in the BIOS
2. Those Areas marked w ith (S) are ZCPR3 System Segments
System Segm ents
Z3BASE1.LIB The System Segments used in this system are provided in the
Z3BASE2.LIB distribution file s o f ZCPR3. The ZCPR3 System shown here is
Z3HDR1.LIB d e fin e d by the f ile Z3BASE1.LIB, and a much smaller system
Z3HDR2.LIB w h ich does not include the Resident Command Package,
Inpu t/O utpu t Package, and Flow Command Package features
(only IK o f additional overhead) is d e fin e d in Z3BASE2.LIB.
Associated w ith each o f the two Z3BASEn.LIB file s is a
Z3HDRn.LIB f ile w hich d efin es the features o f the ZCPR3
Command Processor.
C hap. 16 O verview o f Z C P R 3 In s ta lla tio n 239
SYSIOP.ASM The Inpu t/O utpu t Package used in conjunction w ith this system
is contained in the f ile SYSIOP.ASM.
SYSRCP.ASM Four RCPs are used in conjunction w ith this system; they are
SYSRCP1.LIB d e fin e d by the four SYSRCPn.LIB files (n is between 1 and 4).
SYSRCP2.LIB Each RCP contains a d iffe r e n t set o f commands w ith a
SYSRCP3.LIB d iffe r e n t set o f options enabled for the includ ed commands.
SYSRCP4.LIB
U tilities. Over 70 u tilities are associated w ith the ZCPR3 System. Each utility
uses features o f the system, in clud ing named directory references, access to the
various system segments, access to the TCAP fa c ility , and access to all o f the data
elements in the ZCPR3 Environm ent Descriptor that it needs. The ZCPR3
Environm ent Descriptor is the single source for all inform ation needed by a ZCPR3
u tility about the system in w h ich it is running.
Consequently, all ZCPR3 u tilities access the ZCPR3 Environm ent Descriptor in
one o f two ways: (1) they contain a pointer to the descriptor or (2) they contain the
descriptor itself. The Z3INS.COM utility is used to install the ZCPR3 u tilities w ith the
address o f the E nvironm ent Descriptor or the descriptor itself. Class 1 u tilities are
those who contain a pointer to an environm ent descriptor, and Class 2 u tilities contain
the descriptor itself.
Supporting the Environm ent Descriptor in a global memory b u ffe r is the
recommended way to implement a ZCPR3 System. This buys the system two distinct
advantages:
1. Each u tility needs only 2 additional bytes o f overhead (the pointer to the
E nvironm ent Descriptor) rather than the descriptor its e lf (w hich occupies 256
bytes).
2. Changes can be made to the system dynam ically w ithout h aving to m od ify
an ything other than the Environm ent Descriptor.
C hap. 16 O verview o f Z C P R 3 In s ta lla tio n 241
The ZCPR3 u tilities are much smaller and faster than their ZCPR2 ancestors. For
a complete listing o f all ZCPR3 u tilities supplied w ith the distribution, see the
appropriate section.
Softw are Required for Installation
Commercial S oftw are. ZCPR3 is to be installed on a working C P /M 2.2 system.
The comm ercial softw are required to do this installation is:
1. A working C P /M 2.2 System
2. Source to the BIOS o f the target C P /M 2.2 System or an overlay patch for the Cold
Boot R outine
3. The MAC assembler from D igital Research, Inc.
4. A debugger (D D T , SID, or equivalent) for perform ing the overlay procedures
5. A disk u tility (SYSGEN or equivalent) for placing the operating system image
onto the OS tracks on disk.
If the user desires to edit and reassemble the utilities, the M icrosoft M80
assembler and L80 linker are also required.
System Segm ent Softw are. The fo llo w in g softw are is supplied w ith ZCPR3 and is
required for installation:
N a m e o f F ile F u n ction
ZCPR3.ASM Source to the ZCPR3 Command Processor
Z3HDR.LIB C on figuration File read in by ZCPR3.ASM to tailor the ZCPR3
Command Processor
Features of ZCPR3
The installer must first decide what features the ZCPR3 System is to include, and
his choices are:
1. Standard O verhead — Is the ZCPR3 System to include the standard IK
overhead or not? I f not, w h ich parts o f the Standard O verhead are to be included?
2. F low Command Package — Is the System to include Flow Commands or not?
3. In p u t/O u tp u t Package - Is the System to include I/O Packages or not?
4. R esident Command Package —Is the System to include R esident Commands or not?
Beyond these basic decisions, the contents o f the fo llo w in g c o n figu ration file s have to
be determined:
1. Z3BASE.LIB — Base Addresses for the System
2. Z3HDR.LIB — C on figuration Options for the ZCPR3 Command Processor
3. SYSFCP.LIB — C on figuration Options for the Flow Command Packages
(only i f this feature is selected)
4. SYSRCP.LIB — C onfiguration Options for theR esident Command Packages
(only i f this feature is selected)
Standard Overhead
The S t a n d a r d O v e r h e a d o f a ZCPR3 System consists o f all b u ffer s above 0F400H
in Fig 16-2. These b u ffe r s contain:
1. External Stack
2. Command Line B u ffe r
3. Memory-Based Nam ed D irectory
4. External File Control Block
5. Message B u ffers
6. Shell Stack
7. Environm ent Descriptor
The tr a d e o ff analysis o f whether to include these b u ffer s or not follow s. As a
general recom m endation, the features supported by these b u ffer s are fundam ental to
the basic nature o f ZCPR3 and it is recommended that all o f the Standard O verhead be
included. The cost o f doing this is only IK.
External S tack. The External Stack occupies 48 bytes, and its purpose is two-fold:
1) to free this am ount o f space w ith in the ZCPR3 Command Processor for other
purposes; and 2) to provide a common stack w h ich can be easily accessed by the ZCPR3
utilities to restore system integrity when required. The external stack need not be
initialized before use.
Command Line B u ffer. The C o m m a n d L i n e B u f f e r occupies just over 200 bytes,
and is required by many fu n ction s o f the ZCPR3 System. Its purpose is to store the
command line entered from the console keyboard, passed by an execu ting SUBMIT
file, or built by a ZCPR3 u tility such as ALIAS or M ENU. If this b u f f e r is not
supported externally (as recommended), then space for it w ill be taken up inside the
ZCPR3 Command Processor. If made external to the ZCPR3 com m and processor, this
b u ffer provides a m echanism to implement the fo llo w in g capabilities:
244 In s ta lla tio n Sec. 3
The F low Command Package m u s t be in itialized by the cold boot routine. Reasons
are the same as those for the Command Line Buffer.
Input/O utput P ackages. The I n p u t / O u t p u t P a c k a g e o f ZCPR3 implements a set of
Input/O utput drivers w h ich can be loaded dynam ically to c on figu re and extend the
inp u t/ou tp u t system o f the user’s computer.
The Inpu t/O utpu t Package m u s t be in itialized by the cold boot routine. Reasons
are the same as those for the Command Line B uffer.
Resident Command Packages. The R e s i d e n t C o m m a n d P a c k a g e o f ZCPR3
implements a set o f commands w h ich remain in memory until the RCP b u ffe r is
explicitly reloaded by the LDR.COM utility. These command packages extend the
command set resident w ith in the ZCPR3 Command Processor, and allow the user to
change the comm and set from time to time.
The R esident Command Package m u s t be in itia lize d by the cold boot routine.
Reasons are the same as those for the Command Line B u ffer.
O ther B u ffers
External Path. The E x t e r n a l P a t h (consisting o f a fe w byte-pairs) is a b u ffe r that
contains the sym bolic expression o f the Command Search Path to be fo llo w e d by the
ZCPR3 command processor when searching for a COM file.
246 In s ta lla tio n Sec. 3
The f ile Z3BASE.LIB defin es the memory structure o f the ZCPR3 System and
serves as a common source o f inform ation about the target ZCPR3 System for all
utilities and ZCPR3 System Segments. A number o f the ZCPR3 system segments have
"include" statements in their source, referencing this file , so that when they are
assembled, adequate inform ation on the memory structure o f the system for which
they are being assembled w ill be available to the assembler program.
Z3BASE.LIB is d ivid ed into two parts: 1) the comment header, w h ich outlines the
memory structure o f the system in a manner sim iliar to Fig 16-1; and 2) the body,
which contains a series o f equates that d e fin e addresses o f elem ents in the system,
together w ith other inform ation about various attributes o f the system.
Z3BASE Header
Figure 18-1 shows the comment header o f the exam ple ZCPR3 System
Z3BASE.LIB file. It is recom m ended that the installer f ill out the details o f the
address range and features supported in the target ZCPR3 System in a Z3BASE.LIB
file before doing any programming, and that he make a copy o f Z3BASE.LIB as a
reference for h im self during the installation process.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Z3BASE .:LIB — Base Addresses for ZCPR3 System by R Conn *
* *
* Address Range Size Function *
* 0 - FF 256 b Standard CP/M Buffers except *
* 40 - 4A 11 b for ZCPR3 External Path *
* 4B 1 b Wheel Byte *
* 100 - BFFF ~48 K TPA *
* COOO - C7FF 2 K ZCPR3 Command Processor *
* C800 - D5FF 3.5K BDOSZ *
* D600 - E3FF 3.5K CBIOSZ with Buffers *
* E400 - EBFF 2 K Resident Command Package *
* ECOO - F1FF 1.5K Redirectable I/O Driver Package *
* F200 - F3FF 0.5K Flow Command Package *
* F400 - F4FF 256 b Environment Descriptors *
* Bytes 00H-7FH: Z3 Parameters *
* Bytes 80H-FFH: Z3 Terminal Cap *
* F500 - F57F 128 b ZCPR3 Shell Stack *
* F580 - F5CF 80 b ZCPR3 Message Buffers *
* Byte 0: Error Flag (Z/NZ) *
* Byte 1: IF (8 Levels) *
* Byte 2: IF Active (8 Levels) *
* Byte 3: Z3 Cmd Status *
* 00B - Normal *
248 I n s ta lla tio n Sec. 3
* 01B - Shell *
* 10B - Error *
* Bytes 4&5: Error Address if 10B *
* Byte 6: Program Error Code *
* Byte 7 : ZEX Message Byte *
* 00B - Normal *
* 01B - Z3 Prompt *
* 10B - Suspend Intercept *
* Byte 8: ZEX Running Flag (0=No) *
* Bytes 9-10: Address of Next *
* Char for ZEX to Return *
* Bytes 11-12: Address of First *
* Char in ZEX Memory- *
* Based File Buffer *
* Byte 13: SH Control Byte *
* Bit 0: Enable SHCMT *
* Bit 1: Enable SHECHO *
* Bit 7: Enable Shell *
* Entry Wait *
* Bytes 14-15: Shell Scratch *
* Bytes 10H-2FH: Error Cmd *
* Bytes 30H-39H: Registers *
* Bytes 3AH-3FH: Reserved *
* Bytes 40H-4FH: User-Defined *
* F5D0 - F5FF 48 b ZCPR3 External FCB *
* F600 - F6FF 256 b Memory-Based Named Directory *
* F700 - F7CF 208 b Multiple Command Line Buffer *
* F7D0 - F7FF 48 b ZCPR3 External Stack *
* F800 - FFFF 2 K ROM *
************************************************************
this label (as, fo r instance, in T arbell BIOS listings and those of some other
m anufacturers).
Z3REV EQU 30 ; ZCPR3 REV NUMBER
CBREV EQU 41 ; CBIOSZ REV NUMBER
MSIZE EQU 48 ; SIZE OF TPA
These equates are usually referenced by the assembler to fill in these details in the
Cold Boot signon message. They are not used by any ZCPR3 System Segments other
than the BIOS.
The BASE equate specifies the base address of the user’s C P /M system (normally 0
for the s ta n d a rd D R I version). This equate allows easy m o d ificatio n fo r non-standard
versions of CP/M (e.g., H89 or Apple).
BASE EQU 0
Processor Selection. The following equate selects the use of the 8080/8085 CPU or the
Z80 CPU fo r the target ZCPR3. If your processor is an 8080 or 8085, set this equate to
TRUE. I f the processor is a Z80, set it to FALSE, since the Z80 code is much smaller
and, by using relative jumps, more featu res can be packed into the av ailable space.
18080 EQU FALSE
External P a th . The follow ing equates d efin e the address of the ZCPR3 E xternal Path
and the num ber of tw o-byte elements contained in this path (maximum). If there is no
ZCPR3 E xternal P ath, both of these values should be set to 0. ZCPR3 will then reserve
space w ith in itself fo r the com m and-search path.
EXPATH EQU 4OH ; EXTERNAL PATH
EXPATHS EQU 5 ; 5 2-byte Path Elements
; (PATH SIZE = EXPATHS*2 + 1)
Wheel Byte. The follow ing equate defines the address of the ZCPR3 Wheel Byte.
Z3WHL EQU 4BH ; WHEEL BYTE ADDRESS
If there is no Wheel Byte, set this equate to 0. The C3H in stru c tio n (JMP) at memory
location 0 will then be used as the Wheel Byte and, since this location is non-zero, the
Wheel Byte will always be TR U E. If this equate is set to 0, do not provide the user with
the com mands to change this byte, since, by so doing, he will wipe out the w arm boot
jump at location 0.
CCP Location. T he follow ing equate defines the address of the ZCPR3 Command
Processor. This address must be supplied.
CCP EQU 0C000H ; ZCPR3 COMMAND PROCESSOR
This value can be obtained by calculation or by using the Z3LOC utility.
RCP Location. The following equates d efin e the address of the ZCPR3 Resident
Command Package and its size in 128-byte blocks. I f there is no ZCPR3 Resident
Command Package, both of these values should be 0.
250 In s ta lla tio n Sec. 3
IOP L ocation. The fo llo w in g equates d e fin e the address o f the ZCPR3 Inp u t/O u tp u t
Package and its size in 128-byte blocks. If there is no ZCPR3 In p u t/O u tp u t Package,
both o f these values should be 0.
IO P EQU 0E C 00H ; REDIRECTABLE I / O PACKAGE
IO P S EQU 12 ; 12 1 2 8 - b y t e B lo c k s ( 1 . 5 K b y t e s )
FCP L ocation. The fo llo w in g equates d e fin e the address o f the ZCPR3 F low Command
Package and its size in 128-byte blocks. If there is no ZCPR3 F low Com m and Package,
both o f these values should be 0.
FCP EQU 0F200H ; FLOW COMMAND PACKAGE
FCPS EQU 4 ; 4 1 2 8 - b y te B lo c k s ( 0 . 5 K b y t e s )
ENV L ocation. The fo llo w in g equates d e fin e the address o f the ZCPR3 Environm ent
D escriptor and its size in 128-byte blocks. If there is no ZCPR3 Environm ent
D escriptor, both o f these values should be 0.
Z3ENV EQU 0F400H ; ENVIRONMENT DESCRIPTORS
Z3ENVS EQU 2 ; S IZ E OF DESCRIPTOR IN 1 2 8 -B Y T E BLOCKS
S h ell S tack . The fo llo w in g equates d e fin e the address o f the ZCPR3 Shell Stack, the
num ber o f entries perm itted in the ZCPR3 Shell Stack, and the size o f each entry in
the Shell Stack in terms o f bytes. If there is no ZCPR3 Shell Stack, all three values
should be 0.
SHSTK EQU 0F500H ; ZCPR3 SHELL STACK
SHSTKS EQU 4 ; NUMBER OF S H S IZ E -B Y T E SHELL STACK ENTRIES
SH SIZ E EQU 32 ; S IZ E OF A SHELL STACK ENTRY
(STACK S IZ E = SHSTKS * S H S IZ E )
The total am ount o f space occupied by the shell stack is SHSTKS*SHSIZE. In this
co n fig u ra tio n , 128 bytes are used (4*32).
ZCPR3 M essages. The fo llo w in g equate d e fin e s the address o f the ZCPR3
M essage B u ffer. T his b u ffer is alw ays 80 bytes long. I f there is no ZCPR3 M essage
B u ffer, this address should be 0.
Z3MSG EQU 0F580H ; ZCPR3 MESSAGE BUFFER
E xternal FCB. The fo llo w in g equate d e fin e s the address o f the ZCPR3 E xternal FCB.
T his b u ffe r is alw ays 36 bytes long. If there is no ZCPR3 E xternal FCB, this address
should be 0.
EXTFCB EQU 0F 5D 0H ; ZCPR3 EXTERNAL FCB
C hap. 18 S te p 2 : P la n n in g th e Z C P R 3 M em o ry S tru c tu re 251
Named D irectory B u ffer. The fo llo w in g equates d e fin e the address and size (in terms
of 18-byte entries) o f the ZCPR3 N am ed D irectory B u ffer. If there is no such b u ffer ,
both o f these values should be 0.
Z3NDIR EQU 0F600H ; ZCPR3 NAMED DIRECTORY AREA
Z3NDIRS EQU 14 ; 14 18-byte Named Directory
; Elements permitted.
;(NDIR SIZE=Z3NDIRS*18+1 [for trailing 0])
Command Line B u ffer. The fo llo w in g equates d e fin e the address and size (in
bytes) o f the ZCPR3 Com m and L ine B u ffer (form erly called the M ultiple Command
Line B u ffe r under ZCPR2). If there is no such b u ffe r , both o f these values should be
0.
Z3CL EQU 0F700H ; ZCPR3 COMMAND LINE BUFFER
Z3CLS EQU 200 ; SIZE OF COMMAND LINE BUFFER
External S ta ck . The fo llo w in g equate d e fin e s the address o f the ZCPR3 External
Stack. T his stack is alw ays 48 bytes in size. I f there is no such stack, this value should
be 0.
EXTSTK EQU 0F7D0H ; ZCPR3 EXTERNAL STACK
User Equates. The fo llo w in g equates are a v ailab le for the im plem enter’s target system.
These are im p lem en tation -d efin ed .
DJEPROM EQU 0F800H ; EPROM BASE ADDRESS
This is provided m ain ly as a con ven ien ce to the user. T his valu e is used by my BOOT
and BIOS, w h ich also read this f ile for in form ation.
252 In s ta lla tio n Sec. 3
C hap. 19 S te p 2 : P la n n in g th e Z C P R 3 M em ory S tru c tu re 253
************************************************************
* *
* The following revision number is in reference to the DR *
*2.8 CBIOS&. *
* *
************************************************************
************************************************************
* *
* CP/M systemequates. Ifreconfiguration of CP/M system *
* is being done, thechanges can bemade to thefollowing *
* equates. *
254 In s ta lla tio n Sec. 3
* *
************************************************************
This I/O Byte could also be initia lize d w ith in the in itia liza tio n sequence in the
In put/O utput Package. Whenever LDR.COM loads an I/O Package, it calls an
initialization routine.
*************************************************************
* *
* If there is a command insertedhere, itwill be given on *
* cold boot. *
* For Example: *
* *
* coldbeg db 'MBASIC MYPROG' *
* coldend db 0 *
* *
* will execute microsoft basic, andmbasicwill execute the *
* "MYPROG" basic program. *
* *
*************************************************************
*************************************************************
* *
* Path to be Set for ZCPR2 on Cold Boot *
* *
*************************************************************
*************************************************************
* *
* Control Processor/Microcomputer Basic I/O System *
* CP/ZM BIOSZ Standard with CON:=CRT: *
* CHBIOSZ Body *
* *
* Customized for the ARIES-1 Microcomputer with Hard Disk *
* by Richard Conn, Feb 2, 1984 *
* *
*************************************************************
/
Macro Libraries for Customization
Chap. 19 In s ta lla tio n S te p s 3 —6 257
MACLIB Z3BASE
MACLIB CBIOSHDR
« D etail L eft O ut »
*************************************************************
* *
* Thefollowing are internal Chios equates. Most are misc. *
* constants. *
* *
*************************************************************
fconin:
call flush ;Flush Buffer
jmp conin
fconout:
push b ;Save char
call flush ;Flush Buffer
pop b ;Get char
jmp conout
*************************************************************
* *
* Gocpm is the entry point from cold boots, and warm boots. *
* It initializes some of the locations in page 0, and sets *
* up the initial DMA address (8Oh). *
* *
*************************************************************
gocpm:
call const Check for Input Char
ora a NZ means char there
p. 19 In s ta lla tio n S te p s 3 —6
xra a ;A = 0
sta bufsec ;Disk Jockey buffer empty
sta bufwrtn ;Set buffer not dirty flag
endif
cldl:
ldax d ;Get char
mov m, a ;Put char
inx h ;Pt to next
inx d
ora a ;Done?
jrnz cldl
jmp ccp ;Run with Command
cwflg:
db 0 ;Cold/warm boot flag
************************************************************ *
* *
* If there is a command inserted here, it will be given if *
* the auto feature is enabled. *
* For Example: *
* *
* coldbeg db 'MBASIC MYPROG' *
* coldend db 0 *
* *
* will execute microsoft basic, and mbasic will execute the *
* "MYPROG" basic program. *
* *
************************************************************ *
*************************************************************
* *
* Signon message output during cold boot. *
* *
*************************************************************
prompt
db acr,alf
Chap. 19 In s ta lla tio n S te p s 3 —6 261
db acr,alf
db 0
*************************************************************
* *
* Path for ZCPR 3.x initialized during cold boot. *
* *
*************************************************************
path:
db idiskl,iuserl ;First Disk and User
db idisk2,iuser2 ;2nd Disk and User
db idisk3,iuser3 ;3rd Disk and User
db idisk4,iuser4 ;4th Disk and User
db 0 ;End of PATH
This path isdefined in CBIOSHDR.LIB.
************************************************************
* *
* Utilityroutine tooutput the message pointed at by H&L,*
* terminated with anull. *
* *
************************************************************
message:
mov a,m ;Get a character of the message
inx h ;Bump text pointer
262 In s ta lla tio n Sec. 3
*************************************************************
* *
* Cboot is the cold boot loader. All of CP/M has been loaded*
* when control is passed here. *
* *
*************************************************************
cboot:
lxi sp,tpa ;Set up stack
The follow ing code segment copies the d e fa u lt com m and-search p ath into the
E xternal P ath b u ffe r. Since the ZCPR3 Comm and Processor uses this b u f f e r the first
time it searches fo r a COM file, it is recom m ended th a t this in itia liz a tio n always be
done in the Cold Boot routine of the BIOS. There are some isolated cases where this is
not required, but they will not be discussed here.
if expath ne 0 /External Paths Supported
lxi d,path /Copy Cold-Boot Path
lxi h ,expath /Into System External Path Area
mvi b, 9 /Always 9 bytes
call movlop
endif
The follow ing code segment initializes the Wheel Byte to non-priveleged status.
This in itia liza tio n may be done by a program executed by ST A R T U P if desired.
if z3whl ne 0 /Wheel Byte Supported
xra a /Clear Wheel Byte
sta z3whl
end if
The follow ing code segment initializes the R esident Comm and Package b u f f e r to
zero. 128 bytes is larger than needed, but ra th e r than specify the exact size fo r each
package, this and the following initializations save code space in the BIOS and d on’t
waste a s ig n ifican t am ount of time. Since the ZCPR3 Com m and Processor uses the
RCP before any COM files are executed, in itia liza tio n of the RCP b u f f e r is required
Chap. 19 In s ta lla tio n S te p s 3 —6 263
endif
The follow ing in itia liza tio n must also be perform ed d u rin g Cold Boot since the
ZCPR3 C om m and Processor uses messages extensively if this fe a tu r e is enabled.
if z3msg ne 0 ;ZCPR3 Messages Supported
lxi h,z3msg ;Clear Message Bytes
O'
00
mvi ;80 bytes
o
call zerom
endif
The follow ing in itia liza tio n is not required d u rin g Cold Boot if the analysis of the
DU form is p erform ed before the D IR fo rm by the ZCPR3 Comm and Processor, but the
installer is taking a risk th a t all will be well until LD R loads the N am ed Directory
b u f f e r if he does not perfo rm the following in itia liza tio n d u rin g Cold Boot.
if z3ndir ne 0 ;Named Directory Based in Memory
lxi h,z3ndir ,
‘Named Directory Base
call zerol28 ;128 bytes
endif
The follow ing in itia liza tio n of the Comm and Line b u f f e r is absolutely required
during Cold Boot. Only if the Command Line b u f f e r is N O T external is this
in itia liza tio n unnecessary, but then a sig n ifican t am ount of the power of the ZCPR3
System is lost by having an in tern al C om m and Line b u ffe r.
if z3cl ne 0 »•Multiple Commands Allowed
lxi d,cmdset ;Set buffers for Multiple Commanc
lxi h,z3cl /•Command Line Base
call mover ;Copy an arbitrary 128 bytes
endif
As m entioned previously, the follow ing in itia liza tio n is not required and may be
perform ed by the I/O Package loaded by LDR.
if iop ne 0
mvi a,intioby ;Initialize the I/O Byte
sta iobyte
endif
The following completes the Cold Boot initializations.
lxi h ,prompt ;Prep for sending signon message
call message ;Send the prompt
mvi a,cbdisk /•Select basic disk
sta cpmdrv
sta edisk
Chap. 19 I n s ta lla tio n S te p s 3 —6 265
« D etail L eft O ut »
jmp gocpm
*************************************************************
* *
* Mover moves128 bytes of data. Source pointer in DE, Dest *
* pointer inHL. *
* *
*************************************************************
mover:
mvi b, 128 /Length of transfer
movlop:
ldax d ;Get a byte of source
mov m, a ;Move it
inx d ;Bump pointers
inx h
djnz movlop /Continue moving until done
ret
•
; Zero 128 bytes of memory pted to by HL
t
zerol28 :
•
/
mvi b, 128 /128 bytes
•
/ Zero memory for B bytes
9
/ memory pted to by HL
zerom:
mvi m, 0 /store zero
inx h
djnz zerom
ret
end if
266 I n s ta lla tio n Sec. 3
if iop ne 0
•
/
lstout equ dj cout ;same as console for now
punout equ dj cout ;same as console for now
rdrin equ djcin ;same as console for now
else
/
endif ;IOP ne 0
*************************************************************
* *
* Primitive I/O Drivers which are loaded at Cold Boot time. *
* *
*************************************************************
uart equ origin+3F9H ;UART address
rda equ 4 ;UART RDA Bit
iodrivers:
•
/
if iop ne 0
t
endif ;iop ne 0
/
ret ;Initialize Terminal
db 0,0 ;Fill 3 bytes
jr ustat ;Console Input Status
db 0 ;Fill 3 bytes
jmp djcin »•Console Input Char
jmp dj cout /Console Output Char
Note:
The above routines are located somewhere within the BIOS. They are very small
and simple in nature, and they do not implement the I/O Byte. This is left for the
redirectable I/O package which will be loaded later.
ioerror:
xra a ;No device assignments
ret
*************************************************************
* *
* The following equatesdefine thevarious Redirectable *
* I/O routines in theSYSTEM I/O Area. *
* *
*************************************************************
i
if iop ne 0
riobase equ iop+9 /•Relative I/O Base (less support)
268 In s ta lla tio n Sec. 3
else
riobase equ iodrivers »•Simple I/O Drivers
endif ;iop ne 0
«
/
tinit equ riobase »•Terminal Init
const equ riobase+3 ;Console Input Status
conin equ riobase+6 »•Console Input
conout equ riobase+9 »•Console Output
list equ riobase+12 »•List Output
punch equ riobase+15 »•Punch Output
reader equ riobase+18 »•Reader Input
listst equ riobase+21 »•List Output Status
newio equ riobase+24 »•Redirectable I/O Patcher
*************************************************************
* *
* InitialValues forthe ExternalCommand Line Buffers *
* andNamedDirectoryMemory-Based Buffers *
* *
*************************************************************
if z3cl ne 0
cmdset:
dw z3cl+4 »•Beginning of I/O Buffer
db z3cls »•Size of I/O Buffer
db 0 »•Empty Buffer
db 0 »•Empty Buffer
endif
*************************************************************
* *
* Wbootloads in allof CP/M except the CBIOS, then *
* initializes system parameters as in cold boot. See the *
* Cold Boot Loader listing for exactly what happens during *
* warm and coldboots. *
* *
*************************************************************
wboot
C hap. 19 In s ta lla tio n S te p s 3 —6 269
« D etail L eft O ut »
Step 4: E diting Z3H D R .LIB
The follow ing is a re fo rm a tte d duplicate of the body of the Z3HDR.LIB file. It is
provided here to present ad d itio n al in fo rm atio n on how to set the equates. It may be
useful to the installer to have this installation m anual open to these pages while he is
editing the Z3HDR.LIB file.
The follow ing is the Banner fo r Z3HDR.LIB:
Z3HDR - Maximum Configuration
Offset: 5100H
This o ffs e t is a note to the installer. It indicates the value to add to the R
command of D D T in order to properly read in the H EX file of the ZCPR3 Command
Processor into the O perating System memory image.
Module: Z3HDR
Author: Richard Conn
Module Used By: ZCPR3 Version 3.x
Note:
Z 3H D R contains the key custom ization equates for ZCPR3. These equates allow
the user to select various ZCPR3 options and do an extensive am ount of tailoring
of ZCPR3 to the user’s desires.
B asic System D efin ition s
The follow ing equates may be used to customize this CPR for the user’s system
and in teg ratio n technique.
REL - TRUE if integration is to be done via MOVCPM
- FALSE if integration is to be done via DDT and SYSGEN
SUBTYP MACRO
DB 'SUB'
ENDM
These equates are provided to allow the installer to select any file type he wishes
for object and in d ire c t com m and files. The indicated values of ’COM’ and ’SUB’ are
conventional.
SUBM IT File Processing
The follow ing flag enables the ability of ZCPR3 to process SUBMIT files
(command files of the fo rm $$$.SUB). I f SUBON is T R U E , then ZCPR3 will process
such files like C P /M ’s CCP norm ally does; if SUBON is FALSE, ZCPR3 will not
process such files (ignore them). In such a case, only in d ire c t com m and file facilities
like Z E X will work. Much code is saved inside of the ZCPR3 Com m and Processor if
SUBON is set to FALSE, but this ra th e r useful facility is lost.
SUBON EQU TRUE
Command P refix
The follow ing flag allows ZCPR3 to accept commands of the fo rm "du:command
params" or "dincom m and params". If D R V P R E F IX is T R U E , this form is accepted; if
FALSE, this fo rm is not accepted.
DRVPREFIX equ TRUE
This option also affe c ts argum ents to commands, such as "DIR A5:*.TXT", and DU
or DIR prefixes on these argum ents are not processed either if D R V P R E V IX is
FALSE.
Command A ttributes
The follow ing equate allows the user to select the a ttrib u te s of the COM files
which are selected for execution. The ZCPR3 Comm and Processor can be made to
execute only COM files w ith the System a ttrib u te set, w ith the D irectory (non-System)
a ttrib u te set, or w ith either a ttrib u te set. The follow ing values are d e fin e d for this
equate:
COMATT Files Selected
0 System
80H D irectory
1 Both System and D irectory
C hap. 19 I n s ta lla tio n S te p s 3 —6 271
The com mands inside of the R esident Comm and Package can also be set to
respond to the Wheel Byte.
ZCPR3 Resident Command Table
This table consists of the names of the various ZC PR 3-resident commands and
their addresses. The N CHARS equate defines how m any characters long each name
may be, and all table entries must be exactly the indicated num ber of characters
(trailing spaces are used to fill out shorter names).
Each table e n try is s tru ctu re d as follows:
DB 1CMND1 /Name of Command (NCHARS long)
DB CMNDADR ;Address of Command within ZCPR3
The installer should only change the names of the com mands as desired and
should not, as a rule, touch the address d e fin itio n since this is fix ed w ith in the body of
ZCPR3.
lRS EQU 4 ;NUMBER OF CHARS/COMMAND
SLE MACRO
IF DIRON
DB 'DIR '
DW DIR ;DIRECTORY DISPLAY COMMAND
ENDIF
IF LTON
DB •LIST'
DW LIST ;LIST FILE ON PRINTER COMMAND
DB 'TYPE'
DW TYPE ;TYPE FILE ON CONSOLE COMMAND
ENDIF
IF GOON
DB 'GO '
DW GO /EXECUTE CURRENT TPA COMMAND
ENDIF
IF ERAON
DB 'ERA '
DW ERA /ERASE FILES COMMAND
ENDIF
IF SAVEON
C hap. 19 In s ta lla tio n S te p s 3 —6 273
DB ' SAVE'
DW SAVE ;SAVE TPA COMMAND
ENDIF
IF RENON
DB 'REN '
DW REN ; RENAME FILES COMMAND
ENDIF
IF GETON
DB 'GET '
DW GET ; LOAD FILE INTO TPA COMMAND
ENDIF
IF JUMPON
DB ' JUMP'
DW JUMP ; JUMP TO ANY MEMORY LOCATION
ENDIF
IF NOTEON
DB ' NOTE'
DW NOTE ;NOTE - NULL COMMAND (NOP)
ENDIF
ENDM
The WIDE equate is in tended to provide for shorter lines fo r those users w ith 64-
column displays. For those w ith 80-column displays, the o u tp u t lines are much easier
to read.
The follow ing equates d efin e two flags w hich are used in conjunction w ith the
D IR com m and on the com m and line. SYSFLG is the ch ara cter used to in d icate to DIR
th a t all files, both System and non-System, are to be displayed. SOFLG is the character
used to in d icate to D IR th a t only the System files are to be displayed. By d efau lt, DIR
displays non-System files.
For example, if SYSFLG is set to ’A ’ and SOFLG is set to ’S’, then:
DIR * .COM A
displays all COM files w ith both System and non-System attrib u tes while:
DIR * .COM S
displays only COM files w ith the System attribute. N aturally:
DIR * .COM
displays only COM files w ith the non-System a ttrib u te.
SYSFLG EQU 'A'
SOFLG EQU 'S'
The follow ing equate causes ERA to c o n firm the files to be erased before it goes
ahead and erases them. I f E R A O K is T R U E , then the user will be prom pted each time;
if it is FALSE, then the user will not be prompted.
ERAOK equ FALSE
If E R A O K is T R U E , the following equate adds a V e rify option to the ERA
com mand w hich causes the user to be prom pted only if the V e rify option letter,
d efin e d by E R D F L G , is given a f te r the file name. If ER A V is T R U E , then the user
will be asked to v e rify only when E R D F L G is contained in the com m and line; if
ERA V is FALSE, the user will always be asked to verify.
For example, if E R A O K is T R U E , ERA V is T R U E , and E R D F L G is ’V ’, then the
command:
ERA *.* V
will result in the file names being displayed and the user being asked fo r verification.
If the V option were not given, the user would not be asked fo r verification.
ERAV equ FALSE
ERDFLG equ 'V '
The follow ing equates set the paging param eters for the TY PE command.
P G D F L T determ ines if TY PE pages by default. I f P G D F L T is T R U E , then:
C hap. 19 In s ta lla tio n S te p s 3 —6 275
ENDIF
The follow ing flag enables ZCPR3 to p erform an optim ized path search when it is
searching along a p ath fo r a file. If this equate is T R U E , ZCPR3 will build a path in
memory of absolute entries (A l, B7, etc) from the symbolic p ath (one containing ’$’)
which is the p ath it would otherw ise use. This new path would contain no duplicate
path elements, where a symbolic path analysis may. For example, if the p ath is:
db ;disk A, current user
db 'A*- 1@ ',15 ;disk A,user 15
db 0
then if the user is logged into A15, setting the below equate to T R U E would allow
ZCPR3 to build the path:
db 'A'-'@',15 ;only one entry
db 0
in the analysis of this symbolic path, w hile w ith this equate FALSE, ZCPR3 may log
into A15 as m any as three times (once for the d e fa u lt and twice more fo r the symbolic
path) in looking fo r a file w hich is not fo u n d before it gives up. Using this minim um
path facility costs some code in ZCPR3, but it speeds up processing noticeably in some
cases.
Enable this equate if MINIM UM PATH SEARCH is to be employed.
MINPATH EQU TRUE
In searching fo r a file along a path, ZCPR3 can be com m anded to always look in
the cu rre n t logged-in directory before beginning the path search. This equate controls
this feature. If SCA NCU R is set to T R U E , the c u rre n t d irec to ry need never be
referenced in a symbolic path expression (DB ’$’,’$’) since SCA NCU R insures th a t the
c u rren t directory is scanned.
C hap. 19 In s ta lla tio n S te p s 3 —6 277
A>ROOT:
A>TYPE TEXT:FILE.TXT
IF Z3CL NE 0
MULTCMD equ TRUE
ELSE
MULTCMD equ FALSE
C hap. 19 I n s ta lla tio n S te p s 3 —6 279
ENDIF
CMDSEP equ '; '
CMDRUN—E xtended Command Processing
This equate enables the ZCPR3 CM DR UN facility. If C M D R U N is T R U E, then
another stage of com m and processing is invoked should ZCPR3 fa il to fin d a COM file
when the user gives a command. This stage involves invoking the COM file specified by
CMDFCB and giving it the cu rre n t com mand line as an argum ent. In this way, if, say,
M80 PRO G2 fails as a com mand, a new com m and like L R U N Z M80 PROG2, SUB M80
PROG2, or Z E X M80 PROG2 may be processed. If the new com m and fails, an
appropriate erro r message is given.
The R O O T O N L Y option causes ZCPR3 to only look at the Root (bottom of path)
for the E x tended Com m and Processor if it is set to TR U E. If it is set to FALSE, the path
is searched fo r the E xtended Com m and Processor. The tr a d e o f f here is that
RO OTONLY = T R U E is less flexible but somewhat faster th a n R O O T O N L Y = FALSE.
CMDRUN equ FALSE •
9 Enable the Facility
if CMDRUN
ROOTONLY equ TRUE •
9 TRUE if look at Root Only
•
9 Extended Command Processor
•
9 FALSE if look along path
CMDFCB MACRO
db 0
db 'CMDRUN' ;Name of Program
db •COM' ;File Type
ENDM
endif ;CMDRUN
Flow Command Facility
This equate enables ZCPR3 to respond to IF processing. ZCPR3 simply flushes
commands if a FALSE IF is cu rren tly engaged. FCPs must be enabled for IFON to
work correctly.
IFON EQU TRUE
Miscellaneous Equates
MAXUSR EQU 31 ; MAXIMUM USER NUMBER A CCESSIBLE
MAXDISK EQU 4 ; MAXIMUM NUMBER OF D ISK S ACCESSIBLE
The D U fo rm will only be allowed to reference disks and user areas up to the
in d icated m axim um values. These limits, however, do not apply to nam ed directories.
For instance, if M A X U SR was 20 and the name SPECIAL was equated to B31, then
’SPECIAL:’ w ould be resolved correctly but ’B31:’ w ould cause an error. Named
directories can have password protection associated w ith them, so B31 can be a
directory w hich is accessed only if the user knows the password fo r it.
280 In s ta lla tio n Sec. 3
This option applies to the SAVE com mand only. It perm its form s like:
SAVE 1 7 m y f i l e . b i n 17 i s d e c i m a l
SAVE 11H m y f i l e . b i n 11H i s h e x a d e c i m a l
Bll> ZEX: F I
Bll> ZEX: ERA SYSENV.HEX
SYSENV HEX
Bll> ZEX: F I
Bll> ZEX:
Bll> ZEX: ; Assembly Complete
Bll> ZEX: /
Bll> ZEX: Done>
Bll>ren sys.env=sysenv.com
Assembling SYSNDR
Bll>zex mac sysndr
ZEX, Version 3.0
Bll> ZEX: ;
Bll> ZEX: ; MAC — CP/M Standard MACRO Assembler and Loader
Bll> ZEX: ;
Bll> ZEX: ; Suppress FALSE IF Printout
Bll> ZEX: ;
Bll> ZEX: IF NUL SYSNDR
Bll> ZEX: MAC SYSNDR $-S PZ
CP/M MACRO ASSEM 2.0
01EB
005H USE FACTOR
END OF ASSEMBLY
Bll> ZEX: FI
Bll> ZEX: ERA SYSNDR.HEX
Chap. 19 I n s ta lla tio n S te p s 3 —6 283
SYSNDR HEX
Bll> ZEX FI
Bll> ZEX /•
Bll> ZEX ; Assembly Complete
Bll> ZEX /
Bll> ZEX Done>
Bll>ren sys.ndr=sysndr.com
Assembling SY SIO P
Bll>zex mac sysiop
ZEX, Version 3.0
Bll> ZEX: ;
Bll> ZEX: ; MAC — CP/M Standard MACRO Assembler and Loader
Bll> ZEX: ;
Bll> ZEX: ; Suppress FALSE IF Printout
Bll> ZEX: ;
Bll> ZEX: IF NUL SYSIOP
Bll> ZEX: MAC SYSIOP $-S PZ
CP/M MACRO ASSEM 2.0
FOAA
016H USE FACTOR
END OF ASSEMBLY
Bll> ZEX: FI
Bll> ZEX: ERA SYSIOP.HEX
SYSIOP .HEX
284 In s ta lla tio n Sec. 3
Bll> ZEX: FI
Bll> ZEX: /
Bll> ZEX: ; Assembly Complete
Bll> ZEX: /
Bll> ZEX: Done>
Bll>ren sys.iop=sysiop.com
Assembling SYSRCP
Bll>zex mac sysrcp
ZEX, Version 3.0
Bll> ZEX: ;
Bll> ZEX: ; MAC — CP/M Standard MACRO Assembler and Loader
Bll> ZEX: ;
Bll> ZEX: ; Suppress FALSE IF Printout
Bll> ZEX: ;
Bll> ZEX: IF NUL SYSRCP
Bll> ZEX: MAC SYSRCP $-S PZ
CP/M MACRO ASSEM 2.0
EBF1
017H USE FACTOR
END OF ASSEMBLY
Bll> ZEX: FI
Bll> ZEX: ERA SYSRCP.HEX
SYSRCP .HEX
Bll> ZEX: FI
Chap. 19 I n s ta lla tio n S te p s 3 —6 285
Bll> ZEX:
Bll> ZEX: ; Assembly Complete
Bll> ZEX: t
Bll> ZEX: FI
Bll> ZEX: ERA SYSFCP.HEX
SYSFCP .HEX
Bll> ZEX: FI
Bll> ZEX: ;
286 In s ta lla tio n Sec. 3
Bll>xd myterm.z3t oa
XD III Version 1. 2
Filename.Typ Size K Filename.Typ Size K Filename.Typ Size K
MYTERM .Z3T 4
B 11: - 1 Files Using 4K ( 2304K Left)
Assembling the CBIOS
The follow ing illustrates the assembly of the Customized Basic I n p u t/O u tp u t
System (CBIOS). CBIOS has already been customized so th a t its Cold Boot routine
perform s the proper in itia liza tio n s of b u ffe rs required by the ZCPR3 System.
Bll>mac cbiosz $-s pz
CP/M MACRO ASSEM 2.0
E3CE
01FH USE FACTOR
END OF ASSEMBLY
Assembling the ZCPR3 CPR
The follow ing illustrates the assembly of the ZCPR3 C om m and Processor
R eplacem ent. All custom ization has been done in the files Z3BASE.LIB and
Z3HDR.LIB.
Bll>mac zcpr3 $-s pz
CP/M MACRO ASSEM 2.0
C7E9
01EH USE FACTOR
END OF ASSEMBLY
288 In s ta lla tio n Sec. 3
Bll>save 45 cpm.bin
We now have a file nam ed CPM.BIN on disk. This is the O perating System Image.
Note th a t the "45" above is a num ber unique to my system and it may be d if f e r e n t for
the in sta lle r’s system.
P a tc h in g th e C P /M System Image
The follow ing illustrates the technique of patching the C P /M O perating System
Image. The CCP is replaced by ZCPR3 (ZCPR3.HEX) and the BIOS is replaced by
CBIOS (CBIOS.HEX).
In this example, the C P /M O perating System Image begins at 1100H. This may be
d if f e r e n t on the system being installed.
Bll>ddt cpm.bin
DDT VERS 2.0
NEXT PC
2E00 0100
The follow ing com m and displays the CCP area. Y our display will probably not be
the same as this (I was ru n n in g ZCPR3 at the time this display was created), but the
installer should recognize the two opening JMP instructions as a key to being sure that
the CCP is indeed at this location.
-dllOO lllf
1100 C3 3E CO C3 3E CO 43 4F 4D 01 24 24 24 20 20 20 .> ..> .COM.$$$
1110 20 20 53 55 42 00 00 00 00 00 00 00 00 00 00 00 SUB......
Chap. 19 Installation Steps 3—6 289
The following zeroes out the CCP area (I prefer to do this-just in case).
-fllOO 18ff 0
Now the ZCPR3 Command Processor Replacement is read in on top of the CCP
area. The offset here is 5100, and it may be different for the system being installed.
After the read-in, a dump is done to make sure the image was loaded properly.
-izcpr3.hex
-r5100
NEXT PC
2EOO 0000
-dllOO lllf
1100 C3 3E CO C3 3E CO 43 4F 4D 01 24 24 24 20 20 20 . . . . COM.$$$
1110 20 20 53 55 42 00 00 00 00 00 00 00 00 00 00 00 SUB.......
The following command displays the BIOS area. Your display will probably not
be the same as this, but the installer should recognize the two opening JMP instructions
as a key to being sure that the BIOS is indeed at this location.
-d2700 270f
2700 C3 CC D6 C3 70 D7 C3 OC EC C3 39 D6 C3 3F D6 C3 ___p .... 9..?
The following zeroes out the BIOS area (I prefer to do this-just in case).
-f2700 2dff 0
Now the CBIOS is read in on top of the BIOS area. The offset here is 5100, and it
may be different for the system being installed. After the read-in, a dump is done to
make sure the image was loaded properly.
-icbiosz.hex
-r5100
NEXT PC
2E00 0000
-d2700 274f
2700 C3 CC D6 C3 70 D7 C3 OC EC C3 39 D6 C3 3F D6 C3 ___p...
2710 15 EC C3 18 EC C3 IB EC C3 C3 D7 C3 04 D8 C3 C5 ......
2720 D7 C3 B7 D7 C3 BD D7 C3 F6 D8 C3 EF D8 C3 IE EC ......
2730 C3 CA D7 C3 IB FC C3 21 EC CD 64 D9 C3 OF EC C5 ..... !1..d__
2740 CD 64 D9 Cl C3 12 EC CD OC EC B7 C4 OF EC 21 80 .d.... i
-AC
The following SAVE places the new ZCPR3 Operating System Image on disk.
Bll>save 46 zcpr3.bin
290 In s ta lla tio n Sec. 3
Just to double-check, the image is reloaded and the end of the CBIOS is displayed
to make sure the image is complete.
Bll>ddt zcpr3.bin
DDT VERS 2.0
NEXT PC
2E00 0100
-d2dc0 2dff
2DC0 00 00 00 00 00 00 F8 E0 00 00 03 E3 B8 E2 00 00 ..............
2DD0 00 00 00 00 00 00 F8 E0 00 00 8E E3 43 E3 45 6E .......... C.En
2DEO 64 20 6F 66 20 43 42 49 4F 53 5A 00 00 00 00 00 d Of CBIOSZ...
2DF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
- AC
The selection of the c o n fig u ra tio n options for the various System Segments of
ZCPR3 is described here in some detail.
Resident Command Packages
The follow ing is a re fo rm a tte d duplicate of the body of a SYSRCP.LIB file. It is
provided here to present a d d itio n al in fo rm atio n on how to set the equates. It may be
useful to the installer to have this installation m anual open to these pages while he is
editing this file.
Each e n try fo r the resident commands mentions th e ir tran sien t program
counterparts. These u tilities usually provide capabilities w hich exceed those of the
programs in the R esident Comm and Package, but the tr a d e o f f is th a t each utility
program is a separate file on disk w hich usually occupies more disk space than an
entire RCP. In essence, the RCP commands provide quick, convenient capabilities to
the user, and the tran sien t utilities provide much greater fle x ib ility and u tility to the
user. In most reasonable ZCPR3 Systems, both facilities are available.
SYSTEM SEGMENT: SYS1.RCP
SYSTEM: ZCPR3
WRITTEN BY: RICHARD CONN
DIR Command
T R A N S IE N T C O U N T E R PA R T : DIR, XD, X D IR
The follow ing equate determ ines if the D IR com mand is made available. Setting
this equate to T R U E enables the D IR command.
The D IR com m and displays the directory of files in alphabetical order across the
lines to the user.
DIRON EQU FALSE
The D IR com m and allows two options. One is a flag to tell it to look at both System
and Non-System files, and the other is a flag to tell it to look only at System files.
By d e fa u lt, D IR looks a t Non-System files.
SYSFLG defines the c h ara cter used to in stru c t D IR to look at both System and
Non-System files. The recom m ended value is ’A ’ fo r All.
SOFLG defines the c h ara cter used to in stru c t D IR to look at only System files. The
recom m ended value is ’S’ fo r System.
SYSFLG EQU 'A '
SOFLG EQU •S '
The follow ing equate determ ines if the directory displays are sorted by filenam e
and filety p e or by filety p e and filename. Set SO R TN T to T R U E to sort by name
and type, FALSE to sort by type a n d name.
SORTNT EQU TRUE
The follow ing equates d efin e some featu res of the directory display. If WIDE is
T R U E , the file names are spaced f a r th e r abort; if WIDE is FALSE, they are closer
together (for a 64-column display). FEN CE defines the ch ara c te r used to separate
the file nam e entries in the display.
WIDE EQU TRUE
FENCE EQU ' | '
ERA Command
T R A N S IE N T C O U N T E R PA R T : ERASE
The follow ing equate determ ines if the ER A com m and is made available. Setting
this equate to T R U E enables the E R A command. The ER A com m and erases files.
ERAON EQU TRUE
C hap. 20 S te p 7 : S y ste m S egm ent In s ta lla tio n 293
NLINES defines the num ber of lines on the user’s CRT screen. This is usually 24.
N LIN ES EQU 24
PROT Command
T R A N S IE N T C O U N T E R PA R T : PRO TECT
The follow ing equate determ ines if the PRO T com mand is made available. Setting
this equate to T R U E enables the PRO T command.
The P R O T com m and sets the file protection attrib u tes fo r a group of files.
PROTON EQU TRUE
294 In s ta lla tio n Sec. 3
REN Command
T R A N SIE N T C O U N T E R PA R T : REN A M E
The follow ing equate determ ines if the R E N com mand is made available. Setting
this equate to T R U E enables the R E N command. The R E N com m and changes the
name of one file to another.
RENON EQU TRUE
REG Command
T R A N S IE N T C O U N T E R PA R T : R E G
The follow ing equate determ ines if the R E G com mand is made available. Setting
this equate to T R U E enables the R E G command.
REGON EQU FALSE
WHL Command
T R A N S IE N T C O U N T E R PA R T : WHEEL
The follow ing equate determ ines if the WHL com m and is made available. Setting
this equate to T R U E enables the WHL command.
The WHL com m and is used to tu rn o f f the Wheel Byte (make the user non-
priveleged) or to tu rn on the Wheel Byte (make the user priveleged).
Also, this equate enables the WHLQ command, w hich displays the state of the
Wheel Byte.
WHLON EQU FALSE
The follow ing equate defines the password to be used by the WHL command. It
must always be 8 bytes long (trailing spaces allowed) and must be upper-case.
WPASS MACRO
DB 'SYSTEM ' ;8 characters
ENDM
The Wheel equate table enables the WHEEL fa c ility of ZCPR3. With this facility, a
WHEEL BYTE, w hich exists somewhere in memory, is exam ined before a set of
installer-selected com mands are executed. If this byte is not zero, then the
com m and proceeds. If it is zero, then the com m and is not allow ed to proceed and is
exited w ith an erro r message.
The follow ing set of equates make each of the in d icate d com mands selectable to
respond to the Wheel Byte or not. For instance, if W ERA=TRUE, then it responds
to the Wheel Byte; if WERA=FALSE, it does not.
Chap. 20 S te p 7 : S y ste m S egm ent In s ta lla tio n 295
These options will be effe c tiv e only if a Wheel Byte is D efin ed (Z3WHL NE 0)
WCP equ FALSE Make CP a Wheel-Oriented Command
WDIR equ FALSE IV DIR " " " "
WERA equ FALSE II ERA " " " "
WLIST equ FALSE II LIST " " " "
WPEEK equ FALSE II PEEK " " " "
WPOKE equ FALSE II POKE " " " "
WPROT equ FALSE IV PROT " " " "
WREG equ FALSE II REG " " " »
WREN equ FALSE II REN " " " "
WTYPE equ FALSE II TYPE n 11 11 11
NOTE Command
T R A N S IE N T C O U N T E R PA R T : NOTE
N O TE is simply a NOP (do nothing) com m and w hich can be used to place
comments into m ultiple com m and lines. Setting the follow ing equate to T R U E
enables the N O T E Command.
NOTEON EQU TRUE
The N O T E com m and is very convenient in the creation of com m ented displays and
com m and files. It is generally recom m ended to im plem ent this com mand as a
resident com m and w ith in the ZCPR3 Comm and Processor itself ra th e r than w ithin
an RCP since the ZCPR3 Comm and Processors tend to have more room to spare
th a n RCPs and it is fre q u e n tly desirable to save as m uch space w ith in an RCP as
possible.
ECHO Command
T R A N S IE N T C O U N T E R PA R T : ECHO
The follow ing equate enables the ECHO command.
ECHO is useful in issuing both messages (to the user, say w ith in a com m and file
d u rin g execution) and escape sequences. ECHO can send its o u tp u t to the console
(by d e fa u lt) or to the p rin te r (if the first non-blank ch ara cter is a dollar sign). It
uses BIOS calls, so all control characters are passed exactly. Hence, console-level
program m ing of such devices (CRTs and P rinters) is possible.
The ECHOLST equate determ ines if ECHO is allowed to direct its ou tp u t to the
p rin ter. If ECHOLST is T R U E , ECHO may direct its ou tp u t to the p rin te r via the
$ p re fix ch ara c te r in the text.
296 In s ta lla tio n Sec. 3
The ECHO tran sien t is not very large, and it is fre q u e n tly more convenient to have
ECHO im plem ented in an RCP. However, since space w ith in RCPs is fre q u e n tly at
a prem ium , it may be necessary to employ the ECHO transient.
Flow Command P ackages
The follow ing is a re fo rm a tte d duplicate of the body of a SYSFCP.LIB file. It is
provided here to present a d d itio n al in fo rm atio n on how to set the equates. It may be
useful to the installer to have this installation m anual open to these pages w hile he is
editing this file.
A key decision to be made in the creation of FCPs is w h eth er to im plem ent the IF
com m and as a COM file or w ith in the FCP itself. The follow ing tr a d e o f f should be
considered:
1. As a COM file, the IF com mand o ffers m any more options and fle x ib ility for
condition processing th a n an FCP-resident IF.
2. As a COM file, the IF com m and adds overhead by having to be located and
loaded fro m disk and then executed.
In the follow ing text, we also show the equates th a t set options fo r an FCP-
resident IF command. IF.COM contains all of these options and more. R e fe r to the
associated H LP file fo r more detail.
SYSTEM SEGMENT: SYS1.FCP
SYSTEM: ZCPR3
CUSTOMIZED BY: RICHARD CONN
IF: WH (W heel)
Setting the follow ing equate to T R U E enables IF to check w h eth er the Wheel Byte
is set or not. If the Wheel Byte is set, the statem ent IF WHEEL retu rn s TRU E.
IFOWHEEL EQU FALSE
IF: TC (TCAP)
Setting the follow ing equate to T R U E enables IF to test to see if the ZCPR3 TCAP
contains a te rm in al d e fin itio n or not. This test is p artic u la rly useful in com mand file
or alias processing to check w h eth er a Z3TCAP entry is defined, and to invoke screen-
oriented routines if it is.
IFOTCAP EQU FALSE
IF: fcbl=fcb2
Setting this equate to T R U E will enable IF to check w hether the two FCBs contain
the same values. I f so, the IF retu rn s TR U E ; if not, the IF retu rn s FALSE. Enabling
this equate elim inates the need fo r the N U L L test, since a test for null can be
perform ed by using the syntax: IF f c b l =
IFOEQ EQU TRUE
COMIF - Run IF.COM
Setting this equate to T R U E will cause an IF statem ent executed during an IF
T R U E or NO IF state to look in the R O O T directory fo r the file IF.COM, and, if found,
load IF.COM and tra n s f e r control to it. If IF.COM is not fo u n d , then IF F is raised.
Using IF.COM provides much more power and flex ib ility but also requires IF.COM to
be present and takes up disk space.
COMIF EQU FALSE
comments outlining the functions being perform ed, and I feel th a t this should be
adequate.
Named Directory Files
The follow ing is a refo rm a tted duplicate of the body of a SYSNDR.LIB file. It is
provided here to present additional in fo rm atio n on how to set the equates. It may be
useful to the installer to keep the book open to these pages w hile he is editing this file.
DATA FILE: SYSNDR.LIB
AUTHOR: Richard Conn
VERSION: 1.0
DATE: 24 Feb 84
SYSNDR.LIB d efines the stru ctu re of the memory-based nam ed directory. It also
defines a few elements fo r it and is suitable for enclosure in an N D R file. The general
structure is:
DB Disk,User A=1
DB 'NDIRNAME' 8 chars
DB •PASSWORD' 8 chars
• • • other entries
DB 0 End of NDR
macro ?disk,?user
db ?disk-'§' ; Convert Disk
db ?user ; User is OK
endm
The entire file is im plem ented as one macro (w hich follows). The SYSNDR.ASM
file simply refers to this macro and expands it.
The nam ed directories shown below are recom m ended standards. In time, there
will be utilities w hich base a p art of th e ir operations on these names.
sysndr macro
The BASE d irec to ry is a w orking scratch area on the f irs t disk.
defdu 'A',0
db 'BASE '
db ' '
The RO OT d irec to ry is the last directory referen ced in the Com m and Search Path.
This is where all the general purpose COM files are located.
defdu •A’,15
I
db 'Root
db I
300 In s ta lla tio n Sec. 3
The H ELP directory is where the online docum entation files are stored.
defdu 'A1,16
db 'HELP' '
db ' '
The BA CK U P directory is where files are copied to (by d efau lt) for backup purposes.
defdu 1C 1,O
db 'BACKUP '
db ' •
db 0 ;End of List
endm
TCAP Files
The program s TSELECT and TCM A KE are used to create the *.Z3T files which
are loaded by the LDR.COM utility. The loaded file establishes the characteristics of
the user’s C R T term inal, and this in fo rm a tio n is used by screen-oriented utilities, such
as SHOW, to p e rfo rm th e ir functions.
Environment Descriptor
The follow ing is a re fo rm a tte d duplicate of the body of a SYSENV.LIB file. It is
provided here to present ad d itio n al in fo rm atio n on how to set the equates. It may be
useful to the installer to have this installation m anual open to these pages w hile he is
editing this file.
The entire file is one macro w hich is referenced by SYSENV.ASM. SYSENY
inserts a JMP 0 instru ctio n in f ro n t of this macro to complete the s tru ctu re of the
SYS.ENV file.
LIBRARY: SYSENV.LIB
AUTHOR: Richard Conn
Version: 1.0
Date: 18 May 84
Previous Versions: None
SYSENV is the d e fin itio n fo r my ZCPR3 environm ent.
sysenv macro
t
; Environment Descriptor
; If inline, there is a leading JMP just before this
t
envorgl:
db 'Z3ENV' ; Environment ID
db 1 ; class 1environment (external)
C hap. 20 S te p 7 : S y ste m S egm ent In s ta lla tio n 301
A Class 1 environm ent is external to the u tility using it. This type of
Environm ent D escriptor is located at a b u f f e r somewhere in memory, and the ZCPR3
utilities simply contain a 2-byte pointer to its address. A Class 2 environm ent is
internal to the u tility using it. This type of E nvironm ent D escriptor is located within
the u tility itself, taking up 256 bytes. It is recom m ended th a t the ZCPR3 System be
configured using an external E nvironm ent Descriptor.
The follow ing addresses and values are extracted from Z3BASE.LIB.
dw expath •
r external path address
db expaths / number of 2-byte elements in path
•
dw rep •
9 RCP address
db reps •
9 number of 128-byte blocks in RCP
dw iop •
9 IOP address
db iops •
9 number of 128-byte blocks in IOP
db fcps •
9 number of 128-byte blocks in FCP
dw z3ndir •
9 NDR address
db z3ndirs •
9 number of 18-byte entries in NDR
dw z3cl •
9 ZCPR3 Command Line
db z3cls •
9 number of bytes in Command[ Line
dw z3env •
9 ZCPR3 Environment Descriptor
db z3envs •
9 number of 128-byte blocks
dw shstk •
/ Shell Stack address
db shstks •
9 number of shsize-byte entires
db shsize •
9 size of a Shell Stack entry
dw z3msg •
9 ZCPR3 Message buffer
dw extfeb •
9 ZCPR3 External FCB
dw extstk •
9 ZCPR3 External Stack
The follow ing flag is used by some ZCPR3 System utilities to determ ine how
verbose they are in providing messages and in fo rm a tio n to the user. The QUIET.COM
u tility can be used to change this flag dynam ically.
302 I n s ta lla tio n Sec. 3
db 80 • width of CRT 0
t
db 24 • number of lines on CRT 0
/
db 22 7 number of lines of text on CRT 0
db 80 7 width of Printer 0
db 66 •
t number of lines on Printer 0
db 58 •
t number of lines of text on Printer 0
db 1 •
/ form feed flag (0=(san't formfeed, l=can)
db 102 •
/ width of Printer 1
db 66 •
/ number of lines on Printer 1
db 58 •
/ number of lines of text on Printer 1
db 1 •
/ form feed flag (0=.zan't formfeed, l=can)
C hap. 20 S te p 7 : S y ste m S eg m en t In s ta lla tio n 303
db 80 9
•
width of Printer 2
db 66 / number of lines on Printer 2
•
db 58 9
•
number of lines of text on Printer 2
db 0 7 form feed flag (0=can't formfeed, 1=
The ZCPR3 shell nam ed SH can deal w ith symbols (variables) w hich are assigned
text strings as values. This b u f f e r defines the name of the file w hich programs like SH
refer to in order to resolve variable references. As m any shell variable files as desired
may be available in this fashion.
db 'SH i •
9 shell variable filename
db 'V A R ' •
9 shell variable filetype
These b u f f e r s are available to store file names and other d ata w hich are passed
from one u tility to an o th er which is executed later. In general, entries 3 and 4 are
available to the ZCPR3 u tility program m er as general-purpose b u ffers. Entries 1 and
2 are used by some ZCPR3 System utilities at this time.
db 1 1 •
9 filename 1
db 1 1 •
9 filetype 1
db 1 1 •
9 filename 2
db 1 1
9 filetype 2
db 1 1 •
9 filename 3
db 1 1
/ filetype 3
•
db 1 1 •
9 filename 4
db 1 1 •
9 filetype 4
envorg2
DB 'TVI 950 ;Name of Terminal
DB 1K '- 1@ 1 ;Cursor UP
DB /Cursor DOWN
DB *L '— '@ ' /Cursor RIGHT
DB 'H '- 1@ 1 /Cursor LEFT
DB 00 /CL Delay
DB 00 /CM Delay
DB 00 /CE Delay
DB lbh,'*',0 /CL String
DB lbh,'=%+ %+ ',0 /CM String
DB lbh,'t',0 /CE String
DB lbh,') ',0 /SO String
DB lbh,'(',0 /SE String
DB 0 /TI String
DB 0 /TE String
endm
C hap. 21 S te p 7 : S y ste m S egm ent In s ta lla tio n 305
T he Z3IN S U tility
The Z3INS u tility is designed to make the ZCPR3 u tility installation process
simple. All files to be installed must be in the c u rre n t directory when Z3INS is
executed. A *.ENV file fo r the target system an d an installation file (*.INS)
containing the names of the programs to be installed must also be in the current
directory.
Z3INS reads in an E nvironm ent D escriptor file (*.ENV) and an Installation File
(*.INS). It then looks fo r lines in the file containing file names (one nam e per line) and
loads the in d icate d files, trying to install them w ith the E nv iro n m en t Descriptor
inform ation. Z3INS is invoked by a com m and line of the follow ing form:
Z3INS mysys.ENV myinstal.INS
A ZCPR3 installation file is a text file containing two types of lines: a comment
line, w hich begins w ith a semicolon (;), and a line containing an unam biguous file
name (leading spaces are not significant), which is a file to be installed. For example:
; This is an installation file for my new utilities
; UTIL1.COM and UTIL2.COM are going to be installed —
utill.com
util2.com
; UTIL3 is really neat
util3.com
Case is not significant. Leading spaces on each line are ignored. Any file name
must be unam biguous. Listing 21-1, w hich follows, shows a sample session in which
Z3INS installs a system, using a previously prepared *.INS file. Listing lines th a t begin
w ith a semicolon are e xplanatory comments and are not displayed on the console.
Sample Session
Bl:ASM>z3ins sys.env zcpr3.ins
Z3INS Version 1.0
7
; Installation Begins —
« D etail L eft O ut »
Set 1
.
9 Set 2 : Error Handlers
9
;note.com
9
; Set 9: Z3INS
.
'
** Installing File Z3INS .COM
/
; End of ZCPR3 Installation
7
** Installation Complete **
HELPPR P R IN T
22 TCAP Facility
to highlight chars
to initialize and d einitialize the term inal
The follow ing is the exact s tru ctu re of a Z3T file:
name:
DS 16 ; Name of Terminal
arrows:
DS 4 ; Bytes generated by arrow keys
delays:
DS 3 ; Delays for Screen Clear, Cursor Motion, and
; Clear to End-of-Line
DB 'ADM 2 '
Arrow Keys
Structure:
DS 1 •
9 Byte Generated by Cursor UP
DS 1 9
•
Byte Generated by Cursor DOWN
DS 1 •
I Byte Generated by Cursor RIGHT
DS 1 9
•
Byte Generated by Cursor LEFT
Comment:
If your te rm in al has arrow keys on it which generate only one byte when depressed,
then these keys may be d efin e d in the Z3T file. When a program calls for the use of
arrow keys, it will use the values stored here.
I f your te rm in al does not have arrow keys or has arrow keys w hich generate more
than one byte when depressed, these keys may not be d e fin e d in the Z3T file. Zero (0)
is stored in all f o u r bytes of the "arrow key" record. In this case, the program will
respond to the WordStar (tradem ark, M icropro) arrow key convention (AE is UP, AX is
DOWN, AD is R IG H T , and AS is LEFT):
Examples:
DB 'K '-'@ ' ADM 31 AK for Cursor UP
DB ij i _ i@ i AJ for Cursor DOWN
DB 'L '- '@ ' AL for Cursor RIGHT
DB 'H '- '@ ' AH for Cursor LEFT
%R Command
The cursor m otion sequence in te rp re te r assumes th a t the value of the row will be
output before the value of the column. If the column is to be first, the com mand
’%r’ or ’% R’
instructs the cursor motion sequence in te rp re te r to ou tp u t the column and then the
row. The ’% R’ com m and must be present in the sequence before the firs t value is
output, and ’% R’ acts solely to com mand the in te rp re te r (no bytes are ou tp u t by ’%R’).
314 In s ta lla tio n Sec. 3
%I Command
The cursor m otion sequence interpreter also assum es that the value o f the home
position is row 0, colum n 0. If it is con v en ien t to set this position to row 1, colum n 1,
the com m and
’%i’ or ’%r
is used. L ike ’%R’, ’%I’ must be used b efore the fir st value is output.
The TY I 950 can be d e fin e d in tw o ways:
DB 1BH,'=%+ %+ ',0
or
DB 1BH,1%i=%+',1FH,1%+',1FH,0
O utput Commands
The rest of the cursor m otion sequence interpreter com m ands deal w ith the form at
o f the output. T h ey allow the fo llo w in g types o f outputs:
%. binary valu e (AA is output as 1)
%2 2 ASCII D ecim al D ig its (AA is output as ’01’)
%3 3 ASCII D ecim al D ig its (AA is output as ’OOT)
%d As m any ASCII D ecim al D ig its as needed (AA as ’T)
%+n A dd o ffs e t (’%+ ’ outputs AA as 1+’ ’ or ’!’)
%>xy Add o ffs e t i f lim it reached (’%> 1 outputs AA as 1 and !’as")"
Exam ples:
DB 1BH,'Y%+ %+ 1,0 ; ADDS Viewpoint
Structure:
DS N3 ; Bytes in clear to end of line sequence
DB 0
Comments:
The Clear to End o f Line sequence is used to clear the lin e starting at the cursor
position to the end o f the screen. O nly this part o f the current lin e is cleared. The rules
for sp e c ify in g th is sequence are the same as those for Screen Clear.
Example:
DB 1BH,'T',0 ; ADM 2
Begin and End Highlighting
Sequences:
DS N4 ; Bytes in sequence to begin highlighting
DB 0
O verview o f VLIB
VLIB (V id eo LIBrary) is the ZCPR3 library that provides the ZCPR3 programmer
w ith a series o f lo w -lev el routines for Z3TCAP access. VLIB is described in m uch more
d eta il in the VLIB.HLP f ile , and th is o v erview serves only to sum m arize its
cap ab ilities.
The VLIB routine Z 3V IN IT in itia liz e s VLIB for use w ith a ZCPR3 system . The
address o f the ZCPR3 environ m ent descriptor is passed to the Z 3V IN IT routine in HL,
and from that tim e onw ard all VLIB routines know the address o f the Z3TCA P entry.
Some lo w -lev el fu n c tio n s provided by VLIB are:
R o u tin e F u n ction
T IN IT I n itia liz e term inal
D IN IT D e in itia liz e term inal
G O TO X Y P osition Cursor
Syntax:
TCCHECK
where this alternate form may be used to check
C h a p . 22 T C A P F a c ility 319
B4:SCR2>tccheck
TCCHECK, Version 1.0 File Z3TCAP .TCP Not Found - Aborting
Note: Z3TCAP.TCP MUST be in the same directory
B4:SCR2>tccheck root:z3tcap.tcp
TCCHECK, Version 1.0 File Z3TCAP .TCP Not Found - Aborting
Note: TCCHECK does not recognize named dirs
B4:SCR2>root:
A15:ROOT>tccheck
TCCHECK, Version 1.0
Z3TCAP File Check of Z3TCAP .TCP Version 1.1
File Checks with 44 Terminals Defined
TCAP Entry Definition Program
TCM AKE is used to create a *.Z3T file . Once created, the ZCPR3 u tility LD R can
load it into m em ory at the proper location (com m and is "LDR filen am e.Z 3T ”). A
sam ple run o f TCM AK E is show n below .
B4:SCR2>tcmake //
TCMAKE, Version 1.0
TCMAKE - Create a Z3T File
Syntax:
TCMAKE outfile -or- TCMAKE outfile.typ
B4:SCR2>tcmake myterm2
TCMAKE, Version 1.0
Command? 2
Command? 6
Command? S
Command? 1
Review of Clear Screen Definition
1. Timing Delay = 0 Milliseconds
2. Clear Screen Sequence:
(1) A [ 1BH (2) * 2AH
Strike Any Key to Continue -
Command? 2
Command? 6
Command? X
7 . Terminal Name
Command? X
Selected Terminal is: Rick's Terminal — Confirm (Y/N)? Y
File MYTERM2 .Z3T Created
TCAP Entry S election Program
TCSELECT selects a term inal from the standard Z3TCAP file . The selected
term inal m ay be loaded d irectly into m em ory or a *.Z3T f ile m ay be created. If a
*.Z3T f ile is created, the ZCPR3 u tility LD R can load it into m em ory at the proper
location (com m and is "LDR filenam e.Z3T"). A sam ple run o f TCSELECT follow s.
B4:SCR2>tcselect //
TCSELECT, Version 1.0
TCSELECT - Select Entry from Z3TCAP.TCP
Syntax:
TCSELECT
B4:SCR2>tcselect myterm
TCSELECT, Version 1.0
A. VC 404
B. VC 415
C. Visual 200
D. WYSE 50
.
D. ADDS Viewpoint N. DEC VT52
E. ADM 2 0 DEC VT100
F. ADM 31 P. Dialogue 80
G. ADM 3A Q. Direct 800/A
H. ADM 42 R. General Trm 100A
I. Bantam 550 S. Hazeltine 1420
J. CDC 456 T. Hazeltine 1500
.
D. H19 (Heath Mode) N. TAB 132
E. HP 2621 0 Teleray 1061
F. IBM 3101 P. Teleray 3800
G. Micro Bee Q. TTY 4424
H. Microterm ACT IV R. TVI 912
I. Microterm ACT V S. TVI 920
J. P Elmer 1100 T. TVI 950
Glossary of Term s
Absolute Path
A path w h ich is expressed in exact term s w ith no rela tiv e disk or user area
referen ces. A path lik e "Al A15" is an absolute path. See R E L A T IV E PATH.
Ada
The standard program m ing language for Em bedded Com puter System s in the US
D epartm ent o f D efen se. Pascal is A d a’s prim ary ancestor, but Ada has m any
exten sion s over con ven tion al Pascal.
Alias
A program w h ich expands into a sequence o f com m ands w ith param eter
su b stitu tion from the origin al com m and line. Such a program is created by the
ALIAS Tool.
BDOS
The Basic D isk O perating System part o f C P /M or ZCPR3. T his is the part o f the
operating system w h ich m anages the file s and provides som e h igh er-level
in p u t/o u tp u t fu n ction s.
BIOS
The B asic In p u t/O u tp u t System part o f C P /M or ZCPR3. T h is is the part o f the
operating system w h ich m anages the d evices and provides a lo w -lev el, m achine-
in d ep en d en t in te r fa ce to the disks and character-orien ted in p u t/o u tp u t devices.
Boot, Cold
The process o f in itia liz in g the operating system w hen the com puter is fir st turned
on. The BIOS contains a cold boot routine w h ich is used to in itia liz e m any features
o f the system , in clu d in g several o f the ZCPR3 b u ffers.
Boot, Warm
T he process o f r e in itia liz in g the operating system at some tim e a fter it has begun
execu tion . The BIOS contains a warm boot routine, but this routine does not
u su ally have any e ff e c t on the ZCPR3 environ m ent excep t for reloading the
ZCPR3 Com m and Processor from disk.
CBIOS
C ustom ized Basic In p u t/O u tp u t System . T his is a term used to represent the BIOS
w h ich has been adapted for a particular m icrocom puter. See BIOS.
COM File
A n execu tab le binary im age w h ich execu tes at m em ory location 100H and is loaded
from disk by the ZCPR3 Command Processor. Once loaded, a COM f ile is called by
the ZCPR3 Command Processor lik e a subroutine.
Command
A statem ent issued by the user or a program w h ich results in a program to be
execu ted . A com m and consists o f a verb fo llo w e d by zero or more argum ents. The
verb u n iq u ely id e n tifie s the name o f the program to execute.
329
330 A p p e n d ix A G lo ssary o f T erm s
Process
A program in execu tion . A program is a passive en tity , w h ich is sim ply an
expression o f a sequence o f com m ands. A process is an activ e en tity w h ich can
cause p h ysical a c tiv ity to occur, such as devices engage. See PROGRAM .
Process M anagem ent
The control o f the processes inside a com puter system . The C P /M and ZCPR3
operating system s do very little in the w ay o f process m anagem ent aside from
loadin g a program and causing it to execute. See PROCESS.
Program
An expression o f a sequence of com m ands that m ay be translated into a form that
can be execu ted on a com puter. See PROCESS.
R elative P ath
A sequence o f directory referen ces that includ es at least one entry w hose disk or
user area referen ce is represented by a "$" character, w h ich refers to the disk or
user area w h ich is curren tly logged into. The resolution o f a rela tiv e path depends
upon the location o f the user w hen he issues a com m and, and the absolute
expression o f this path is based upon the location o f the current directory.
R esident Command P ackage
A co llectio n o f routines w h ich are located in m em ory and m ay be in vok ed by the
ZCPR3 Com m and Processor as needed. See PA C K A G E and FLOW COM M AND
PA CK AG E.
Script
A textu al expression that is translated into a series o f one or more com m ands. An
A lias generates a script.
S h ell
A fron t end program w h ich accepts com m ands from the user and preprocesses
these com m ands b efore passing them on to the ZCPR3 Com m and Processor for
resolution and execu tion . Y FIL ER and SH are tw o d iffe r e n t Shells under the
ZCPR3 System .
Sym bolic P ath
See R E L A T IV E PATH.
Tool
A program w h ich is used to perform a u sefu l fu n c tio n in a general-purpose sense.
A ll o f the ZCPR3 programs are tools, as opposed to games.
Tool Set
A co llectio n o f tools, w here the tools are usu ally related in fu n c tio n a lity or
operation to each other.
V irtual M achine
A m achine w h ich exists at a higher lev e l o f abstraction than the actu al physical
m achine w h ich is supporting it. The virtu al m achine concept is used to raise the
d etails o f in te r fa cin g w ith a m achine to a higher lev el o f abstraction so that the
in tim ate d etails o f a m achine need not be o f concern.
A p pendix C
References
The fo llo w in g sections ou tlin e other sources o f in form ation on ZCPR2, ZCPR3,
SYSLIB2, and SYSLIB3 that m ay be u sefu l to the in stallers and users o f ZCPR3.
ZCPR2 Manuals
Conn, R ichard. ’Concepts M anual for ZCPR2 — Z80 Com m and Processor
R ep lacem ent, V ersion 2,’ Manual Revision 0 , 3 February 1983, 21 pages.
Conn, R ichard. ’Installation Instructions for ZCPR2 — Z80 Com m and Processor
R ep lacem ent, V ersion 2,’ M anual Revision 0 , 2 February 1983, 48 pages.
Conn, R ichard. ’R ation ale M anual for ZCPR2 — Z80 Com m and Processor
R ep lacem ent, V ersion 2,’ Manual Revision 0 , 26 February 1983, 65 pages.
Conn, R ichard. ’U ser’s G uide for ZCPR2 — Z80 Com m and Processor
R ep lacem ent, V ersion 2,’ Manual Revision 0 , 4 February 1983, 138 pages.
SYSLIB2 Manuals
Conn, R ichard. SYSLIB User and R eference Manual fo r SY SL IB Version 2.4, 4
February 1983, 112 pages.
Conn, R ichard. U ser’s Guide to SY SL IB 2.3, R evision B, 14 D ecem ber 1982, 56
pages.
Sources
C ontact the fo llo w in g sources for copies (on disk or hard copy, dep en d in g on the
source) o f the ab ove-m ention ed docum entation.
SIG /M (disks)
N ew York A m ateur Com puter Club (hardcopy)
SIM TEL20 (D D N access)
335
336 A p p e n d ix C R eferences
C P/M Books
The follow ing books on C P /M are recommended.
Hogan, Thom. Osborne C P / M User Guide, O sborne/M cG raw -H ill, 1981,283 pages.
Johnson-L aird, Andy. The Programmer’s C P / M Handbook, O sborne/M cG raw -H ill,
1983, 501 pages.
ZCPR3 Sources
The follow ing are the addresses of sources fo r in fo rm a tio n on ZCPR2, ZCPR3,
SYSLIB2, and SYSLIB3.
Echelon, Inc.
Echelon, Inc
101 F irst Street
Los Altos, CA 94022
(415)948-5321
Echelon, Inc has been selected as exclusive agent fo r licensing com mercial uses of
ZCPR3. Companies who wish to incorporate ZCPR3 into th e ir products should contact
Echelon fo r licensing arrangem ents.
Echelon also distributes ZCPR3 (including SYSLIB3) fo r non-com m ercial use.
In d iv id u al users may obtain copies of the programs fo r essentially cost of disks plus
han d lin g and m ailing expenses.
Echelon will soon provide a com puterized bulletin board service in support of
ZCPR3. In fo rm a tio n on how to acquire a copy of the system, upgrades and changes to
A p p e n d ix C R eferences 337
the system, a n d general u s e r/c re a to r feedback and com m unication will be supported
by this bulletin board.
At irreg u lar intervals Echelon d istributes a ZCPR3 N ew sletter to customers who
have purchased ZCPR3 or SYSLIB. It provides news of updates, bugs and their fixes,
and hints and tips fro m users.
Cable: N Y Z O E T R O PE , N.Y.
Source: TCN 121
New Y ork Zoetrope, Inc, is the publisher of the hardcopy docum entation on
ZCPR3 and SYSLIB3. Contact New York Zoetrope for details.
T here are a grow ing num ber of ZCPR3 bulletin boards sprouting up. Watch for
them and th e ir screen-oriented displays.
C hristensen Protocol:
For a micro to reliably exchange files w ith a m a in fram e , cooperating file tran sfer
program s w ith autom atic error detection and retransm ission of f a u lty blocks must be
ru n n in g on both computers. One such fam ily of programs uses a popular protocol
created by Ward Christensen and enhanced by others. Two popular programs, UC and
the older UM ODEM (both w ritten in C), im plem ent this protocol on U N IX machines.
On ITS machines, file tra n s fe r using the Christensen protocol can be done using
MMODEM (type rMMODEM fo r instructions), or LMODEM. D ocum entation for
LM ODEM is in file w hich types an ASCII file stored in ITS b in a ry form at; TYPESQ,
w hich types an ITS b in a ry fo rm a t "squeezed" file (see the firs t p arag rap h un d er FILE
TYPES); USQ, w hich creates an unsqueezed version o f a squeezed file; H EX IFY ,
w hich creates an Intel hex fo rm a t file fro m an ITS b in a ry fo rm a t COM file; COMIFY
w hich creates a COM file fro m an Intel hex file; and CRC, w hich computes the Cyclic
R ed u n d a n c y Check value for a file, using the same algorithm th a t is used by the C P/M
program CRCK. B rief instructions for any of these utilities except LMODEM can be
o b tained by typing f u t i l i t y _name" (for example, :CRC).
Several other u tilities fo r tra n s fe rrin g and m a n ip u latin g files are commonly
available for TOPS-20 and V A X /V M S systems. Y our local system support people
should be able to tell you about the available programs.
Kerm it:
A nother excellent program for tra n s fe rrin g files is called K ERM IT. This
program has the advan tag e of being available for an im pressively large num ber of
m a in fram e s and micros. It is, fo r example, available fo r the IBM-PC, and it DOES
N O T req u ire CP/M.
C hristensen Protocol:
An excellent program for tra n s fe rrin g files between micros, or between micros
and m a in fram e s is called MODM7xx, where the "xx" is replaced w ith two digits to give
the c u rre n t version num ber. This program, o ften re fe rre d to as MODEM7 (the name of
its easier to pronounce ancestor), uses the popular Christensen protocol to tran sfer
files w ith autom atic erro r detection and retransm ission of erroneous blocks.
339
340 A p p e n d ix D O b ta in in g F re e S oftw are
A nd then, there is MEX. MEX stands fo r "modern executive", and it is just w hat
the name implies, a com m unications and file -tra n s fe r program w ith a built-in mini
operating system th a t runs u nder CP/M. This program can do file tran sfers using
either the C hristensen or CompuServe protocol, and it has an enormous potential for
highly au tom ated operations because it can read and execute com m and-scripts p re
stored in disk files. These scripts can include sending commands to a remote com puter,
as if they had been sent m anually from the m icrocom puter in term inal-m ode. Users of
this relatively new program are still exploring its possibilities.
K ermit:
As stated earlier, K E R M IT is also an excellent program for tra n s fe rrin g files
between computers. It, too, does autom atic error detection and retransm ission, and it
works between m ainfram es and micros, between micros, and between m ainfram es. See
the earlier "Kermit" p arag rap h fo r details.
G etting Started:
In order to get MODM7xx, MEX or K E R M IT ru n n in g on your micro, you must
first tra n s fe r the necessary files fro m m a in fram e to micro. If you already have a
receive-to-disk com m unications program of some sort, you can use it to move the
needed files. It is V ER Y C O N V E N IE N T to be able to tra n s f e r 8-bit bin a ry files,
although in most cases it is not absolutely necessary. Some of the files are quite large.
For example, MODM7xx.COM is over 18K bytes, and the H E X file (w hich you will
need if you c a n ’t tra n s fe r 8-bit files) is over 45K. Moving large files to your micro
w ithout using an error detecting protocol can result in fr u s tr a tin g errors, but it can be
done by receiving m ultiple copies and using m anual or m achine-assisted comparisons
to locate and rep air bad parts of the code.
M AGAZINE ARTICLES
The follow ing m agazine articles are highly recom m ended fo r those who have
never used an R C P /M system before to dow nload or upload files.
Tony Bove, Cheryl Rhodes, and Kelly Smith. ’Calling Bulletin Boards for Free
S o ftw are’, User’s Guide magazine, Issues 11/12, Vol 2.5/2.6, Decem ber 1984.
Tony Bove, Cheryl Rhodes, and Kelly Smith. ’Using Modem7 (MDM720)’, User’s
Guide magazine, Issues 11/12, Vol 2.5/2.6, December 1984.
Benjam in Cohen. ’Free Softw are, The Newest Modem 7 (MDM740)’, User’s Guide
magazine, Issues 11/12, Vol 2.5/2.6, December 1984.
K im Levitt. ’Phone List of R C P /M Bulletin Board Systems, R evision 50’, User’s
Guide magazine, Issues 11/12, Vol 2.5/2.6, December 1984.
’Free Software: G etting I t’, User’s Guide magazine, Issues 11/12, Vol 2.5/2.6,
December 1984.
A p p e n d ix D O b ta in in g F re e S oftw are 341
by D avid L. Mix
In your m anual look for the way to establish a connection between your computer and
the R C P /M , and the section on "XMODEM" or "MODEM" Protocol. This protocol gives
you autom atic high-level error-checking to assure th a t you get files that are not
a f f e c te d by telephone line noise. Almost all boards w ork w ith 300 baud, and many
now w ork w ith 1200 baud. I f you a r e n ’t sure, try 300 baud, or just use the default.
U sually the other d efau lts w ork w ith Bulletin Boards, so fo r now skip the other
technical m atters. Expect to supply your Name, Address, and a password you can
remember. From page 338 of this book, get the phone num bers of some local boards. In
my tra in in g sessions w ith beginners, we have a saying, "Read the Fine Screen" or,
"RFS". I f you get stuck, the in fo rm atio n is usually on the screen. This is important,
since d if f e r e n t boards o f f e r a rich varie ty of ways to do the same thing. Once you get
started, it adds to your learning. Most boards have some k in d of HELP. You can see
m any of the com m ands you will need by using D IR on the A drive. Files for you to
tra n s f e r are on the B or higher drives.
Most boards need you to h it the R E T U R N key tw ice either before or a fte r they
id e n tif y themselves. I f you are asked "How m any nulls do you need?", answ er with the
num ber zero. A Welcome Message will tell you things you need to know to get to CP/M.
A fte r you get to C P /M on the board, build your confidence by changing to the B drive
w ith ’B:’. Look over th a t User Area w ith DIR, or D IR $AD *.* for everything on all
drives. Files th a t end in .OBJ have been renam ed fro m .COM. You will not be able to
use all com mands like the com mand to erase, ERA, fo r obvious security reasons. You
will be able to TY PE a screenfull or two of files ending in .DOC or Docum entation
Files fo r in fo rm a tio n about using related programs. To actually get a program, pick a
short file, and issue this com mand to the Board: XMODEM S FILENAME. When the
board is ready it will reply w ith a message giving you the file size and tra n sfe r time.
If you are using MODEM7 softw are, use C TRL E, then R FILEN A M E, autom atically
changing to X m odem Protocol on your end. With some softw are, you will have to
sw itch to X m odem Protocol on your end. You get o f f the board by typing BYE or G.
1. Name Date
S t r e e t ___________________________ T e le p h o n e ___________
3. Disk form at: 8 inch SSSD IBM 3740 stan d ard (yes/no)
or
5 1/4 inch, 40 tracks, soft-sectored, single-sided double-density: (yes/no)
C om puter form at: _ K ay p ro _ Osborne 1 1 Epson QX-10 H e a th /Z e n ith 89/90/100
(check one) J A mpro [ J Morrow [J Apple C P /M L N o rth s ta r C P /M (hard)
4. Ordering:
Item N um ber & Name Q u a n tity U n it Price Extension
Subtotal $
Total enclosed
Send orders to:
NEW Y O R K Z O E T R O P E
Suite 516/80 East 11th Street
New York, NY 10003
Index