Previous chapter Index Next chapter

Chapter 2

CP/M programs

The advantage of running CP/M Plus on the Spectrum +3 is that you can then run a number of programs - both programs bought 'off the shelf' from your computer dealer and 'Public Domain' programs available, for example, on computer enthusiasts' Bulletin Boards. These programs might be computer games, word processors, accountants' spreadsheets or project planners.

Unfortunately, although CP/M software will run on the Spectrum +3, it won't always produce the results you expect. It may not control the screen or the printer properly, or it may not respond correctly to the keyboard. If it is to work correctly, it will usually have to be 'installed' on the Spectrum +3.

This chapter provides a guide to avoiding the pitfalls and generally getting the best out of CP/M programs you buy. It will be useful to have this chapter handy when you buy software from an independent software dealer so that the dealer can check whether the software will work properly on the Spectrum +3.

2.1 Suitable software

Software for the Spectrum +3 must be:

It is also advisable to choose, if possible, software that has been installed to run on the Spectrum +3.

Your dealer will be able to tell you whether a suitable version of the software you want to use does exist. If the software is available in the right format but has not been installed on the Spectrum +3, you (or your dealer) will need to modify the program so that it will work correctly on your machine. This is a straightforward task but it may require detailed background knowledge.

If the program was written specifically for another computer, it may not be possible to modify it without specialised help. Check with your dealer that this is not the case! The process of modifying the program is called installing and it is covered in Section 2.4 of this chapter.

2.2 First steps

Whether your software is ready to run on the Spectrum +3 or whether it has to be installed first, it is wise to start by making a copy of the software discs you have just bought. That way you can keep the originals as the Master Copy, safely stored away in case of accidents.

A good move before you get involved in copying is to open the Write Protect Holes on your system disc and the discs you intend to copy so that you cannot spoil them by accidentally writing to them. So do this before you go any further. 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.

If the programs are supplied specifically for use with CP/M on the Spectrum +3, you can use DISCKIT to copy the whole disc.

If the programs are supplied set up for some other computer, for example the Amstrad CPC6128, you will need to format as many new blank discs as you require using DISCKIT (see Section 3.9) and then copy the files on the Master disc to your new discs. This file transfer can be done by using the PIP utility (as described in Section 3.3).

You are now ready to go on to either run the software or to install it.

2.3 Running ready installed software

The next step is to organise your working discs to make the software easy to run. There are essentially two approaches to running an applications program. You can:

Either: Load the CP/M operating system from your CP/M Start-up disc. Then replace this disc with the one holding the copy of the software and type the command(s) you need to run your applications program

Or (if possible): Create a special Start-up disc that holds the following:

We describe how to set up such a disc below.

The other things to pay attention to are:

The command that changes over to the 24 x 80 size of screen is:

        SET24X80  [Enter]

When you want to return to using the standard 24 x 51 screen, type the command:

        SET24X80 OFF  [Enter]

You can now run the software by loading CP/M and then running your program, following the instructions in the program's own instruction manual / user guide. The final piece of advice is to keep duplicate copies of all your important data files: the quick and simple way of doing this is to copy the whole disc, using DISCKIT.

Creating an Application Start-up disc

Note: You can only create a Start-up disc for your application if it is possible to fit the file containing the CP/M operating system on the same disc as your application program and all the support files it needs.

If your application program is supplied specifically for use with CP/M on the Spectrum +3, the way to create such a disc for yourself is to use the DISCKIT utility to make a copy of this disc on a fresh disc (see Section 3.2) and then use PIP with the [O] option to copy from your CP/M Start-up disc the file containing the CP/M operating system, the current PROFILE.SUB file and any CP/M utilities you want to this disc - see Section 3.3.

(Using the [O] option is not essential but it is advised, whenever you want to copy program files. See the description of the PIP utility in Chapter 5 for details.)

If the program is supplied for use with CP/M on some other computer (for example, a CPC6128), you need to use DISCKIT to format a fresh disc (see Section 3.9) and then use PIP to copy the files you require both from your CP/M Start-up disc and from your application master disc (see Section 3.3). Again, we suggest using PIP with the [O] option when copying these files (see the description of the PIP command in Chapter 5 for details).

Either of these routes gives you a disc holding all the programs and data files you need. All that remains to do is to set up the PROFILE.SUB file so that immediately after loading, CP/M automatically loads and runs your application program.

The precise details will depend on the software you want to run in this way, but essentially, what you have to do is edit PROFILE.SUB so that it ends with the command lines you would normally type to run the application.

Suppose, for example, that to run your program you normally type the commands:

	SETKEYS KEYS.APP
	APPLIC B:DATAFILE

and when you have finished using the APPLIC program, you return the keyboard to normal with the commands:

    SETKEYS RESET.KEY

(What these 'Keys' commands do is explained in Section 4.6.)

To make all this happen for you, you might edit the supplied PROFILE.SUB file (using RPED, say - see Section 3.6) and add these command lines to the end of this file, giving you the new PROFILE.SUB file:

	SETDEF C:,* [ORDER=(SUB,COM),TEMPORARY=C:]
	PIP
	<C:=PIP.COM
	<C:=SET24X80.COM
	<
	SETKEYS KEYS.APP
	APPLIC B:DATAFILE
	SETKEYS RESET.KEY
