Previous chapter Index Mallard BASIC introduction

Chapter 5

The CP/M Plus built-in commands and utilities

The following pages contain descriptions and explanations of the CP/M Plus built-in commands and utilities on the Spectrum +3, together with examples of their use.

The built-in commands are an integral part of the CP/M Plus operating system and are thus automatically loaded from the CP/M Start-up disc when CP/M is loaded. The utilities are also held on the Start-up disc but they are not automatically loaded into memory. They have to be read into memory each time they are used.

The built-in commands have limited power and four of them, DIR, ERASE, RENAME and TYPE, have an associated utility of the same name to give them their full range of features. In particular, the utility is needed if any of the command's options are to be used.

The index on the following page lists the commands and utilities, together with the location of the relevant file on disc. The descriptions of the individual commands include references to where else they are discussed.

More details of the CP/M commands and utilities are given in the Heinemann-Newtech publication: 'A Guide to CP/M Plus' (available from Locomotive Software).

Some of the utilities may only be of use to experienced CP/M programmers. In those cases, the description here is intended only as a brief introduction to the utility. For information on these utilities, you should refer to 'A Guide to CP/M Plus'.

Throughout this chapter it is assumed that the Start-up disc on which the required utility is stored is in the default drive. If this is not the case, the name of the utility should be preceded by A: or B: (or C:) as appropriate.

Special conventions

This chapter makes great use of place-holders to describe the syntax of the various commands. In particular, filespec is used as shorthand for drive:filename.filetype and should be replaced by as much of the required file's file specification as is needed to specify the file.

In addition, optional parts of any instruction are surrounded by slanting square brackets: these parts may be omitted altogether, included just once or included as many times as appropriate. Attention must be paid to separating items by single spaces or commas as specified in the instruction.

For example:

    DIR [[option[,option]]]
is used to represent any of
    DIR [option]
    DIR [option,option]
    DIR [option,option,option]
or simply
    DIR
Anything not printed in italic or enclosed between slanting square brackets must be typed exactly as shown.

The examples given with each command or utility should clear up any uncertainty in how any particular place-holder should be interpreted.

Internal codes are given in two forms. One way is as a decimal number; the other is as a hexadecimal number. Hexadecimal numbers are to the base 16 and are made up by a # followed by two characters. The digits of a hexadecimal number take values in the range 0...15 (just as the digits of a decimal number take values in the range 0...9). These digits are expressed as 0...9 and A...F, where A represents the value 10, B the value 11 and so on. Just as a two-digit decimal number is the value of the first digit times ten plus the value of the second digit, a two-digit hexadecimal number is the value of the first digit times sixteen plus the value of the second digit. For example, the hexadecimal number E7 is E*16+7=14*16+7=231


System housekeeping

NameLocationDescriptionPage
DIR Built-in + DIR.COM (Side 1) Display details of Directory files 92
DIRSYS Built-in Display details of System files 93
DISCKIT DISCKIT.COM (Side 1) Copy, format or verify a disc 94
ERASE Built-in + ERASE.COM (Side 1)Delete files 101
GET GET.COM (Side 2) Specify source of Console input 102
INITDIR INITDIR.COM (Side 2) Format directory to allow date and time stamping104
PIP PIP.COM (Side 1) Copy files 107
PUT PUT.COM (Side 2) Specify destination of Screen and Printer output110
RENAME Built-in + RENAME.COM (Side 1)Rename files 112
SET SET.COM (Side 1) Set file and drive attributes 114
SETDEF SETDEF.COM (Side 1) Set disc and filetype search order116
SUBMIT SUBMIT.COM (Side 1) Execute commands in Batch file 124
TYPE Built-in + TYPE.COM (Side 1) Display the contents of a file 126
USER Built-in Set the Current User Number 126

Setting up the hardware

NameLocationDescriptionPage
DATE DATE.COM (Side 2) Set the date and time of day 89
DEVICE DEVICE.COM (Side 1) Assign CP/M's logical devices 89
LANGUAGELANGUAGE.COM (Side 1) Change national character set 104
PALETTE PALETTE.COM (Side 1) Set the colours used on the screen106
SETKEYS SETKEYS.COM (Side 1) Configure the keyboard 117
SETLST SETLST.COM (Side 1) Initialise the printer 119
SETSIO SETSIO.COM (Side 1) Set up the RS232 port 120
SET24X80SET24X80.COM (Side 1) Set the screen size 121
STSERIALSTSERIAL.COM (Side 2) Set up the Expansion port 122
TIMEOUT TIMEOUT.COM (Side 1) Enable / disable device timeouts 125

Advanced programming tools

NameLocationDescriptionPage
DUMP DUMP.COM (Side 2) Display the contents of a file in hex97
ED ED.COM (Side 1) Edit a text file 98
GENCOM GENCOM.COM (Side 2) Attach RSXs to a command file 102
HEXCOM HEXCOM.COM (Side 2) Generate a command file 103
LIB LIB.COM (Side 2) Create library of object modules 105
LINK LINK.COM (Side 2) Combine object modules into a command file105
MAC MAC.COM (Side 2) Macro assembler 106
PATCH PATCH.COM (Side 2) Update file header after patching 107
RMAC RMAC.COM (Side 2) Relocatable Macro assembler 113
SAVE SAVE.COM (Side 2) Save memory contents 113
SID SID.COM (Side 2) Symbolic Instruction Debugger 122
XREF XREF.COM (Side 2) Produce cross-reference summary 127

DATE

Utility

Sets and displays the date and the time of day.

Note: The Spectrum's clock will not be very accurate while the machine is used heavily, particularly if the disc drive is accessed a good deal.

DATE
displays the current setting of the computer's clock. Unless set by the user at some time during the current computing session, the date will be the creation date of CP/M and the time of day will be the number of hour, minutes and seconds since the start of the computing session.
DATE MM/DD/YY hh:mm:ss
sets the computer's clock. MM is the month represented by 01..12; DD is the day represented by 01..31; YY is the last two digits of the year, represented by 00..99; hh is the hour, represented by 00..23; mm is the number of minutes, represented by 00..59; and ss is the number of seconds, represented by 00..59. The system responds with Strike any key to set time and starts the clock at the given time when you press a key.

This utility is not covered any further in this manual.

DEVICE

Utility

Assigns the logical CP/M Plus devices to the physical devices (peripherals) attached to the Spectrum +3 and sets the associated communication parameters. It may also be used to display the current assignments of the logical devices, together with related information.

CP/M Plus supports the following five logical devices:

CONIN:
console input (ie. the keyboard)
CONOUT:
console output (ie. the monitor)
AUXIN:
input side of an auxilliary device (eg. a communications interface)
AUXOUT:
output side of an auxilliary device (eg. a communications interface)
LST:
the printer

The physical devices that can appear in DEVICE commands depend on the details of the hardware configuration. The Spectrum +3 has the capability for supporting the following physical devices:

CRT
The keyboard and the monitor
LPT
The built-in parallel port
SIO
The built-in serial port

The addition of any field-installable devices (FIDs) can add further physical devices to this list. In particular, the use of the supplied SERIAL.FID adds the SERIAL device, representing the Expansion port on the back of the Spectrum.

