Index | Chapter 1 |
© Copyright 1988 Locomotive Software Limited
Sections of the text: © 1985, 1987 AMSTRAD plc
All rights reserved.
Neither the whole, nor any part of the information contained in this manual may be adaptedor reproduced in any material form except with the prior written approval of Locomotive SoftwareLimited.
While every effort has been made to verify that this software works as described, it is not possible to test any program of this complexity under all possible circumstances. Therefore thesoftware supplied in this package is provided 'as is' without warranty of any kind either express or implied.
The particulars supplied in this manual are given by Locomotive Software in good faith. However,the software described is subject to continuous development and improvement ,and it is acknowledged that there may be errors or omissions in this manual. In particular, themessages shown in this manual may differ in detail from those actually shown on the screen.
Locomotive Software reserves the right to revise this manual without notice.
Written and edited by Jean Gilmour, Locomotive Software
(Includes material written for AMSTRAD plc and material written by Ed Phipps Documentation Servicesfor Locomotive Software)
Produced and typeset electronically by Locomotive Software Ltd
Printed by Ashford Colour Press, Gosport, Hants
Published by Locomotive Software Ltd
Allen Court
Dorking
Surrey RH4 1YL
First Published 1988
ISBN 1 85195 011 7
LOCOMOTIVE and LOCO are registered trademarks of Locomotive Software Ltd
Mallard BASIC is a trademark of Locomotive Software Ltd
AMSTRAD is a registered trademark of AMSTRAD plc
Spectrum +3, PCW8256, PCW8512, PCW9512, CPC6128 are trademarks of AMSTRAD plc
CP/M, CP/M Plus are trademarks of Digital Research Inc
WordStar is a trademark of MicroPro International Corp
VT52 is a trademark of Digital Equipment Corp
Z19, Z29 are trademarks of Zenith Data Systems Inc
CP/M for the Spectrum +3 comprises:
- CP/M Plus, version 3 of Digital Research's CP/M ('Control Program for Microcomputers')
- Locomotive Software's Mallard BASIC
CP/M is an operating system which means that its job is to run programs and help you organiseyour data. CP/M makes each computer on which it is used behave in the same way. As CP/M is used on many different computers the world over, you will have many thousands of programs from whichto choose - programs that might have originally been written with another computer in mind butwhich will run equally well on your Spectrum +3. These programs might be accountants' spreadsheetsor word processors - even computer games (though perhaps without some of the spectacular effectsof programs written specifically for the Spectrum).
What is particularly important is that CP/M Plus for the Spectrum +3 is fully compatible withthe CP/M for other Amstrad computers - the CPC6128 personal computer and all the PCW machines. SoCP/M programs supplied for these computers are automatically set up correctly for running on yourSpectrum +3.
One of the main advantages of using a well-established operating system such as CP/M is that it opens up a wide range of professional programming languages to you. Locomotive Software's MallardBASIC, supplied on the disc alongside CP/M, is just such a programming language.
Mallard BASIC is a powerful modern BASIC with a number of significant improvements. In particular,Mallard BASIC has the very unusual facility (for BASICs on microcomputers) of indexing data storedin a file and automatically keeping this index in alphabetical order. This takes all the hard workout of preparing and using your own database.
In addition, Mallard BASIC will accept programs written for the industry standard Microsoft BASIC with little or no modification.
- We should point out that some keys on the keyboard produce different characters or different actions when you run CP/M and Mallard BASIC to those they have when using SpectrumBASIC. Details of the characters and actions that the keyboard is set up to produce when youuse CP/M are given in Appendix II.
About this User Guide
This User Guide is in three parts:
- Part I: CP/M Plus - describes how to run the CP/M Plus operating system andhow to use it both to run programs and to carry out a range of standard tasks, such as organising the files on your discs.
- Part II: Mallard BASIC - describes the facilities provided by Mallard BASIC andshows you how to use these in a way that is suitable for anyone that is new to using this versionof BASIC, including those who have never programmed before.
- Part III: Appendices - gives detailed information about the version of CP/Mprovided for your Spectrum +3 - the characters you can type and how to type them, the codes usedto control the screen and a full list of system error messages.
Part I gives you all the information you need for general use of the CP/M Plus operating system;Part II is specifically to help you use the Mallard BASIC programming language supplied on the disc;Part III provides reference information on CP/M for the Spectrum +3.
Part II provides only an introduction to Mallard BASIC. If you wish to use Mallard to writeanything more than very simple programs, we would recommend you to buy a copy of 'Mallard BASIC: Introduction and Reference' (available from Locomotive Software, price £9.95).
Essential Preparation
The first thing to do is to make a copy of the supplied Master CP/M disc. You need this copyto give yourself a disc to use every day to load CP/M. (Such a disc is often described as a Start-up disc.) The supplied disc shouldn't be used as your Start-up disc because then you wouldrisk damaging the disc and losing all the valuable software on it. Instead, it should be stored safely away, to use only to make another copy if your 'Working' copy gets damaged.
Copying a disc means copying all the data from one disc to another in such a way that the second disc becomes identical to the first. The program that does this is called DISCKIT. To useDISCKIT, you simply load the program and then follow instructions on the screen. The whole processshould take about five minutes. The steps to take are given below: these assume that your Spectrum +3 is switched off at the start.
You also need to give yourself a 'Data' disc to store any other programs and data on. It is bestnot to use your Start-up disc as anything other than the disc you use to load CP/M and its associated'utility' programs.
You will need two new blank discs for this - one for your copy of the supplied disc, and onefor your Data disc.
Initial steps
- Write 'CP/M Start-up disc' on the label on Side 1 of the disc you are going to use as your CP/M Start-up disc.
- Write-protect the supplied disc, by ensuring that the Write Protect Holes in thetop corners of the disc (away from the disc label) are open.
This step is most important as it protects the supplied disc against being accidentallyoverwritten while the disc is being copied.- There is a diagram showing the position of the Write Protect Holes and how they open and close in Chapter 5 of the Spectrum +3 User Guide.
- Check that there is no disc in the drive; then turn the machine on. Your Spectrum thendisplays its standard Opening Menu.
- Hold the supplied master disc by its labelled end with Side 1 uppermost and insert it into the built-in floppy disc drive (Drive A).
- Check that the Loader option is highlighted, and then press . The Spectrum then displays the message Loader and reads from the disc.
If all is well, the Spectrum then displays a message like:
CP/M Plus Locomotive Software Ltdvx.x, 61K TPA, 1 disc driveRAMDISC vx.x [size=12k] installed
and carries out a few extra commands. Finally it stops, with A> on a fresh linefollowed by a bright oblong.If instead the screen flashes red or you see the message Insert TAPE and press PLAY,the disc you've used either isn't suitable for loading in a Spectrum or is damaged in some way.Check that you inserted the correct disc then try again. If it still fails, take the disc backto your dealer.
Copying the Master disc
- Leave the 'Master' CP/M disc in the drive, type DISCKIT (you will see the characters appear on the screen after the A> prompt.) and press the key.
- Up on the screen will come a series of messages. The first message tells you to remove yourdisc; press (say) when you have done this.
- The next message offers you the choice of Copy, Format or Verify (or exit from DISCKIT) andtells you which key to press to select each option. In this case, you want Copy, so press the 1 key.
- If your Spectrum has two floppy drives, you will be asked which drive you want to read from - press A for Drive A, the built-in disc drive; you will then be asked which drive youwant to write to - press Q for drive B, your second disc drive. If your Spectrum just has one discdrive, this stage is omitted.
- The next message that appears asks you to '...put the disc you wish to READ into the drive,then press Y'. In this case, the disc you want to copy is the supplied Master disc, so re-insertthis disc with side 1 uppermost and type Y.
Copying will now start. You will see the system counting through the numbers 0...39 both as itreads the information on the Master disc and as it writes the copy on the new disc. If you have asingle-drive system, copying will take place in a number of parts - each part copying a section ofinformation on the disc to READ (the supplied disc) onto the disc to WRITE (the disc you'velabelled 'CP/M Start-up disc'). This involves swapping the disc you have in the drive at variouspoints in the process in response to messages displayed on the screen.
- When a message appears asking you to insert the disc to WRITE, insert the new blank disc in the drive specified in the message, with Side 1(the side you labelled) uppermost, and press.
DISCKIT will start to write the information it has copied from the Master disc onto the newdisc. If the new disc hasn't yet been marked out ready to store information, DISCKIT will displaya message telling you it is 'Going to format the disc in drive A: while copying'.
- On a single-drive machine, the following message will appear after a short while:
Insert disc to READ into drive A:Press any key to continue
You must now re-insert the supplied disc so that the second part of the copy can go ahead (press when you havedone this). After a while, you will similarly be asked to insert the disc to WRITE again - andso on until the whole of the disc has been copied (four pairs of operations).If you accidentally mix up the disc you are reading from (the Read disc) and the discyou are writing to (the Write disc) DISCKIT will spot this and display an appropriate message.
Any error messages that appear should also be self explanatory, but if you feel in need ofextra help, refer to Part I, Chapter 5 where full details of DISCKIT are given.
- When copying is complete, you will see the message:
Copy completedRemove the disc from the drivePress any key to continue
Release the disc(s) from the drive(s) and press .You have now copied Side 1 of the Master disc onto your CP/M Start-up disc. - You are next asked whether you want to copy another disc. The second side of the Master disccounts as another disc, so re-insert the Master CP/M disc - this time with Side 2uppermost - and press Y.
Side 2 of the Master disc is copied as before. When a message appears asking you to insertthe disc to WRITE, insert your new disc in the drive specified in the message - this time withSide 2 uppermost - and press .
- This time when copying has been completed, remove your new disc from the drive and put it to one side;you hae now made your working CP/M Start-up disc. Then press twice to return to DISCKIT's main menu.
Preparing a Data disc
You now need to use DISCKIT to prepare your second blank disc as your Data disc. Important:Do not use a disc that already has information stored on it unless you are sure that you do not wantthat data. The process described here completely erases any information currently onthe disc.
- The process of preparing a disc is called Formatting, so this time the option you want touse from this menu is Format - ie. press the Q key.
- If your Spectrum has two floppy discs, you will be asked which drive you want to format thedisc in - press A for Drive A, the built-in disc drive.
- The next message that appears asks you to '...put the disc to FORMAT into the drive, thenpress Y'. Insert your second new disc and type Y.
Formatting will now start. You will see the system counting through the numbers 0...39 asit prepares the new disc.
- When formatting is complete, you will see the message Format completed. Release the new disc from the drive and press .You have noew formatted Side 1 of your Data disc.
- You are next asked whether you want to format another disc. The second side of the new disccounts as another disc, so re-insert your Data disc - this time with Side 2uppermost - and then press Y.
Side 2 of the disc is then formatted as before.
- This time when copying has been completed, remove your new disc from the drive and put it to one side; you have now made yourself a Data disc. Then press twice to return toDISCKIT's main menu.
- Finally press M to leave DISCKIT.
Conventions
Throughout this user guide, various conventions are used to represent different types of information. The principal conventions are as follows:
INPUT, PRINT,
etc.- The names of commands and programs are shown in capital letters throughout this userguide. It does not matter whether you type these names as capitals or as lower case letters.
- text in this style
- This style of text is used to indicate something to type or something displayed on the screen, in order to distinguish it from descriptive text. This text should be typed exactlyas shown. In particular, you must be careful to use the correct type of brackets. If square brackets [ and ] are shown, you cannot use round brackets ( and) instead. However, letters shown here as capitals can be typed in either upper orlower case.
- descriptions-in-italic
- Italic text is used for descriptions of the type of information that is required, rather than the information itself. For example, number could be 1 or 2 or 3 etc. If the description of a single item is more than one word long, the words are joined by hyphens: forexample, line-number.
The majority of descriptions are explained in the accompanying text. The remainder are self-explanatory.
- [items in slanted brackets]
- Slanting brackets round an item is used to show that this item is optional. Normally, including the item and omitting the item produce different effects. The brackets themselvesshould always be omitted.
- , etc.
- These graphics are used to represent 'named' keys on the keyboard. For example, represents the Enter key - not the letters E N T E R. Letter and digit keys are represented by the character itself. Forexample, Q represents the Q letter key.
- Control-character
- This represents a 'Control code'. The key to press will often be one of the special 'function'keys (listed in Appendix II.2) but holding down and then typing character will always work as well.
Part I: CP/M Plus
1 | Introduction to CP/M Plus | 1 |
---|---|---|
1.1 | Getting started | 3 |
1.2 | CP/M and the keyboard | 4 |
1.3 | CP/M and the screen | 5 |
1.4 | More about CP/M | 9 |
1.5 | Some practice in using CP/M | 13 |
2 | CP/M Programs | 25 |
2.1 | Suitable software | 25 |
2.2 | First steps | 26 |
2.3 | Running ready installed software | 26 |
2.4 | Installing the software | 29 |
2.5 | Spectrum +3 parameters | 29 |
3 | Standard 'housekeeping' tasks | 33 |
3.1 | Assessing the available space | 34 |
3.2 | Copying discs | 34 |
3.3 | Copying files | 36 |
3.4 | Creating files | 38 |
3.5 | Editing the command line | 40 |
3.6 | Editing text files | 41 |
3.7 | Erasing files | 43 |
3.8 | Finding the size of a file | 44 |
3.9 | Formatting discs | 45 |
3.10 | Listing the directory | 46 |
3.11 | Listing a file | 47 |
3.12 | Organising your discs | 48 |
3.13 | Protecting your files | 49 |
3.14 | Renaming files | 52 |
3.15 | Shortening the command line | 53 |
3.16 | Switching which disc is read or written | 56 |
4 | Tailoring the Spectrum to your needs | 57 |
4.1 | Setting up the parallel Printer port | 58 |
4.2 | Setting up the RS232 port for a serial printer | 66 |
4.3 | Using your Spectrum +3 for communications | 69 |
4.4 | Configuring the Memory disc | 72 |
4.5 | Selecting the appropriate national language | 73 |
4.6 | Redefining the keyboard | 75 |
4.7 | Redirecting console input and output | 80 |
5 | The CP/M built-in commands and utilities | 85 |
Alphabetical listing of the commands and utilities, with full descriptions and examples of their use. |
Part II: Mallard BASIC
1 | Starting with BASIC | 129 |
---|---|---|
1.1 | Entering BASIC | 129 |
1.2 | Leaving BASIC | 129 |
1.3 | Using BASIC | 130 |
1.4 | Giving BASIC commands | 130 |
1.5 | Types of information | 131 |
1.6 | Chapter review | 135 |
2 | Starting programming with BASIC | 137 |
2.1 | A first program | 137 |
2.2 | More complex programs | 139 |
2.3 | Changing a program | 140 |
2.4 | Chapter review | 142 |
3 | Real programming | 143 |
3.1 | Designing programs | 143 |
3.2 | Getting information | 144 |
3.3 | How information is stored | 148 |
3.4 | Outputting the results | 155 |
3.5 | Controlling the output device | 157 |
4 | Writing larger programs | 165 |
4.1 | Compartmentalising a program | 165 |
4.2 | Sequences and loops | 166 |
4.3 | Making decisions | 168 |
4.4 | Stopping the program | 172 |
4.5 | Organising the program | 172 |
5 | Manipulating information | 179 |
5.1 | Manipulating numeric information | 179 |
5.2 | Manipulating textual information | 182 |
5.3 | Converting between different types of information | 185 |
6 | Using discs for information storage | 187 |
6.1 | General disc commands | 188 |
6.2 | Sequential access files | 180 |
6.3 | Random access files | 200 |
7 | Keyed access files for data bases | 213 |
7.1 | Writing a program using Keyed files | 215 |
7.2 | Working out the main program | 216 |
7.3 | Preparatory stage | 217 |
7.4 | Adding a record | 219 |
7.5 | Reading a record | 223 |
7.6 | Deleting an entry | 225 |
7.7 | Closing the Keyed file | 227 |
7.8 | Enhancements | 229 |
8 | Machine level operations | 239 |
8.1 | General information | 239 |
8.2 | Applying a Patch | 240 |
8.3 | Loading a machine code program | 241 |
8.4 | Using a machine code program | 243 |
8.5 | Examples | 244 |
Appendices
I | Disc contents | 247 |
---|---|---|
II | CP/M Plus character set | 249 |
II.1 | The complete character set | 250 |
II.2 | The standard CP/M keyboard | 257 |
III | Terminal characteristics | 259 |
IV | BASIC keywords | 265 |
V | Reference books | 267 |
VI | Technical description | 269 |
VI.1 | Character devices | 270 |
VI.2 | Disc driver | 275 |
VI.3 | Memory organisation | 278 |
VI.4 | The BIOS | 280 |
VI.5 | Field installable device drivers | 317 |
VII | Error messages | 343 |
VII.1 | Disc handling errors | 343 |
VII.2 | Device errors | 344 |
VII.3 | CP/M Plus error messages | 344 |
Index | Chapter 1 |