Previous chapter | Index | Mallard BASIC introduction |
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.
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
DIRAnything 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
Name | Location | Description | Page |
---|---|---|---|
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 stamping | 104 |
PIP | PIP.COM (Side 1) | Copy files | 107 |
PUT | PUT.COM (Side 2) | Specify destination of Screen and Printer output | 110 |
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 order | 116 |
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 |
Name | Location | Description | Page |
---|---|---|---|
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 |
LANGUAGE | LANGUAGE.COM (Side 1) | Change national character set | 104 |
PALETTE | PALETTE.COM (Side 1) | Set the colours used on the screen | 106 |
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 |
SET24X80 | SET24X80.COM (Side 1) | Set the screen size | 121 |
STSERIAL | STSERIAL.COM (Side 2) | Set up the Expansion port | 122 |
TIMEOUT | TIMEOUT.COM (Side 1) | Enable / disable device timeouts | 125 |
Name | Location | Description | Page |
---|---|---|---|
DUMP | DUMP.COM (Side 2) | Display the contents of a file in hex | 97 |
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 file | 105 |
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 |
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.
This utility is not covered any further in this manual.
DEVICE | Utility |
CP/M Plus supports the following five logical devices:
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:
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.
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.
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:
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.
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:
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 to see the remainder of the listing.
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 TMThis 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.
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 to see the remainder of the listing.
A>DIRSYS A: GENCOM CMD : HEXCOM CMD : PATCH OVR A>DIRS *.CMD A: GENCOM CMD : HEXCOM CMDThis 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 . 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.
Entered by selecting 1 from the main menu. Note that any formatting required is carried out automatically as part of the copying process.
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.
Entered by selecting Q from the main menu. Note that formatting a disc on which data is stored erases that data.
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.
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.
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.
This utility is described in Sections 3.2 ('Copying discs') and 3.9 ('Formatting discs').
DUMP | Utility |
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.