DEVICE
lists both the physical devices acceptable to the system (with their basic characteristics) as for DEVICE NAMES and the current assignments of the logical devices. It then prompts the user for new device assignments of the form logical-device=physical-device
DEVICE NAMES
lists the physical devices acceptable to the Spectrum +3, together with the baud rate for each device and a summary of the device characteristics, making a total of three elements in the list per device.
DEVICE VALUES
lists the current logical device assignments.
DEVICE physical-device [[option[,option]]]
displays the characteristics of the named physical device.
DEVICE logical-device
displays the current assignment of the named logical device.
DEVICE logical-device=physical-device[[option[,option]]]
assignes the named logical device to the named physical device.
DEVICE logical-device=physical-device1[,physical-deviceN]
sets the named logical device simultaneously to two or more physical devices.
DEVICE logical-device=NULL
disconnects the named logical device from all physical devices.

DEVICE options

The options associated with the DEVICE utility are used to qualify individual physical devices. They should be listed between square brackets and separated by commas, after the physical device to which they apply. There must not be any space between the name of the device and the bracketed options.

XON
activates the signalling procedure whereby the peripheral device notifies the computer whether it is ready to receive more data.
NOXON
results in the computer sending data to the peripheral device whether it is ready to receive it or not.
n
sets the rate at which data is sent to the peripheral device (the Baud Rate). The allowed values for n are:
50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600 and 19200.
Only some of these values may be appropriate to any particular device.

Examples

A>DEVICE
Physical Devices:
I=Input, O=Output, S=Serial, X=Xon-Xoff
CRT   NONE   IO  LPT    NONE   P  SIO    NONE  IOS
Current Assignments:
CONIN:    =     CRT
CONOUT:   =     CRT
AUXIN:    =     SIO
AUXOUT:   =     SIO
LST:      =     LPT
Enter new assignment or hit RETURN:
DEVICE LST:=SIO
makes the RS232 port the logical printer port, so that all printer output will be sent to this port, rather than to the parallel Printer port.
DEVICE AUXIN:=NULL
disconnects the logical device AUXIN from all Spectrum +3 peripheral devices.

This utility is covered in Sections 4.1 and 4.2 ('Using the Printer port' and 'Using the RS232 port').

DIR

Built-in command

Displays the names and associated details of non-system files accessible to the user through either the default or the specified drive.

DIR
displays the names and filetypes of all such files on the disc in the default drive.
DIR drive:
displays the names and filetypes of all such files on the disc in the specified drive.
DIR filespec
is used to check whether the required file is on a particular disc.
DIR filespec-including-wildcards
is used to display files on the default or specified drive with similar names and filetypes. * matches with any number of characters in the same part of the file specification, whereas ? has to match with a character or a space in the same position.

All the above variants may be enhanced by the use of one or more of the DIR command options. However, to use these options the companion utility DIR.COM must be on the search path.

The options should be listed at the end of the command line, between square brackets and separated by commas or single spaces.

The options include:

DRIVE=ALL
causing search and listing of all accessed drives
EXCLUDE
giving the names of all files except those with the given file specification
FULL
giving name, size (both in kbytes and number of 128 byte records) and attributes of every file listed
RO or RW
causing search and listing of just read-only files or just read-write files, respectively
SIZE
giving name and size in kilobytes of every file listed
USER=ALL
causing search and listing of all files on the disc in the specified drive, whatever user number they were created under

This time the files are listed in alphabetical order of filename.

If searching the directory fails to find any file meeting the given specification, the message No File is displayed.

If system files exist matching the given specification and you are not using any of the search options, the message SYSTEM FILE(S) EXIST is displayed. If you use one or more of the search options, system files are automatically listed.

If the listing fills more than one screen, the system pauses when it gets to the bottom of the screen. Press [Enter] to see the remainder of the listing.

Examples

A>DIR
A: PLOT     TX  : PRIME    TX  : PRINT    TEX  : PROCESS  MIX

A>DIR PR*.T*
A: PRINT    TX  : PRIME    TX

A>DIR PR*.R? [DRIVE=ALL]
A: PRIME    TX
C: PRINT    TM

This command is described in Sections 3.8 ('Finding the size of a file') and 3.10 ('Listing the directory').

DIRSYS

Built-in command

Displays the names and associated details of all system files accessible by the user through either the default or the specified drive.

DIRSYS can be shortened to DIRS.

DIRSYS
displays the names and filetypes of all such files on the disc in the default drive.
DIRSYS drive:
displays the names and filetypes of all such files on the disc in the specified drive.
DIRSYS filespec
is used to check that the required file is on a particular disc.
DIRSYS filespec-including-wildcards
is used to display all system files with similar names and filetypes. * matches with any number of characters in the same part of the file specification, whereas ? has to match with a character or a space in the same position.

If searching the directory fails to find any file meeting the given specification, the message No File is displayed.

If system files exist matching the given specification, the message NON-SYSTEM FILE(S) EXIST is displayed.

If the listing fills more than one screen, the system pauses when it gets to the bottom of the screen. Press [Enter] to see the remainder of the listing.

Examples

A>DIRSYS
A: GENCOM   CMD : HEXCOM   CMD : PATCH    OVR

A>DIRS *.CMD
A: GENCOM   CMD : HEXCOM   CMD 
This command is described briefly in Section 3.10 ('Listing the directory').

DISCKIT

Utility

Makes an exact copy of one disc on another, gives a disc the required format or verifies that all the data on a disc is readable by Spectrum +3.

The utility is invoked by typing DISCKIT [Enter]. This starts by instructing you to remove the disc(s) from the drive(s) and then displays the Main Menu.

The menus are graphical representations of the relevant part of the keyboard, labelled to show which key selects which option.

System messages about movement of discs and error messages appear at the top of the screen. The messages are intended to be self-explanatory.

The first letter of 'R-etry', 'I-gnore' or 'C-ancel' is sufficient to produce the desired effect.

Copying

Entered by selecting 1 from the main menu. Note that any formatting required is carried out automatically as part of the copying process.

Single-drive systems

  1. insert the disc you want to copy in the disc drive and then press Y. Pressing any other key returns to the main menu.
  2. remove and insert discs in accordance with messages at the top of the screen.

Two-drive systems

  1. select from menu which drive to read from: A to read from Drive A; Q to read from Drive B; M to return to the main menu.
  2. select from menu which drive to write to: A to write to Drive A; Q to write to Drive B; M to return to the main menu.
  3. insert the disc you want to copy (the disc to READ) and the disc you want to make the copy onto (the disc to WRITE) as specified and then press Y. Pressing any other key returns to the main menu.
  4. remove and insert discs in accordance with messages at the top of the screen.

After the completion of each copy operation, duplicating one disc on another disc, the user is offered the option of repeating the copy operation with a different source disc and a different destination disc: Y selects this option; any other key returns to the main menu.

Formatting

Entered by selecting Q from the main menu. Note that formatting a disc on which data is stored erases that data.

Single-drive systems

  1. insert disc to be formatted and press Y; pressing any other key returns to the main menu.
  2. insert and remove discs in accordance with messages at the top of the screen.

Two-drive systems

  1. select from menu which drive will hold the disc to format: Press A for Drive A; Press Q for Drive B; M returns to the main menu.
  2. insert disc to be formatted and press Y; Pressing any other key returns to the main menu.

After the completion of each format operation, the user is offered the option of repeating the format operation with a different disc: Y selects this option; any other key returns to the main menu.

Verifying

Checks a disc by making sure that all the information on it can be read without errors. It is entered by selecting A from the main menu. The whole of one side of the disc is read track by track.

Single-drive systems

  1. insert disc to be formatted and press Y; pressing any other key returns to the main menu.

Two-drive systems

  1. select from menu which drive will hold the disc to verify: Press A for Drive A; Press Q for Drive B; M returns to the main menu.
  2. insert disc to be formatted and press Y; Pressing any other key returns to the main menu.

After the completion of each verify operation, the user is offered the option of repeating the verify operation with a different disc: Y selects this option; any other key returns to the main menu.