Using a Start-up disc with such a PROFILE.SUB on it is sometimes known as Turnkey Operation because you just turn the computer on and the software runs. It is particularly useful if you want other people, who may not understand CP/M, to use the software you have bought. You can then just tell them to turn the Spectrum +3 on, put in the disc, press the Space bar and follow the instructions both on the screen and in the program's own instruction manual / user guide.

When programs need two drives

A number of programs are designed for use on computers with two disc drives. These programs can still be run on a Spectrum +3 with just one disc drive.

The reason you can do this is that the Spectrum +3 can pretend to CP/M that there are really two disc drives - called Drive A and Drive B. CP/M then alternates between addressing the disc drive as Drive A and addressing it as Drive B, according to the needs of the application program.

The moment the drive is changed from Drive A to Drive B, the message in the bottom right hand corner of the screen changes to Drive is B and you will get a message asking you to replace the disc currently in the drive by the disc 'for Drive B' - ie. the one that you would use in the second drive if you had such a drive. Similar messages appear when the drive is changed from Drive B to Drive A.

The messages that you get are the same as those you will have seen if you worked through the 'Practice in using CP/M' (Section 1.5) and so used PIP to copy BASIC.COM to your Data disc. There the disc to put in 'Drive A' was the CP/M Start-up disc and the one to put in 'Drive B' was your data disc, and the messages you saw were:

	Please put the disc for A: into the drive and press any key
whenever CP/M needed your CP/M Start-up disc, and:
	Please put the disc for B: into the drive and press any key
whenever it needed your Data disc. When you have inserted the right disc, you simply press a key - for example, the Space Bar.

2.4 Installing the software

This section advises you on how to go about installing software. If your software comes ready installed, this section should be ignored.

The first thing to find out is whether the application you would like to install on your Spectrum +3 was written specifically for another computer or for a range of computers. If it was written specifically for another computer, you will probably need specialised help.

If it was written for a range of computers, there will be a program (either with the software or as a special part of it) that is designed to help you install the application. The job of this installation program is to set details within the main program according to information you supply about how the Spectrum +3 works.

The relevant information about the Spectrum +3 is tabulated at the end of this chapter. However, the form in which the details will be requested varies from software package to software package, and so there is no guarantee that you will be able to use this information directly.

If you are lucky, how the installation program works will be explained in the documentation supplied with the software. Your best source of advice is your dealer who will know both the Spectrum +3 and the software you propose to install.

Running the installation program

The installation program will typically request information from you through a sequence of questions on the screen.

Software suppliers typically include a fairly detailed set of instructions with any software package that needs installing, and we strongly advise you to read this.

The questions that appear on the screen mainly refer to the codes generated by keystrokes at the keyboard, the codes required by the screen to move the cursor around or display information, and the form in which data needs to be presented to the printer. Many of these codes have been standardised over the years: it is just the ones that can vary from machine to machine that need to be specified.

The installation program is likely to start by asking you what kind of monitor and what kind of printer you have. It may well do this by offering you a list of possibilities.

If Zenith Z19/Z29 is on its list of monitors, select this. The Spectrum's screen is sufficiently like these to allow most programs to run properly.

Other programs may require you to specify the parameters more precisely. You will need to draw the answers to specific questions one by one from the tables on the following pages.

One option you can take in matching the keyboard to the program is to use the SETKEYS utility to redefine the codes the keyboard produces. The way to do this is described in Section 4.6. This can be simpler than giving the installation program details of the codes produced at present.

The installation program of the software package sould only ever need to be run once. The program ensures that the special parameters are set to the right values throughout the software package. However, if you do use SETKEYS, this has to be run each time.

2.5 Spectrum +3's parameters

Keyboard operations (Standard keyboard layout)

Hex ValueDecimal ValueKey Number
Cursor up [^] #1F31 23+[Caps Shift]
Cursor down [v] #1E30 24+[Caps Shift]
Cursor left [<] #066 22+[Caps Shift]
Cursor right [>] #011 19+[Caps Shift]
Delete character under cursor [Graph] #077 21+[Caps Shift]
Delete last character [Delete] #7F127 20+[Caps Shift]
Escape (exit) [Break] #1B27 35+[Caps Shift]
Return [Enter] #0D1330
Space [Space] #203235
Tab [Inv Video] #099 18+[Caps Shift]

Further details of the keyboard control codes are given in Appendix II.

Screen operations

Hex ValueDecimal Value
Sound bleeper (Bell) #07 7
Move cursor back one space #1B #4427 68
Move cursor forward one space #1B #4327 67
Move cursor down one line #1B #4227 66
Move cursor up one line #1B #4127 65
Carriage return #0D 13
Line feed #0A 10
Delete character under the cursor #1B #4327 78
Backspace #08 8
Clear the screen #1B #4527 69
Clear all the screen up to the cursor#1B #6427 100
Clear all the screen after the cursor#1B #4A27 74
Clear the line to left of cursor #1B #6F27 111
Clear the line to right of cursor #1B #4B27 75
Move the cursor to top left corner of the screen #1B #4827 72
Move cursor to row r, columnc#1B #59 r c27 89 r c
(r and c are actual values plus #20 (hex), 32 (decimal))
Insert a line #1B #4C27 76
Delete a line #1B #4D27 77
Enter inverse video #1B #7027 112
Leave inverse video #1B #7127 113
Enter underline mode #1B #7227 114
Leave underline mode #1B #7527 117

Further details of the keyboard control codes are given in Appendix III.


Previous chapter Index Next chapter