SECTION 1414. Summary of Major CP/M 3.0 CommandsAs 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 COMMANDSThere are two types of commands on CP/M 3.0:
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 COMMANDSBuilt-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.
14.3 TRANSIENT UTILITY COMMANDSThe 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.
14.4 REDIRECTING INPUT AND OUTPUTCP/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 DEVICESThe 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.
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 FILESIf 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 COMMANDSIn 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 PROGRAMSYou 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 HELPCP/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. |
page URL: www.bigfoot.com/~c128page/c128sg/sect-14.htm
contact: c128page@bigfoot.com