DISCKIT messages

Please insert disc to operation into the drive
Press any key to continue
Insert the required disc, with the side you want to use uppermost, and press the Space Bar (say).
There is no disc in drive drive
Please insert disc to operation into the drive
R-etry or C-ancel?
You pressed a key before inserting your disc. Insert the required disc, with the side you want to use uppermost; then press R.
The disc is write-protected Please insert disc to operation into the drive
R-etry or C-ancel?
The disc you inserted when asked for the disc to write, is write-protected. Check first that you inserted the disc you intended; only then, unprotect the disc by moving the shutter over the relevant Write-protect hole, re-insert the disc and press R.
That is the wrong disc Please insert disc to operation into the drive
Press any key to continue
You have inserted a different disc to the one you used earlier in the copy, or you have inserted it with the wrong side uppermost. Insert the correct disc, with the side you want to use uppermost: then press the Space Bar (say).
Disc error on [drive:] track number, sector number - comment about error type R-etry[, I-gnore] or C-ancel?
DISCKIT experienced a disc-handling error reading from or writing to this disc. Follow the advice given in Appendix VII.1 and press R, I or C accordingly. Pressing C abandons the current action and returns you to DISCKIT's main menu.

This utility is described in Sections 3.2 ('Copying discs') and 3.9 ('Formatting discs').

DUMP

Utility

Displays on screen the contents of a file in both hexadecimal and ASCII format.

DUMP filespec
displays in the following form the contents of the file with the given file specification.

Example

