SECTION 14
14. Summary of Major CP/M 3.0 Commands
As noted in section 11, a CP/M 3.0 command line consists of a command keyword, an optional command tail and a {return} keystroke. This section describes the two kinds of commands the command keyword can identify, and summarizes individual commands and their functions. The section also gives examples of the use of some of the more commonly used commands. In addition, the section explains the concept of logical and physical devices under CP/M 3.0. This section then tells how CP/M 3.0 searches for a program file on a disk, tells how to execute multiple commands, and how to reset the disk system. Finally, the section explains how to use the HELP command to get information on various CP/M topics including command formats and usage, right at the keyboard.
14.1 THE TWO TYPES OF CP/M 3.0 COMMANDS
There are two types of commands on CP/M 3.0:
- Built-in commands - which identify programs in memory
- Transient utility commands - which identify program files on a disk
CP/M 3.0 has six built-in commands and over 20 transient utility commands. You can add utilities to your system by purchasing various CP/M 3.0-compatible application programs. If you are an experienced programmer, you can also write your own utilities that operate with CP/M 3.0.
14.2 BUILT-IN COMMANDS
Built-in commands are part of CP/M 3.0 that are always available for your use, regardless of which disk your have in which drive. Built-in commands are entered in the computer's memory when CP/M 3.0 is loaded, and are, therefore, executed more quickly than the transient utilities. Table 14-1 lists the Commodore 128 CP/M 3.0 built-in commands.
Some built-in commands have options that require support from a related transient utility. The related transient utility command has the same name as the built-in command and has a filetype of COM.
Table 14-1. Built-in Commands.
Command
|
Function |
DIR
|
Displays filenames of all files in the directory except those marked with the SYS attribute. |
DIRSYS
|
Displays filenames of file marked with the SYS (system) attribute in the directory. |
ERASE
|
Erases a filename from the disk directory and releases the storage space occupied by the file. |
RENAME
|
Renames a disk file. |
TYPE
|
Displays contents of an ASCII (TEXT) file at your screen. |
USER
|
Changes to a different user number. |
14.3 TRANSIENT UTILITY COMMANDS
The CP/M 3.0 transient utilities are listed in Table 14-2. When you enter a command keyword that identifies a transient utility, CP/M 3.0 loads the program file from the disk and passes to that file any filenames, data, or parameters you entered in the command tail.
DIR, RENAME and TYPE are built-in commands which have optional transient extensions.
Table 14-2. Transient Utility Commands.
DATE
|
Sets or displays the date and time. |
DEVICE
|
Assigns logical CP/M devices to one or more physical devices, changes device driver protocol and baud rates, or sets console screen size. |
DIR
|
Displays directory with files and their characteristics. |
DUMP
|
Displays a file in ASCII and hexadecimal format. |
ED
|
Creates and alters ASCII files. |
ERASE
|
Used for wildcard erase. |
FORMAT
|
Formats a CP/M disk. Clears data from previous used disks. |
GENCOM
|
Creates a special COM file with attached RSX file. |
GET
|
Temporarily gets console input from a disk file rather than the keyboard. |
HELP
|
Displays information on how to use CP/M 3.0 commands. |
INITDIR
|
Initializes a disk directory to allow time and date stamping. |
KEYFIG
|
Allows alteration of the definition of the keyboard keys. |
PATCH
|
Displays or installs patches to the CP/M system. |
PIP
|
Copies files and combines files. |
PUT
|
Temporarily directs printer or console output to a disk file. |
RENAME
|
Changes the name of a file, or a group of files using wildcard characters. |
SAVE
|
Copies the contents of memory to a file. |
SET
|
Sets file options including disk labels, file attributes, type of time and date stamping and password protection. |
SETDEF
|
Sets system options including the drive search chain. |
SHOW
|
Displays disk and drive statistics. |
SUBMIT
|
Automatically executes multiple commands. |
TYPE
|
Displays contents of text file (or group of files, if wildcard characters are used) on screen (and printer if desired). |
14.4 REDIRECTING INPUT AND OUTPUT
CP/M 3.0's PUT Command allows you to redirect console or printer output to a disk file. You can use a GET command to make CP/M 3.0 or a utility program take console input from a disk file. The following examples illustrate some of the capabilities offered by GET and PUT.
You can use a PUT command to direct console output to a disk file as well as to the console. With PUT, you can create a disk file containing a directory of all files on that disk, as shown in Figure 14-1.
Figure 14-1. PUT Command Example.
A>PUT CONSOLE OUTPUT TO FILE DIR.PRN
PUTTING CONSOLE OUTPUT TO FILE: DIR.PRN
A>DIR
A: FILENAME TEX : FRONT TEX : FRONT BAK : ONE BAK : THREE TEX
A: FOUR TEX : ONE TEX : LINEDIT TEX : EXAMP1 TXT : TWO BAK
A: TWO TEX : THREE BAK : EXAMP2 TXT
A>TYPE DIR.PRN
A: FILENAME TEX : FRONT TEX : FRONT BAK : ONE BAK : THREE TEX
A: FOUR TEX : ONE TEX : LINEDIT TEX : EXAMP1 TXT : TWO BAK
A: TWO TEX : THREE BAK : EXAMP2 TXT
A GET command can direct CP/M 3.0 or a program to read console input from a disk file instead of from the keyboard. If the file is to be read by CP/M 3.0, it must contain standard CP/M 3.0 command lines. If the file is to be read by a utility program, it must contain input appropriate for that program. A file can contain both CP/M 3.0 command lines and program input if it also includes a command to start a program.
14.5 ASSIGNING LOGICAL DEVICES
The minimal Commodore 128 CP/M 3.0 hardware includes a console consisting of a keyboard and screen display and a 1571 disk drive. You may want to add another device to your system, such as a printer or a modem. To help keep track of these physical different input and output devices, Table 14-3 gives the names of CP/M 3.0 logical devices. It also shows the physical devices assigned to these logical devices in the Commodore 128 CP/M 3.0 system.
Table 14-3. CP/M 3.0 Logical Devices.
Logical Device Name
|
Device Type
|
Physical Device Assigment |
CONIN:
|
Console input
|
Keyboard |
CONOUT:
|
Console output
|
80-column Screen |
AUXIN:
|
Auxiliary input
|
Null |
AUXOUT:
|
Auxiliary output
|
Null |
LST:
|
List output
|
PTR1 or PTR2 |
You can change these assigments with a DEVICE command. For example, you can, assign AUXIN and AUXOUT to a modem so that your computer can use telephone lines to communicate with other computer users, with information service like Compunet and View Data Systems.
14.6 FINDING PROGRAM FILES
If a command keyword identifies a utility, CP/M 3.0 looks for that program file on the default or specified drive. It looks under the current user number, and then under user number 0 for the same file marked with the SYS attribute. At any point in the search process, CP/M 3.0 stops the search if it finds the program file. CP/M 3.0 then loads the program into memory and executes it. When the program terminates, CP/M 3.0 displays the system prompt and waits for your next command. However, if CP/M 3.0 does not find the command file, it repeats the command line followed by a question mark, and waits for your next command.
14.7 EXECUTING MULTIPLE COMMANDS
In the examples so far, CP/M 3.0 executed only one command at a time. CP/M 3.0 can also execute a sequence of commands. You can enter a sequence of commands at the system prompt, or you can put a frequently needed sequence of commands in a disk file, using the filetype of SUB. Once you have stored the sequence in a disk file, you can execute the sequence whenever you need to with a SUBMIT command.
14.8 TERMINATING PROGRAMS
You can use the two keystroke command CTRL-C to terminate program execution or reset the disk system. To enter a CTRL-C command, hold down the {ctrl} key and press {c}.
Most application programs that run under CP/M and most CP/M transient utilities can be terminated by a CTRL-C. However, if you try to terminate a program while it is sending a display to the screen, you may need to press a CTRL-S to halt the display before you enter CTRL-C.
14.9 GETTING HELP
CP/M 3.0 includes a transient utility command called HELP that displays a summary of the format and use for the most common CP/M commands. To access HELP, simply enter the command:
A>HELP {return}
You can press the {help} key instead of typing the word HELP and pressing the {return} key.
The list of available topics is then displayed, like this:
Topics available:
COMMANDS CNTRLCHARS DATE DEVICE DIR
DUMP ED ERASE FILESPEC GENCOM GET
HELP HEXCOM INITDIR LIB LINK MAC
PATCH PIP (COPY) PUT RENAME RMAC SAVE
SET SETDEF SHOW SID SUBMIT TYPE
USER XREF
Suppose you type:
HELP>PIP {return}
CP/M then displays the following information:
PIP (COPY)
Syntax:
DESTINATION SOURCE
PIP d: Gn filespec [Gn] =filespec [o],... d: [o]
Explanation:
The file copy program PIP copies files, combines files, and transfers
files between disks, printers, consoles, or other devices attatched
to your computer. The first filespec is the destination. The second
filespec is the source. Use two or more source filespecs separated
by commas to combine two or more source files into one file. [o] is
any combination of available options. The [Gn] option in the
destination filespec tells PIP to copy your file to that user number.
PIP with no command tail displays an * prompt and awaits your series
of commands, entered and processed one line at a time. The source or
destination can be any CP/M 3.0 logical device.
The HELP facility provides information like this on all CP/M 3.0 built-in and transient utility commands. If you want information on a specific area, you can type HELP subject after the system prompt, where the subject is a command tail describing the subject you are interested in. For example:
A>HELP PIP
A>HELP DIRSYS
You can refer to HELP any time you need information on a specific command. Or you can just browse through HELP to broaden your knowledge of CP/M 3.0.
|