A>DUMP SETSIO.COM
	CP/M 3 DUMP - Version 3.0
	0000: 18 69 53 45 54 53 49 4F 20 23 31 31 37 0D 0A 44  .iSETSIO #117..D
	0010: 65 76 65 6C 6F 70 65 64 20 62 79 20 4C 6F 63 6F  eveloped by Loco
	0020: 6D 6F 74 69 76 65 20 53 6F 66 74 77 61 72 65 20  motive Software 
	0030: 4C 74 64 2E 0D 0A 43 6F 70 79 72 69 67 68 74 20  Ltd...Copyright 
	0040: 28 43 29 20 31 39 38 35 20 41 6D 73 74 72 61 64  (C) 1985 Amstrad
	0050: 20 43 6F 6E 73 75 6D 65 72 20 45 6C 65 63 74 72   Consumer Electr
	0060: 6F 6E 69 63 73 20 50 4C 43 0D 0A ED 73 09 11 31  onics PLC...s..1
	0070: 0B 12 CD 6C 07 CD EE 06 DC 80 01 ED 7B 09 11 C9  ...l........{...
	0080: 79 FE 03 CA E4 05 CD C6 01 11 B6 01 C2 9F 05 CD  y...............
	0090: 4C 02 CC 9F 05 11 A1 01 CA 41 06 CD F1 01 C3 20  L........A..... 
	00A0: 04 53 49 4F 20 6C 65 66 74 20 75 6E 63 68 61 6E  .SIO left unchan
	00B0: 67 65 64 0D 0A 24 53 49 4F 20 6E 6F 74 20 66 6F  ged..$SIO not fo
	00C0: 75 6E 64 0D 0A 24 CD 1C 02 C0 7E E6 10 C6 F0 9F  und..$....~.....
	00D0: 32 08 11 CD A5 07 2F 3C 1F F5 9F 32 00 11 F1 1F  2...../<...2....
	00E0: 9F 32 01 11 ED 43 02 11 ED 53 04 11 22 06 11 AF  .2...C...S.."...
	00F0: C9 CD 1C 02 3A 08 11 E6 10 AE E6 10 AE 77 2A 00  ....:........w*.
	0100: 11 7D 1F 7C 17 E6 03 2F 3C ED 4B 02 11 ED 5B 04  .}.|.../<.K...[.
	0110: 11 2A 06 11 C5 CD 9F 07 E1 C3 AB 07 D5 C5 CD 96  .*..............
	0120: 07 11 37 02 7E FE 01 38 0B CD 3D 02 01 08 00 09  ..7.~..8..=.....
	0130: 20 F2 2B 2B C1 D1 C9 53 49 4F 20 20 20 E5 D5 06   .++...SIO   ...
	0140: 06 1A BE 20 04 13 23 10 F8 D1 E1 C9 AF 32 0B 12  ... ..#......2..
	0150: 21 5E 02 CD 6D 06 CD 1F 04 20 F5 C3 66 06 52 9B  !^..m.... ..f.R.
	0160: 02 54 92 02 42 3E 03 53 84 03 50 B8 03 58 E7 03  .T..B>.S..P..X..
	0170: 48 EC 03 49 F1 03 FF 79 02 01 03 11 CD B9 02 20  H..I...y....... 
	0180: 23 11 85 02 C9 42 61 64 20 6F 70 74 69 6F 6E 0D  #....Bad option.
	0190: 0A 24 01 02 11 CD B9 02 C8 18 0C 01 03 11 CD B9  .$..............
	01A0: 02 C8 18 03 0A 0B 02 3A 0B 12 B7 C0 0A FE 04 3F  .......:.......?
	01B0: 9F 3C 87 32 05 11 F6 01 C9 21 C2 02 11 2E 03 C3  .<.2.....!......
	01C0: 17 04 35 30 FF 01 00 37 35 FF 02 00 31 31 30 FF  ..50...75...110.
	Press RETURN to continue 

This utility is not covered any further in this manual.

ED

Utility

Edits the disc file with the given file specification. It may also be used to create a new disc file.

ED is the CP/M Plus Text Editor. It is a line-based editor, and it responds to its own set of commands (tabulated below). In general, we recommend using the RPED screen-based text editor in preference to ED.

Except where the edited file is going to directly replace the source file, the ED command will fail if a file already exists with the same file specification.

After opening the source and destination files, ED displays the prompt

: *
indicating that it is ready to receive an editing command. This prompt is repeated whenever the current command is completed.
ED filespec
opens the file with the given file specification. The edited file takes over the source file's entry in the directory. The old version is retained with the filetype BAK. If no source file is found, the message NEW FILE is displayed, followed by :*.
ED source-filespec dest-filespec
opens the file with the given source file specification. The edited version is stored as a file with the given destination file specification. The old version is retained with its original file specification.
ED filename.filetype drive:
opens the file on the disc in the default drive that has the given filename and filetype. The edited file is stored on the disc in the named drive with the same filename and filetype. The old version is retained with its original file specification.

Note: ED uses an area of memory as its workspace and before you can edit a file, you have to use ED's APPEND command to read it into this workspace. The workspace is big enough to hold most reasonably sized files, but sometimes the file to be edited is bigger than the workspace. Such a file will have to be edited in sections.

Type E to end the edit.

Examples

A>ED MYPROG.1
Causes the file MYPROG.1 on the disc in Drive A to be opened for editing. The new version is stored as MYPROG.1, while the old version is stored as MYPROG.BAK. If the file MYPROG.1 doesn't already exist, a file with this name is created on Drive A.
A>ED MYPROG.1 B:
Causes the file MYPROG.1 on the disc in Drive A to be opened for editing. The new version is stored as MYPROG.1 on the disc in Drive B.

ED has its own set of commands for inserting new material, deleting old material and so on. These are outlined below. Do not expect the Cursor keys and the two DEL keys to have their usual effect.

ED commands

Command
Action
nA
appends n from the source file to the ED workspace.
0A
appends lines from the source file until the workspace is half full.
#A
appends lines from the source file until the workspace is full or the end of file is reached.
B,-B
moves the workspace pointer to the beginning (B) or end (-B of the workspace.
nC
moves the workspace pointer n characters forward through the workspace (backwards if n is negative).
nD
deletes the n characters after the workspace pointer (before if n is negative).
E
saves the new file and returns to CP/M.
Fstring Control-Z
finds the specified character string in the workspace beyond the current position of the pointer.
H
saves the current version of the file, then reopens the edit using this file as the source.
i
enters insert mode. Press [Break] to leave this mode.
istring Control-Z
inserts the given string at the position of the pointer.
nK
deletes the n lines after the workspace pointer (before if n is negative).
nL
moves the workspace pointer n lines forward through the workspace (backwards if n is negative).
0L
moves the workspace pointer to the beginning of the current line.
nMcommands
instructs ED to execute the given commands n times.
n
moves the workspace pointer n lines forward (backwards (if n is negative) and displays that line.
n:
moves the pointer to line n and displays that line.
O
abandons the editing so far, returning to the original version for re-editing.
nP
moves the workspace pointer n lines forward (backwards if n is negative) and displays all those lines.
Q
abandons the edit and returns to CP/M.
Rfilespec Control-Z
reads the named file into the ED workspace, appending it to whatever is already in there.
nSold-string Control-Znew-string Control-Z
replaces n instances of old-string with new-string, the search being carried out forward from the current position.
nT
displays the n lines after the workspace pointer (before if n is negative), leaving the pointer in its current position.
nW
writes the first n lines to the destination file.
nXfilespec
writes n lines from the workspace into the named file, appending them to any other lines already in that file through a previous nXfilespec instruction.

ED error messages

All the error messages generated within ED have the same form:

BREAK "symbol" at letter
The symbol identifies the type of failure (tabulated below) while the letter is that of the current editing command.

Symbol

#
Search failure: specified string not found
?letter
Unrecognised command letter: can also imply command not correctly specified
0
LIB file specified in an R command not found
>
Buffer full or specified string too long
E
Command aborted
F
File error (followed by either DISK FULL or DIRECTORY FULL)
This utility is not covered any further in this manual.

ERASE

Built-in command

Deletes the reference to one or more files from a disc's directory. Directory and data space on the disc are automatically reclaimed for subsequent use by other files. ERASE can be shortened to ERA.

ERASE filespec
erases the file with the given file specification.
ERASE filespec-including-wildcards
erases all files with file specifications that match the given specification. It first asks for confirmation that the file specification has been entered correctly. This version should be used with great care.
ERASE filespec-including-wildcards [C]
prompts for confirmation before erasing each file with a file specification matching the given specification. Type Y to confirm the action; N to keep the file. Note: To use this, you must have the companion utility ERASE.COM on the search path.

If the system fails to fine even one file matching the given specification, the message No File is displayed.

Examples

A>ERASE MYFILE.10
erases MYFILE.10 from the disc in the default drive (Drive A).
A>ERA *.BAK
ERASE *.BAK (Y/N)?Y
erases all files with the filetype BAK from the disc in the default drive (Drive A), but asking for confirmation before starting to erase the files.
A>ERA B:*.*
ERASE B:*.* (Y/N)?Y
erases all files from the disc in Drive B, having first asked for confirmation.
A>ERA B:*.BAK [C]
B:filename.BAK (Y/N)?Y
erases the files with the filetype BAK from the disc in Drive B one by one, asking each time for confirmation.

This command is described in Section 3.7 ('Erasing files')

GENCOM

Utility

Attaches one or more Resident System Extension (RSX) to a command file, thereby enabling the program within the command file to use the facilities of the named RSX's.

Resident system extensions are additional operating system modules, temporarily held in the computer's memory, that extend or modify the way CP/M Plus operates.

A maximum of 15 RSXs may be attached at one time.

The GENCOM utility is also used to return the command to its original state.

This utility is not covered any further in this manual.

GET

Utility

Instructs the system to take the input it would normally get from the console (ie. the keyboard) from a named file. This input can either be CP/M commands or the data needed by a program or both.

The console input is taken from the named file until that file is exhausted or the program terminates.

Unless instructed otherwise through one of the GET utility options, the input is echoed on the monitor screen. Options are listed between square brackets, separated by commas or single spaces.

GET CONSOLE INPUT FROM FILE filespec
tells the system to get the input for the program that is about to be run from the file with the given file specification, until that file is exhausted or the program terminates. The command to run the program must be the next instruction typed in at the keyboard. All the inputs from the file are displayed on the screen.
GET CONSOLE INPUT FROM FILE filespec [SYSTEM]
tells the system to take all the input it would normally expect from the console from the file with the given file specification, until that file is exhausted. This file will include instructions to run programs as and when required. All inputs from the file are displayed on the screen.
GET CONSOLE INPUT FROM FILE filespec [NO ECHO]
tells the system to get the input for the program that is about to be run from the file with the given file specification, until that file is exhausted or the program terminates. The command to run the program must be the next instruction typed in at the keyboard. All the inputs from the file are not displayed on the screen.
GET CONSOLE INPUT FROM CONSOLE
tells the system to once again get its input from the keyboard. This terminates a preceding GET FILE command.

Examples

A>GET CONSOLE INPUT FROM FILE CONSIN.DAT [NO ECHO]
A>MYPROG
tells the system to get all the console input required by MYPROG from a file on the disc in the default drive called CONSIN.DAT. This input will not be displayed on the screen as the program is run.
A>GET CONSOLE INPUT FROM FILE B:CONSIN.CAD [SYSTEM,NO ECHO]
tells the system to take all its console input from the file on the disc in Drive B called CONSIN.CAD, until that file is exhausted. This input will not be echoed on the screen.

This utility is covered in section 4.7 ('Redirecting console input and output').

HEXCOM

Utility

Generates a command file from a hexadecimal format file.

This utility is not covered any further in this manual.

INITDIR

Utility

Used in conjunction with the SET utility either to allow date and time stamping of the files on the disc in a specified drive or to remove this facility if it is already in force. INITDIR reformats the directory and, if there are any files already on the disc, checks that there is enough room in the directory for date and time stamping of these files. If not, it fails to reformat the directory and puts up an error message.

Note: Discs on which the directory has been reformatted cannot be used on a CPC6128 running CP/M 2.2 or AMSDOS.

INITDIR drive:
reformats the directory of the disc in the specified drive, either to allow date and time stamping, or to remove this information if the facility is already in force. The user is asked to respond to self-explanatory messages.

Example

INITDIR B:
reformats the directory of the disc in Drive B.

This utility is not covered any further in this manual.

LANGUAGE

Utility

Selects one of the eight internationally recognised character sets, with the result that the internal codes used to represent characters associated with the standard language are swapped with ones used for certain standard characters in the first half of the character set. As a result, keystrokes may cause different characters to appear on the screen.

The characters that are affected are listed in the table below. The default setting is Language 0, the US set.

LANGUAGE n
sets the characters set to that identified by the number n.
Hex US French German UK Danish Swedish Italian Spanish
n 0 1 2 3 4 5 6 7
#23 # # # £ # # # Pt
#40 @ à § @ @ É @ @
#5B [ º Ä [ Æ Ä º ¡
#5C \ ç Ö \ Ø Ö \ Ñ
#5D ] § Ü ] Å Å é ¿
#5E ^ ^ ^ ^ ^ Ü ^ ^
#60 ` ` ` ` ` é ù `
#7B { é ä { æ ä à ¨
#7C | ù ö | ø ö ò ñ
#7D } è ü } å å è }
#7E ~ ¨ ß ~ ~ ü ì ~
This utility is described in Section 4.5 ('Selecting the appropriate national language').

LIB

Utility

Either creates a library of object modules or appends, replaces, selects or deletes modules from an existing library. It may also be used to obtain information about the contents of an existing library.

The object modules must be in Microsoft REL format, as produced for example by the RMAC utility.

Library files are given the filetype REL.

This utility is not covered any further in this manual.

LINK

Utility

Combines relocatable object modules into a command file.

The object modules are held either in individual files (the form in which they are produced, for example, by RMAC) or in libraries.

This utility is not covered any further in this manual.

MAC

Utility

MAC is CP/M Plus's Macro Assembler.

Takes an assembler program (filetype ASM) and produces a HEX (hexadecimal format) file, a PRN file (suitable for output on the screen or the printer) and a SYM file. The latter contains a sorted list of the symbols defined in the program.

This utility is not covered any further in this manual.

PALETTE

Utility

Changes the colours used to display characters on the screen and the background against which they are written.

Note: Both the foreground and the background colours should either be normal intensity or bright: if you mix a normal colour with a bright one, both colours will be shown at normal intensity. However, Black can be used with either a normal colour or a bright one.

PALETTE background-colour foreground-colour
sets both the foreground colour (used for the characters) and the background colour. The colours are given as numbers, taken from the table below.
Normal colourNumber Bright colourNumber
Black 0
Blue 2 Bright Blue 3
Red 8 Bright Red 12
Magenta10Bright Magenta15
Green 32Bright Green 48
Cyan 34Bright Cyan 51
Yellow 40Bright Yellow 60
White 42Bright White 63

Example

PALETTE 12 51
sets the foreground to Bright Cyan and the background to Bright Red.

This utility is introduced in Section 1.3 ('CP/M and the screen').

PATCH

Utility

This utility is outside the scope of this manual.

PIP

Utility

Transfers data from a logical input device (the Source) to a logical output device (the Destination). For example, it can be used to copy one or more files from one disc to another; to output on the printer a character file from a disc; or to create a file on disc from input at the keyboard.

It can also combine inputs from two or more sources into one output.

PIP transfers any file attributes of the source file to the destination file and respects passwords as and where applied (See Section 3.13.)

PIP dest-filespec=source-filespec
copies the named source file and stores the copy as the file with the given destination file specification. This version can be used to duplicate a file on the same disc.
dest-filespec is also used here to represent one of AUX, CON, PRN or LST, while source-filespec may also be one of AUX, CON, NUL or EOF. Where these logical devices are used as the source or the destination of the copy, the copy can be terminated by pressing [Extend Mode] + C.
CON represents the console (keyboard and screen);
AUX any auxilliary input/output device;
LST and PRN the printer;
NUL a source that produces 40 hexadecimal zeroes;
EOF a source of a single Control-Z character. The files so copied must contain only printable characters.
PIP dest-filespec=drive:
copies the file in the specified drive with the same filename and filetype as the destination file onto the destination disc, where it is stored with that filename and filetype. This version can't be used to duplicate a file on the same disc.
PIP drive:=source-filespec
copies the named source file onto the disc in the specified drive, where it is stored with the same filename and filetype. This version can't be used to duplicate a file on the same disc.
PIP drive:=filespec-including-wildcards
copies onto the disc in the specified drive, all files whose file specifications match the given file specification. The files are stored on the destination disc with the original filenames and filetypes. Actual-filename.filetype is displayed as each file is copied. This version can't be used to duplicate files on the same disc.
PIP dest-filespec=sourcespec-1,sourcespec-2[,sourcespec-n]
combines the listed files in order of listing and stores the result as a file with the given destination file specification. This file may be stored on the same disc as the source files.
PIP
enters PIP's Multiple Command Mode, in which it prompts for the next in a sequence of PIP type commands by putting up an asterisk on the screen. The next command should be entered as in any other PIP instruction but without the PIP. Terminate by pressing [Enter] after the asterisk.

All the above variants may be enhanced by using the PIP utility options.

One or more options may be listed after each file/drive specification, between square brackets and separated by single spaces. There should be no space between the end of the file/drive specification and the bracketed options.

The options available are listed below. Attention is drawn to the Gn option if you are using User Numbers (see Section 3.12).

PIP options

Option
Result
C
Confirmation is needed before each copy operation is executed.
E
The transfer is echoed on the screen.
F
All form feeds embedded in the source file are removed.
Gn
The file is identified as belonging to user number n.
L
All upper case characters are converted to lower case.
N
Line numbers are added to the destination file.
O
Ensures that the whole of the file is transferred when combining files, otherwise non-printable characters within the file could be interpreted as an end-of-file marker by PIP.
Pn
The number of lines per page in the destination file is set to n.
QstringControl-Z
The copying process terminates after the given string.
R
The source file may be found in the directory of system files, which is not normally searched.
SstringControl-Z
The copying process starts at the beginning of the given string.
U
All lower case characters are converted to upper case.
V
The destination file is compared with the source file to check that the copying process has been accurate.
W
Storing the copy may overwrite a read-only file with the same file specification.
Z
Parity bit of each data byte in the destination file is set to zero.
Note: Except when used in multiple command mode, the Q and S options are only suitable for copying sections of text files if the strings you want to specify don't contain any lower case letters. This is because any lower case letters you type in the command line are interpreted as capital letters.

Examples

A>PIP CHAP1.TEX=SECT1.TX,SECT2.TX,SECT3.TX
combines the contents of the files SECT1.TX,SECT2.TX and SECT3.TX into a single file which is subsequently stored as the file CHAP1.TEX. All the files concerned are on the disc in the default drive (Drive A).
A>PIP LST:=B:LETTER.TEX[E P40]
lists out on the printer the text contained in the file LETTER.TX on the disc in Drive B, starting a new page every 40 lines. The output is echoed on the screen.
A>PIP LST:=CON:[U N P40]
lists out on the printer everything that is typed in at the keyboard, starting a new page every 40 lines. Additionally, all lower case characters are converted to upper case and the lines are numbered in sequence.
A>PIP B:[G3]=A:MYFILE[G2]
copies the file called MYFILE from user number 2 on Drive A to user number 3 on Drive B.
A>PIP
*CHAP1.TEX=SECT1.TX,SECT2.TX,SECT3.TX
*LST:=CHAP1.TEX[SDear Sir[Extend Mode]+ZQfaithfully[Extend Mode]+Z]
*[Enter]
combines the contents of the files SECT1.TX, SECT2.TX and SECT3.TX into a single file which is stored as the file CHAP1.TEX; then lists the section of the new file between 'Dear Sir' and 'faithfully' on the printer.

This utility is described in Section 3.3 ('Copying files').

PUT

Utility

Instructs the system to send console (ie. screen) output or printer output to a disc file, either until instructed otherwise or until the end of the program which is about to run.

One or more options may be listed in square brackets as part of the instruction. These should be separated by commas or single spaces.

Unless instructed otherwise, control characters will not be incorporated in any form in the file, console output will also be displayed (ie. echoed) on the screen but printer output will not be echoed on the printer.

PUT CONSOLE OUTPUT TO FILE filespec
tells the system to direct console output from the next program run to a file with the given file specification. The output will be echoed on the screen.
PUT PRINTER OUTPUT TO FILE filespec
tells the system to direct printer output from the next program run to a file with the given file specification. The output will not be echoed on the printer.
PUT CONSOLE OUTPUT TO FILE filespec [SYSTEM]
tells the system to direct console output to the file with the given file specification, until told otherwise through a PUT CONSOLE OUTPUT TO CONSOLE instruction. The output will be echoed on the screen.
PUT PRINTER OUTPUT TO FILE filespec [SYSTEM]
tells the system to direct printer output to the file with the given file specification, until told otherwise through a PUT PRINTER OUTPUT TO PRINTER instruction. The output will not echoed on the printer.
PUT CONSOLE OUTPUT TO FILE filespec [NO ECHO]
stops the automatic echoing of the console output on the screen.
PUT PRINTER OUTPUT TO FILE filespec [ECHO]
causes the system to echo on the printer the output sent to the named file.
PUT CONSOLE OUTPUT TO FILE filespec [FILTER]
causes the stored version of the console output to contain printable representations of the control codes issued.
PUT PRINTER OUTPUT TO FILE filespec [FILTER]
causes the stored version of the printer output to contain printable representations of the control codes issued.
PUT CONSOLE OUTPUT TO CONSOLE
tells the system to revert to sending console output solely to the screen.
PUT PRINTER OUTPUT TO PRINTER
tells the system to revert to sending printer output solely to the printer.

Examples

A>PUT CONSOLE OUTPUT TO FILE CONSOUT.TEX [SYSTEM,FILTER]
causes all subsequent console output to be additionally stored as a file called CONSOUT.TEX on the disc in the default drive (Drive A), complete with printable versions of all the control codes. This will continue until a PUT CONSOLE OUTPUT TO CONSOLE instruction is issued.
A>PUT PRINTER OUTPUT TO FILE B:PRINOUT.TEX [FILTER,ECHO]
A>MYPROG
causes the printer output from MYPROG to be stored in a file on the disc in Drive B called PRINOUT.TEX, complete with printable versions of all the control codes. The output is also sent to the printer. The system will revert to only sending printer output to the printer when MYPROG terminates.

This utility is covered in section 4.7 ('Redirecting console input and output').

RENAME

Built-in command

Changes the name of one or more files catalogued in the directory of a disc. It does not make new copies of the files.

The drive specifier in the new file specification must be identical to that in the old file specificiation. Additionally the new specification may not be that of any existing file. RENAME may be shortened to REN.

RENAME new-filespec=old-filespec
changes the name of the file with the given old file specification to that corresponding to the new file specification.
RENAME
carries out the above operation, having first prompted the user for the new and old file specifications.
RENAME new-filespec-inc.-wildcards=old-filespec-inc.wildcards
changes the name of each file matching the given old file specification to one corresponding to the new file specification, replacing the wildcard characters with the appropriate characters from the original file specification. The wildcards in the old and new file specifications must therefore correspond exactly.

If no file is found that matches the given old file specification, the message No File is displayed on the screen.

If there is already a file on the disc with the given new file specification, CP/M searches for the companion utility RENAME.COM and if it finds it, it will display the message Not renamed: filename.filetype file already exists, delete (Y/N)?. If it doesn't find RENAME.COM, it displays the message RENAME.COM required

Examples

REN NEWLETTR.TX=OLDLETTR.TX
renames the file OLDLETTR.TX NEWLETTR.TX.
REN B:PR*.?X=B:SP*.?Y
renames, for example, the file SPAIN.TX as PRAIN.TY, the file SPIN.MX PRIN.MY and the file SPA.AX as PRA.AY but leaves the file SPAIN.TEX unchanged.

This utility is described in Section 3.14 ('Renaming files').

RMAC

Utility

MAC is CP/M Plus's Relocatable Macro Assembler.

Converts an assembler program (filetype ASM) into a relocatable (REL) file, that can then be linked to create a command (COM) file. Also produced are a PRN file (suitable for printing or displaying on the screen) and a SYM file. The latter contains a sorted list of the variables defined in the program.

This utility is not covered any further in this manual.

SAVE

Utility

Intercepts the return to the system following the execution of the next program and then copies the contents of the memory between specified hexadecimal addresses into a named file.

The utility prompts the user for the program to be run, the name of the file, the start address and the end address.

SAVE activates the utility.

Example

A>SAVE
A>MYPROG
...output from MYPROG...
File (or RETURN to exit)?DUMPFILE
From?100
To?400
causes the contents of the memory between hexadecimal addresses #100 and #400 following the running of the program MYPROG to be copied into a file on the disc in the default drive (Drive A) called DUMPFILE.

This utility is not covered any further in this manual.

SET

Utility

Sets file and drive attributes and allows labelling of discs to make disc cataloguing easier.

The SET utility can also be used to give a file password protection and to give it various special attributes. The SYS option is useful to apply to programs with User Number 0 that you want to use to process files with different User Numbers.

It is not advisable to use password protection or to set any of the special attributes on any disc that you also want to use with AMSDOS or with CP/M v2.2 (eg. on a CPC6128).

SET filespec [option[,option]]
gives the named file the attributes specified by the options. One or more options may be listed within the square brackets, separated by commas or single spaces. The options include:
DIR
converts a system file to a non-system file
SYS
converts a non-system file to a system file
RO
makes the file open only to read-only access
RW
converts a read-only file to one allowing full read-write access
SET drive:[option]
gives the named drive the attribute specified by the option. The options are:
RO
permits read-only access to files on the disc in the named drive
RW
converts the drive back to full read-write access
PROTECT=mode
sets password protection to ON or OFF
PASSWORD=password
sets the password used to protect the drive
SET drive:[NAME=labelname.labeltype]
assigns the given label to the disc in the specified drive. The same restrictions apply to the choice of labelname and labeltype as apply to the choice of filenames and filetypes.
SET filespec [PASSWORD=password,PROTECT=mode]
sets the password used to protect a file and the level of protection that this password gives (see Section 3.13). The possible modes are:
READ
Reading, copying, changing, deleting and renaming
WRITE
Changing, deleting and renaming but not reading and copying
DELETE
Just deleting
SET filespec;password [PROTECT=NONE]
clears the password protection from the given file
SET [DEFAULT=password]
sets the default password - ie. the password that CP/M assumes if a password is required but none is actually quoted in the command line.

Examples

A>SET MYFILE.TEX [RO,SYS]
makes MYFILE.TEX a system file to which just read-only access is allowed.
A>SET B:[RO]
restricts access to disc in Drive B to read-only. This means no new files can be written to the disc, files cannot be copied to the disc, files on the disc may not be erased and neither may they be renamed.
A>SET [NAME=MYDISC1]
labels the disc in the default drive MYDISC1.
A>SET MYFILE.TEX [PASSWORD=SECRET, PROTECT=WRITE]
makes it essential to quote the password SECRET before MYFILE.TEX can be changed, deleted or renamed.
A>SET MYFILE.TEX;SECRET [PROTECT=NONE]
clears password protection on MYFILE.TEX which had previously been protected with the password SECRET.
A>SET [DEFAULT=SECRET]
sets the default password to SECRET

This utility is covered in Section 3.13 ('Protecting your files').

SETDEF

Utility

Defines and/or displays the disc search order, the drive used for temporary files and/or the filetype search order. The search order only affects the loading of programs and/or the execution of Submit (.SUB) files.

Note: The supplied PROFILE.SUB includes a SETDEF command that instructs CP/M to search for a program file first as a Submit (.SUB) file and then as a command (.COM) file. Without this command, CP/M would only search for a command file.

SETDEF
displays the current disc search order, the drive used for temporary files and the current filetypes search order amongst other things.
SETDEF [TEMPORARY=drive:]
sets the drive used for temporary files (produced, for example, by SUBMIT). If the RAMDISC is installed, the default is Drive C; otherwise, it is the current drive.
SETDEF drive:[,drive:]
sets the order in which drives are searched. The default is just to search the system's default drive or the specified drive. Use * to specify the default drive in the search order.
SETDEF [ORDER=(SUB,COM)]
instructs CP/M to look for the program-name specified in command lines first as a SUB file and then as a COM file.
SETDEF [ORDER=(COM,SUB)]
instructs CP/M to look for the program-name specified in command lines first as a COM file and then as a SUB file.

Further forms of SETDEF exist, but these are outside the scope of this manual.

Examples

A>SETDEF B:,*
instructs the system to search for each program file initially on the disc in Drive B, but if that fails to then search for it on the disc in the default drive.

This utility is described in Section 3.15 ('Shortening the command line').

SETKEYS

Utility

Configures the keyboard in accordance with data contained within a pre-defined Key Definition File.

SETKEYS filespec
configures the keyboard in accordance with the data within the file with the given file specification.

By setting up a suitable Key Definition File and then using the SETKEYS commmand to implement the key definitions contained in the file, you can make specific keystrokes generate characters, control codes or even a whole string of characters and codes - instead of whatever character or code they are set up to generate initially.

The Key Definition File is made up of a sequence of lines, each of which specifies the number of the key you want to affect, the shift state of this key you want to affect (Normal, with Caps Shift, with Symb Shift or with Extend mode) and the details of the code you want this key to generate, together with an optional comment. The structure of these lines is as follows:

	key-no shift-state "code" [comment]

The key numbers are obtainable from the diagram in Section 4.6.1.

The shift states are: N or nothing for No shift, C for Caps Shift; S for Symbol Shift; and E or CS for Extend mode. More than one shift state can be given here, the entries separated by single spaces. In that case, the definition aplies to all the named shift states.

The code you want the key to generate can be entered in a number of different ways - char, ^'value', ^char or ^'name', depending on the code that you want to generate. Here char is the character corresponding to this code, ^char is the control code Control-char, and name is the special name associated with the code (see Appendix II.1). For example, the code corresponding to the capital letter A (decimal value 65) can be entered as A or as ^'65' or as ^'41', while the control code Control-M (decimal value 13) which generates a Carriage Return can be entered as ^'13', ^'#0D', ^M or ^'CR'

Notes:

  1. The code corresponding to the characters ^ and " cannot be entered as char but they can be entered as ^^ and ^", respectively.
  2. Assigning the code with value #9F to a key will make this key be ignored when it is pressed.

Codes with values between #80 and #9E (decimal 128...158) are expansion tokens which are available to be associated with a string of characters and codes - for example, a complete command line. Such a string of characters and codes is known as an expansion string. A number of expansion strings are automatically set when CP/M is loaded: these are listed in Appendix II.2.2. To associate other expansion strings with key definition tokens, you have to include lines of the following form in the Key Definition File:

    E expansion-token "expansion-string" [comment]

Here expansion-token is a decimal or hexadecimal value and expansion-string is a string of characters and control codes. Characters can be entered as char or ^'value'; Control codes can be entered as ^'value', ^char or ^'name'.

Note: The total number of characters and codes held in expansion strings must not exceed 120. (The supplied expansion strings make up a total of 30.)

The optional commend is intended to be used to remind the user of the action of the key definition on that line. Any text may be inserted here.

Lines within the file that contain errors will generate error messages but will otherwise be ignored.

Important: Besides changing key definitions yourself with SETKEYS, the programs you run may also change them. To return to the standard set of key definitions (ie. those set up immediately after CP/M has been loaded), insert the CP/M Start-up disc in Drive A and type the command:

    A:SETKEYS RESET.KEY

Example

SETKEYS KEYS.EG
Implements the key definitions specified in the Key Definition File KEYS.EG.

This utility is described in Section 4.6 ('Redefining the keyboard')

SETLST

Utility

Sends a string of codes to the printer to initialise it. The string of codes is held in a Printer Definition File, which is named in the command.

The printer that it initialises is the one that is addressed by the logical device LST:. This is normally any printer attached to the built-in Printer port, but see the DEVICE command.

The codes required to initialise a printer in a particular way will be given in the manual for that printer.

The codes can be entered in the printer definition file in a number of different ways - char, ^'value', ^char or ^'name', depending on the code. Here char is the character corresponding to this code, ^char is the control code Control-char, and name is the special name associated with the code (see Appendix II.1). For example, the code corresponding to the capital letter A (decimal value 65) can be entered as A or as ^'65' or as ^'41', while the control code Control-M (decimal value 13) which generates a Carriage Return can be entered as ^'13', ^'#0D', ^M or ^'CR'

Note:The code corresponding to the characters ^ and " cannot be entered as char but they can be entered as ^^ and ^", respectively.

SETLST filespec
initialises the printer by sending the string of codes stored in the Printer Definition File specified by filespec.

Example

SETLST PTRINIT.A
Initialises the printer addressed by the logical device LST by sending the string of codes held in the Printer Definition File PTRINIT.A on the default drive.
    ^'ESC' @ ^'ESC' l ^'0' ^'ESC' Q ^'139' ^'SI' ^'ESC'd

This example string is made up of codes that are used by Epson-compatible printers. If this string were sent to such a printer, it would:

This utility is covered in Section 4.5 ('Setting up the Printer port').

SETSIO

Utility

Sets the parameters of the RS232 port (addressed as SIO).

The parameters can be set piecemeal as the latest value of any of the parameters is the one that applies.

SETSIO [option[ option]]
sets one or more of the interface parameters, then displays the current settings. The options are separated by single spaces and are taken in any order from:
TX n
sets the transmitter baud rate
RX n
sets the receiver baud rate
n
sets both baud rates to the same value
BITS n
sets the number of data bits (5, 6, 7 or 8)
STOP n
sets the number of stop bits (1, 1.5 or 2)
PARITY type
sets the parity type (EVEN, ODD or NONE)
XON state
sets the XON protocol to ON or OFF
HANDSHAKE state
sets the handshake to ON or OFF
INTERRUPT state
sets interrupt driven input to ON or OFF

TX may be shortened to T; RX to R; STOP to S; BITS to B; PARITY to P; XON to X; HANDSHAKE to H; and INTERRUPT to I.

Note: On the Spectrum, INTERRUPT has no effect and setting the XON to ON is not recommended.

The allowed baud rates are 150,300,600,1200,1800,2400,3600,4800,7200,9600 and 19200

In the absence of any specific setting of the number of stop bits, this value will be set to 1. Setting 1.5 stop bits is treated as a setting of 2.

Any illegal option causes an error message but is otherwise ignored.

Examples

A>SETSIO
9600 Bits 8 Parity none Stop 1 Xon off Handshake on
A>SETSIO P EVEN
9600 Bits 8 Parity even Stop 1 Xon off Handshake on
A>SETSIO P EVEN, H OFF, BITS 7
9600 Bits 7 Parity even Stop 1 Xon off Handshake off

This utility is described in Section 4.2 ('Using the RS232 port for a Serial Printer').

SET24X80

Utility

Sets the screen size to 24 lines by 80 characters. This screen size is required by some application programs.

Alternatively, it restores the screen to its normal size of 23 lines by 51 characters.

SET24X80
sets 24 x 80 mode.
SET24X80 ON
sets 24 x 80 mode.
SET24X80 OFF
restores the screen's normal characteristics.

This utility is described in Section 1.3 ('CP/M and the screen').

SHOW

Utility

Displays information about the accessed discs, including the access mode, the amount of free disc space, the disc label, the number of files on the disc corresponding to each user number and the number of free entries in the disc's directory.

SHOW
displays the access mode and the remaining space on the disc (in kilobytes) for each logged-in drive in turn.
SHOW drive:
displays the access mode and the remaining space (in kilobytes) on the disc in the specified drive.
SHOW drive:[USERS]
details all the user numbers applying to the disc, the number of files relating to each number and the number of free entries in the disc's directory.
SHOW drive:[DIR]
displays the number of free entries in the disc's directory.
SHOW drive:[DRIVE]
displays the characteristics of the specified drive.
SHOW drive:[LABEL]
displays the name of the disc in the specified drive.

Note: There must be no space between the drive specification and the bracketed options.

Examples

A>SHOW
A: RO, Space:  4k
B: RW, Space:104k
1A>SHOW [USERS]
Active User:     1
Active Files:    0    2    3    4
A: # of files:  10    2   11    1

This utility is described in Section 3.1 ('Assessing the available space').

SID

Utility

SID is CP/M Plus's Symbolic Instruction Debugger.

Enables the execution of programs to be monitored - by displaying the contents of the memory, displaying the contents of the CPU registers and directing breakpoint operations during debugging.

The associated utilities, TRACE.UTL and HIST.UTL, provide additional debugging tools. TRACE provides a trace back of the instructions that led to a particular breakpoint in the program under test: HIST produces a histogram showing the frequency with which code from selected program segments was accessed.

This utility is not covered any further in this manual.

STSERIAL

Utility

Sets the parameters of a Serial Interface attached to the Expansion port (addressed as SERIAL).

Note: For the SERIAL device to be available, it has to have been installed when CP/M is loaded. This requires SERIAL.FID to be on the disc from which CP/M is loaded.

The parameters can be set piecemeal as the latest value of any of the parameters is the one that applies.

The settings described here are the ones supported by the supplied SERIAL.FID. If you have adapted SERIAL.FID to suit your own particular interface, this may affect the range of parameters and the settings you make.

STSERIAL [option[ option]]
sets one or more of the interface parameters, then displays all the current settings. The options are separated by single spaces and are taken in any order from:
TX n
sets the transmitter baud rate
RX n
sets the receiver baud rate
n
sets both baud rates to the same value
BITS n
sets the number of data bits (5, 6, 7 or 8)
STOP n
sets the number of stop bits (1, 1.5 or 2)
PARITY type
sets the parity type (EVEN, ODD or NONE)
XON state
sets the XON protocol to ON or OFF
HANDSHAKE state
sets the handshake to ON or OFF
INTERRUPT state
sets interrupt driven input to ON or OFF

TX may be shortened to T; RX to R; STOP to S; BITS to B; PARITY to P; XON to X; HANDSHAKE to H; and INTERRUPT to I.

Note: On the Spectrum, INTERRUPT has no effect.

The allowed baud rates are 150,300,600,1200,1800,2400,3600,4800,7200,9600 and 19200. You should, however, only use baud rates supported by the communications package you are using.

In the absence of any specific setting of the number of stop bits, this value will be set to 2 if the baud rate is 110 but to 1 for any other value of the baud rate.

Any illegal option causes an error message but is otherwise ignored.

Examples

A>STSERIAL
9600 Bits 8 Parity none Stop 1 Xon off Handshake on
A>STSERIAL P EVEN
9600 Bits 8 Parity even Stop 1 Xon off Handshake on
A>STSERIAL P EVEN, H OFF, BITS 7
9600 Bits 7 Parity even Stop 1 Xon off Handshake off

This utility is described in Section 4.3 ('Using your Spectrum +3 for communications').

SUBMIT

Utility

Causes the batch of commands within a .SUB file to be executed one by one, just as if they were typed in succession at the keyboard.

The .SUB file is made up of CP/M Plus commands, nested SUBMIT commands (if so desired) and input data for CP/M commands and/or CP/M programs. Command lines may be no more than 128 characters long.

Lines of input data for the programs run by the submit file are each started by a <

If a program run from within the SUB file terminates before using all its associated input data, the message Warning: Program input ignored is displayed before the next command within the file is executed. If too few lines of input data are given, SUBMIT expects these to be entered ad the keyboard.

The .SUB file can incorporate variables representing up to 9 SUBMIT command inputs, represented by $1..$9. If a $ is to be included in the file for any other purpose, it must be inserted as $$

SUBMIT filespec
causes the set of commands contained within the SUB file to be executed line by line. There is no need to include the filetype .SUB in the filespec.
SUBMIT filespec input1[ inputN]
causes the set of commands contained within the SUB file to be executed line by line with $1 replaced by input1, and so on.
SUBMIT
prompts for the specification of the SUB file to be executed and for any inputs that are required.

Example

A>SUBMIT SUBFILE INPUTA INPUTB
causes the commands within SUBFILE.SUB (which refers to $1 and $2) to be executed line by line, replacing $1 by INPUTA and $2 by INPUTB throughout.

This utility is described in Section 3.15 ('Shortening the command line').

TIMEOUT

Utility

Enables/disables device timeouts.

As a rule, CP/M Plus automatically times out sending information to a device in order to prevent the system 'locking up' completely because the information is being sent to a non- existent device. So, for example, if Control-P ([Extend Mode] + P) is typed accidentally when no printer is connected, CP/M will recognise after about 30 seconds that no printer is responding and produce a message like this:

    LPT not ready - Retry, Ignore or Cancel?

You can then either switch the printer on-line and Retry - or type C for Cancel and redirect the output to a null device.

Unfortunately, some printers take such a long time feeding a sheet of paper that CP/M times out before the operation has finished, requiring you to type R to continue. The better solution is to disable the timeout for the device by using the TIMEOUT command.

TIMEOUT DEVICE OFF
disables timeouts for the output device called device (Device names are given in the description of the DEVICE command)
TIMEOUT DEVICE ON
re-enables timeouts for device
TIMEOUT DEVICE
shows whether timeouts are enabled for device
TIMEOUT
shows whether timeouts are enabled for each device

Example

A>TIMEOUT SIO OFF
disables the timeout for the serial interface.

This utility is introduced in Section 4.1 ('Setting up the parallel Printer port').

WARNING: IF 'TIMEOUT OFF' IS SELECTED FOR A DEVICE THAT IS NOT FITTED, CP/M WILL LOCK UP.

TYPE

Built-in command

Displays the contents of an ASCII file on the monitor, either a screenful at a time (press [Enter] to see the next screenful) or continuously. Press [Extend Mode] + C to abandon the display.

TYPE filespec
displays the contents of the file with the given file specification a screenful at a time.
TYPE filespec [NO PAGE]
displays the contents of the file with the given file specification continuously. (Note: This requires the companion TYPE.COM utility to be on the search path.)

If no file is found with the given file specification, the message No File is displayed.

This command is described in Section 3.11 ('Listing a file').

USER

Built-in command

Sets the user number, with the result that all files subsequently created are assigned this user number and access is restricted to files with this number and to system files with user number 0.

The user number may take any value between 0 and 15. The default value is zero. The current user number setting is reflected in the current system prompt.

USER number
changes the current user number to number. If no number is specified, a screen message appears that askes for the required number. The system responds with a modified system prompt.

Example

A>USER 3
3A>
changes the current user number from its default value of 0 to 3. Newly created files will be stored under this user number and the user now only has access to files with this user number and system files with user number 0. Note the changed system prompt.

This utility is described in Section 3.12 ('Organising your discs').

XREF

Utility

Produces a file containing a cross reference summary of the variable usage in an assembler program from the PRN and SYM files produced by prior operation of the MAC or RMAC utility on this program.

This utility is not covered any further in this manual.
Previous chapter Index Mallard BASIC introduction