Z80 second processor for the BBC Microcomputer User guide Part no 409010 Issue no 1 Date February 1984 WARNING THE Z80 SECOND PROCESSOR MUST BE EARTHED Important: The wires in the mains lead for the Z80 second processor are coloured in accordance with the following code: Green and yellow Earth Blue Neutral Brown Live As the colours of the wires may not. correspond with the coloured markings identifying the terminals in your plug proceed as follows: The wire which is coloured green and yellow must he connected to the terminal in the plug which is marked by the letter E. or by the safety earth symbol - - or coloured green, or green and yellow. The wire which is coloured blue must be connected to the terminal which is marked with the letter N, or coloured black. The wire which is coloured brown must be connected to the terminal which is marked with the letter L. or coloured red. If the socket outlet available is not suitable for the plug supplied, the plug should be cut off and the appropriate plug fitted and wired as previously noted. The moulded plug which was cut off should be disposed of as it would he a potential shock hazard if it were to be plugged in with the cut off end oft he mains cord exposed. The moulded plug must he used with the fuse and fuse carrier firmly in place. The fuse carrier is of the same basic colour as the coloured insert in the base of the plug. Different manufacturers' plugs and fuse carriers are not interchangeable. In the event of loss of the fuse carrier, the moulded plug MUST NOT be used. Either replace the moulded plug with another conventional plug wired as - previously described or obtain a replacement fuse carrier from an authorised BBC Microcomputer dealer. In the event of the fuse blowing it should be replaced after clearing any faults with a 3 amp fuse that is ASTA approved to BS1362. Not necessarily the same shade of that colour. Exposure: Like all electronic equipment, the Z80 second processor should not be exposed 10 direct sunlight or moisture for long periods. Within this publication (he term 'BBC' is used as an abbreviation for 'British Broadcasting Corporation' (c) Copyright Acorn Computers Limited 1984 Neither the whole or any part of' the information contained in. or the product described in. this manual may be adapted or reproduced in any material form except with the prior written approval of Acorn Computers Limited (Acorn Computers) The product described in this manual and products for use with it. are subject to continuous developments and improvement. All information of a technical nature and particulars of the product and its use including the information in this manual are given by Acorn Computers in good faith, However, it is acknowledged that there may be errors or omissions in this manual. A list of details of any amendments or revisions to this manual can be obtained upon request from Acorn Computers Technical Enquiries. Acorn Computers welcome comments and suggestions relating to the product and this manual. All correspondence should be addressed to Technical Enquiries Acorn Computers Limited Fulbourn Road Cherry Hinton Cambridge CB1 4JN All maintenance and service on the product must be carried out by Acorn Computers' authorised dealers. Acorn Computers can accept no liability whatsoever for any loss or damage caused by service or maintenance by unauthorised personnel. This manual is intended only to assist the reader in the use of the product, and therefore Acorn Computers shall not be liable for any loss or damage whatsoever arising from the use of any information or particulars in. or any error or omission in, this manual, or any incorrect use of the product. Written and produced by Baddeley Associates, Cambridge First published 1984 Published by Acorn Computers Limited. Fulbourn Road, Cherry Hinton. Cambridge CB1 4JN Computer typeset by the MF Graphics Group, Saffron Walden, Essex Z80 is a trademark of Zilog Inc CP/M(r) and GSX(r) are registered trademarks of Digital Research Inc CIS COBOL(tm), ANIMATOR(tm) and FORMS2(tm) are trademarks of Micro Focus Limited FilePlan(tm), GraphPlan(tm) and MemoPlan(tm) are trademarks of Chang Laboratories Inc Contents 1 The BBC Microcomputer Z80 pack 7 2 Setting up 8 Arranging your equipment 9 Connecting up 10 The function key cards 12 Switching on 14 The difference the Z80 makes 15 Using discs 15 Drives 16 The operating system 17 Loading CP/M 18 Making program discs 19 Housekeeping 19 Files 19 3 Files and filenames Rules for filenames Drive identifiers Specifying groups of files 4 Using CP/M The two kinds of CP/M command Recovering from mistakes 5 CP/M commands Switching drives Displaying a directory of your files Erasing files Renaming files Copying files Finding out information about your files Copying discs Formatting discs Copying CP/M Special key meanings in CP/M 6 The Z80 pack in action How the Z80 works The software in the Z80 pack Applications software Programming languages Follow-on software Computerising a business: the planning stage Managing your computerised systems Backing up Looking after your disks CP/M error messages Glossary Index 1 The BBC Microcomputer Z80 pack The Z80 pack gives you all you need to turn a BBC Microcomputer into a full-scale personal computer: one that can equal machines many times more expensive. The matching expansion unit contains a Z80 second microprocessor which, when connected up to your BBC Microcomputer, enables you to run sophisticated software under the widely-used and well-tried operating system, CP/M. To put the hardware into action, you'll find a collection of software, which includes office programs, a book-keeping system and a program that helps you develop your own software. The pack also contains the software you need to write and run programs in BBC BASIC, Professional BASIC and CIS COBOL. This guide gives you full instructions for connecting up the second processor and starting to use your equipment as a CP/M personal computer. It's been written mainly for non-technical users, and concentrates on the information every Z80 user will need to know. It contains: * full instructions for getting your equipment running * information on the files in which your data will be organised * an introduction to CP/M * instructions on using CP/M * some suggestions about putting the Z80 system into action. At the end, there's a glossary, an index, and some advice on looking after your equipment and your discs. There are separate guides to the software, and technical manuals on the programming languages, on CP/M and on GSX, the program that runs the computer's screen graphics. 2 Setting up Before, you read any further, check that your pack contains all it should do. Go through the checklist provided. To use the Z80 pack, you will also need the following items: • a model B BBC Microcomputer • a black-and-white or colour monitor (you could use an ordinary television set - black-and-white or colour - but the image on the screen will not be as clear) • a BBC 800K dual disc drive, or equivalent • a suitable printer and connector • a set of at least ten blank discs, suitable for your drive • a box of printer paper • a box to keep your discs in. Your dealer will be able to provide you with any components you haven't yet got. Your BBC Microcomputer will also need to have been fitted with: • an operating system ROM, version 1. 2 • a DNFS ROM. The DNFS ROM is included in your Z80 pack. There are instructions in the pack on how to fit ROMs. If you prefer, your dealer will fit them for you. Setting up 9 Arranging your equipment Decide where to set your equipment up. Choose a desk or table near a power supply - you'll need four sockets. Ideally, the desk top should be about 5 feet wide and 2 feet 6 inches deep. Try to choose a position where: • the screen will reflect as little light as possible • the equipment won't get in the way of other activities • you won't need to have mains leads trailing across the floor • your equipment won't get dusty, too cold (below 10 degrees C) or too hot (above 35 degrees C). A well-arranged desk might look like this: There's some advice on looking after your equipment at the back of this guide. 10 Setting up Connecting up 1 Tilt your BBC Microcomputer back 2 Connect it to its disc drive 3 and to its printer 4 Hold the second processor upright immediately to the right of the micro 5 Hold the loose end of its ribbon connector like this, with the small v-shaped marking to the right Setting up 11 6 Plug it into the. socket marked 'tube' The grey retaining clips will click down when the plug is firmly in place 7 Put the BBC Microcomputer and the second processor back in position Now plug in your monitor or television set, using the sockets at the back of your BBC Microcomputer - 'video out' for a black-and-white monitor. 'RGB' for a colour monitor, or 'UHF out' for a television set. A connector for a television set will have been packed with your BBC Microcomputer: a connector for a monitor should come with your monitor. Finally, plug the micro, the second processor, the monitor and the printer into the mains. 12 Setting up The function key cards Several of the office and accounting programs make use of the red function keys at the top of your keyboard. You'll be using the keys to give instructions to the program. To remind you what key gives what instruction, there's a set of reminder cards in the Z80 pack. spiral-bound to keep them together. These key cards have been designed to stay permanently in position at the top of your keyboard, held in place by the clear plastic strip above the function keys. To fit the key cards in place: 1 Press the ends of the plastic strip towards each other to make a gap 2 Hold the cards the right way up and push the back page under the strip, with the spiral binding at the top. The cards will now-be in position, with the back page under the plastic strip and the other pages lying on top of it 3 Position the cards so that the arrow on the page that you've put under the plastic strip points to the key marked f9 You can flip the cards over until they're open at the right page for the program you want to use. Switching on You're now ready to switch on. Switch the BBC Microcomputer on first, The on/off switch is at the back of the machine. Turn on your monitor and printer too. The screen will look something like this: 32K is the size of the BBC Microcomputer's random access memory. Acorn DFS and BASIC are the names of items of software stored permanently inside your BBC Microcomputer. The next steps are: • turn your Z80 on (the on/off switch is at the back of the machine) • press A new screen display will appear: Acorn TUBE Z80 64K 1. 0 Acorn DFS BASIC * TUBE is the name of the device that connects up your microcomputer and its second processor. 64K is the size of the Z80's random access memory. The next number is the version of the software that's stored permanently inside the second processor: 1.0 in this example. If this TUBE information doesn't appear on your screen, check that your BBC Microcomputer and its second processor are properly connected. The difference the Z80 makes When you switch the second processor on, your BBC Microcomputer is essentially a different machine. It will no longer, for example, understand BBC BASIC keywords (the keywords listed in the BBC Microcomputer User Guide). If you want to turn it back into an ordinary BBC Microcomputer, switch the second processor off, and Press To go back to using the Z80, turn the second processor on and press Using discs Much of the work you do with your Z80 pack will be stored on floppy discs - plastic sheets coated with a magnetic recording medium which can hold very large amounts of data. The discs you will use with your Z80 pack can store about 400 kilobytes. One kilobyte (1K) is 1024 characters; 400K is enough to hold almost 100 typed pages of text. The data is arranged on the disc in tracks. Each disc has 160 tracks, numbered 0 to 159. Floppy discs need to be handled carefully. Follow the advice on looking after your discs at the back of this guide. At the side of most discs is a notch, called the write-protect notch. This can be covered with a plastic adhesive patch which protects all the information on it from being wiped off by mistake. While this patch is on, you cannot save anything on the disc. You may wish to protect important discs you use, and you will find spare write-protect patches in your boxes of new discs. Drives Your Z80 work station includes a dual disc drive, so that you can have two discs in use at once. The top or left-hand drive is referred to as drive A, and the other drive as drive B. If you've used a dual disc drive with your BBC Microcomputer before, you'll find the Z80 makes a difference to the way data stored on discs is arranged. Instead of having two sides, each disc is one continuous storage space. Setting up 17 The operating system To use the Z80 you have to load your computer with the operating system, CP/M. An operating system is a program which runs your computer's communication with its screen, keyboard, disc drive and printer. It's designed to take care of these basic tasks, leaving you free to get on with your computing work. While you are running your office or book-keeping programs, you need not be aware of the operating system at all. The CP/M operating system doesn't stay permanently in your computer. Each time you switch on, it has to be loaded into the machine from a disc. Discs which include CP/M are called system discs. Loading CP/M One of the discs in your pack is labeled disc 1. Take it carefully out of its card jacket. Make sure your equipment is switched on. Put it into drive A, like this: When you've inserted the disc, toad CP/M: 1 Hold down 2 Press: 3 Release: 4 Release 18 Setting up The screen will change: the last two lines will now look something like this: Acorn CP/M 2.2 - BIOS 1.0 A> CP/M is now in your computer, and will normally stay there until you switch off or press . The first line on the screen gives details of the version of CP/M you're using. The A> is the CP/M prompt. A prompt is a phrase or symbol on your screen that tells you the system is ready for you to type in commands or data. The CP/M prompt also tells you which of your two disc drives the system is currently working with. Here it's drive A. To put it another way, A is currently the logged-in drive. You can switch over to the other drive - that is, log into drive B - when you need to: instructions are in chapter 5. But for the moment, stay with drive A. Making program discs Now that you've loaded CP/M, the first thing to do is to make a set of program discs. Program discs are working copies of the software discs in your pack. If for some reason one of your program discs gets damaged, you can always go back to the master disc and make a new copy. Once you've made your program discs, you should put the masters away somewhere safe. On the seven software discs, there are twelve separate items of software. If you want to copy them all, you'll need twelve blank discs. -We've provided a program that makes your working discs for you. Check that master disc 1 is still in drive A. After the A> prompt type PREPARE That is, type PREPARE, then press Selling up 19 Follow the instructions on your screen. When you've finished, check that your program discs are properly labeled, and put your seven master discs away somewhere safe. If you ever need to make a new program disc, put master disc 1 in drive A, and go through the process again. Remember that you are allowed to make copies of the software only for your own private use: the licence agreements included in your Z80 pack give the full rules on copying. Housekeeping You're now ready to load one of the programs and start working with it. Look at the program's own manual for instructions. Most of the time, you'll be working with one of the applications programs (the office and book-keeping programs), or programming in one of the languages. The operating system will carry out its functions unobtrusively, without needing any intervention from you. The exception is when you want to carry out basic housekeeping on the data you've stored - erasing some of it, copying it, moving it between discs and so on. To do these essential jobs you'll need to use CP/M commands. Some are available all the time you have CP/M in memory. The others are stored on your utilities program disc. Chapters 4 and 5 give instructions for using these programs. As well as the program discs you've made, you will probably need some data discs, to store the data that you enter and process. Before you can use a new blank disc, it has to be formatted (the PREPARE program formatted your program discs automatically). You may like to format a set of discs now, to use as data discs. Instructions are on page 34. Files The data you produce and store will be arranged on your discs in files. The next chapter of this guide, Files and filenames, sets out the rules that govern the names you can give your files. 3 Files and filenames Whenever you save your data on a disc, you'll need to open a file to receive the data, and you'll have to give the new file a filename. (In some of the applications programs, the System opens and names files automatically,) This chapter gives some rules and hints on filenames. Rules for filenames A filename can be made up of: • one to eight characters • followed by a full stop and a further one to three characters. You do not have to use the second part-the filename extension-at all, but it may be useful for identifying similar files. For example, you might end the filenames of all your files that contain the text of letters with .LET. The simplest possible filename would be a single letter or number. Examples Q MEM01.TXT AC1234 INV82 You can use: A to Z in capitals or small letters 0 to 9 # $ & - Don't use <>.,;: =?*+ [ ] _%| / \ ( ) or spaces. CP/M makes no distinction between capitals and small letters, so it would treat text and TEXT as the same file. Examples of filenames that break the rules would be STRUCTURE.TXT (too long main part) 1009.demo (too long extension) (<> not allowed) Some filename extensions are used for the files that contain the programs you'll use, and you should avoid choosing these endings for your own filenames - otherwise you could cause confusion. The endings to avoid are: .ASC .CHT .FIL .PRL .BAS .COM .INT •SWP .BBC .DAT .NUM .TBL .CBL .DEF .OVL .$$$ It's a good idea to be methodical about filenames. If you are likely to want to call up, perhaps, a letter from a few weeks ago, a naming system like this might be useful: • addressee • day • month. For example, a letter to the Wessex Bank written on 12 August might be filed as WES1208 WES is the first three letters of the addressee's name: 1208 is the day and month you wrote the letter. Drive identifiers When specifying a file, you will often need to tell the computer which disc the file is on. If it's in drive A, you type A: before its filename: if it's in drive B, type B: This is a drive identifier. 22 Files and filenames Examples A: TEXT A: WES1208 B: INTRO.ONE If the drive you want is your logged-in drive (that is, the drive CP/M is currently addressing), you can leave out the identifier. Whenever you leave out a drive identifier, CP/M will assume you mean the logged-in drive. Specifying groups of files You may find it useful to carry out CP/M jobs on groups of files rather than individual ones. You can do this using: • * to mean any series of characters in a filename. • ? to mean any single character in a filename. Names including * or ? are called ambiguous file references. Example You may have the following files on a disc: INTRO MEMO.TXT COM1809.LET DAT2109.LET WAT1809.LET TIL1809.LET You may want to carry out the same CP/M operation on a group of these files -you might, for example, need to copy each of the last four in the list. The files you want to copy all end .LET, so you ask the computer to copy every file ending .LET. You do this by using the copying command - explained in chapter 5 - and specifying that you want it carried out on *.LET. The computer will understand* to refer to any and every string of characters that might be included in a filename. The reference *.* means all the files on a disc. Files and filenames 23 From the same list of files you might want to erase all the files that include 1809 in their names - they might perhaps be all the letters you wrote on 18 September. You can do this with the? symbol, by specifying ???1809.LET. This refers, to every file that starts with any three characters, and ends 1809.LET. Alternatively, you could use *1809.LET. This refers to any file that ends 1809. LET, whatever way it starts. You will find examples of how to use these ambiguous file references in chapter 5. 4 Using CP/M There are some operations you'll need to carry out from time to time that arc not done within your applications programs. These include: • displaying a list of the contents of your discs on the screen • erasing some or all of the contents of your discs • copying the files on your discs, You do these jobs using programs contained in the operating system, called CP/M commands, These are introduced here and explained in detail in chapter 5. The two kinds of CP/M command Once you have loaded CP/M into your computer, you can carry out most CP/M operations at any time. These use commands which are in memory all the time CP/M is loaded, called built-in commands. Other CP/M commands - transient commands - are kept as files on disc, so to use them you have to load them from a disc that contains those files. The utilities program disc contains all the CP/M transient command programs, built-in commands DIR displays a directory of your files ERA erases files REN renames files transient commands PIP STAT COPY FORMAT SYSGEN copies files provides information about your files copies the contents of a whole disc on to a second disc formats a disc copies CP/M on to a disc If you are logged into a drive that contains your utilities program disc, you can use any of the commands in this table. If the disc containing the transient commands is in the other drive, you will be able to use a transient command only if you enter, before the command itself, the identifier of the other drive. Example Your logged-in drive is A: the transient command files are on the disc in drive B. To use the STAT command type B:STAT The effect is to log in temporarily to drive B, pick up STA7, and log back into A. CP/M includes other commands with more technical functions. They are described in the full CP/M manual which is included in your Z80 pack. Recovering from mistakes If you type a command incorrectly, your computer will repeat what you typed, followed by a ?. You can then try again. If you make any other kind of mistake, an error message will appear on your screen. There's a guide to CP/M error messages at the hack of this manual. 5 CP/M commands This chapter goes through the CP/M commands one by one. For basic information on using CP/M, look at chapter 4. You'll find a quick-reference guide to all the CP/M commands on the key cards that you fixed at the top of your keyboard. The computer will usually need to know what disc or file you want the command to be carried out on. You type this information in after the command name. In this guide, we use pointed brackets to show what kind of information it needs. For example: means: type in here the name of the file you want the command to act on, That is: • type the filename • don't type the word filename or the pointed brackets. If you want a command to act on a tile in a different drive from the one you are logged into, type the drive identifier before the filename. Examples A: B: Switching drives The simplest CP/M command switches the logged-in drive from one to the other. To change to drive B type B: Prompt B> To switch back to drive A type Type A: Prompt A> Don't use this command if the other drive is empty. Displaying a directory of your files DIR You can use a CP/M command to see what files you've stored on a disc. To find out type DIR or DIR if the disc is not your logged-in disc. You will see a list of all the files in the order in which they were saved on the disc. A>DIR A: RUN COM : MEMO SWP : CONFIG OAT: : TEST DOC A: MEMO COM : MEMO OVL : RECOVER COM : MEMOP COM A: CONFIG COM : PIP COM : CONFIG OVL : MPP OVL A: ACTIONS DEF : STAT COP : COPY COM : FORMAT COM A: SYSGEN COM : WES2209 : INVOICES SEP A> In a directory, each line starts with a drive identifier (here, A:) Filenames are then spread out across the line. The first line here lists the following files: RUN.COM MEMO.SWP CONFIG.DAT TEST.DOC This particular directory includes: • files containing parts of an applications program for example. MEMO.COM • files containing CP/M programs (for example. PIP.COM) • two files created by a user: WES2209 and INVOICES.SEP. If you want a directory of just a group of the files on the disc, rather than all of them. use an ambiguous file reference. For example, to get a list of all the files that end .LET type DIR *.LET 28 CP/M commands Erasing files ERA As you use your programs and file your work, your discs will quickly fill up. It's a good idea regularly to clear out files that you no longer need. You can often erase a file using part of the applications program, but if not, or if you prefer, you can do it using the command ERA. To erase a file type ERA or ERA if the file isn't on the logged-in disc. Examples A is your logged-in drive. To delete the file TAX-INF from the disc in drive A type ERA TAX-INF To delete the file TEXT from the disc in drive B type ERA B: TEXT Make sure you don't do this to a file by mistake, as once it is deleted you cannot get it back, unless you have a back-up copy. You can erase all the files on a disc by typing ERA*.* In this case, the system will check with you to make sure you really want to carry out this drastic operation. Prompt ALL (Y/N)? Type Y If you change your mind type N Renaming files REN At some stage you may want to change the names of some files you have already set up. To do this, use the command REN. Type REN = Examples A is your lodged-in drive. The disc in A includes a file called POEM. To give it a new name. TEXT, type REN TEXT=POEM or REN A: TEXT=A: POEM or REN A: TEXT=POEM To change the name of a file on the disc in drive B from FORECAST to SUMMARY type REN B: SUMMARY=B:FORECAST or REN B: SUMMARY=FQRECAST You cannot use ambiguous file references with REN, nor can you use REN to move a file between discs, by changing its drive identifier. 30 CP/M commands Copying files PIP This command copies files or groups of files. To copy the whole of a disc, it's much easier to use the COPY command. PIP is CP/M's Peripheral Interchange Program. It can also be used for several technical functions, which are explained in the full CP/M manual. To copy a file type PIP = is the filename of the tile you are copying to is the filename of the file you are copying from. Example Your logged-in disc contains a file called DEMO. To duplicate its contents in a new file called PRACTICE type PIP PRACTICE=DEMO RETURN You can use PIP to copy a file from one disc on to the other. To copy a file from drive A to drive B Type PIP B: =A: Examples You are logged info A. To copy fhe file DEMO from drive A to drive B type PIP B: DEMO=A: DEMO If you are logged into drive A at the time you can miss out the A: from the command. Type PIP B: DEMO=DEMO If the filename stays the same you don't need to give if on the destination side of the = sign. Type PIP B: =A: DEMO or PIP B: =DEMO CP/M commands 31 To copy all the tiles on a disc from A to B type PIP B: =A:*.* or PIP B: =*.* If you copy a file on to a disc where a file of the same name already exists, CP/M will normally delete the old file and write the new one over the top. 32 CP/M commands STAT Finding out information about your files The command called STAT provides a range of information about your discs and files. It can also carry out some complex technical functions, which are explained in the full CP/M manual. The simplest use of STAT is to tell you how much space is left on your discs. It's important to keep track of the space available, as you can run into problems if you try to save a long file on a disc and there isn't enough room for it. Type STAT or STAT and your screen will display the space left on the disc in kilobytes. Message A: R/W, Space: 110K The number shows the amount of room left on the disc. Each of your discs holds just under 400K altogether, so if the amount you have left is less than, say, 100K you should consider deleting some old files or making copies on other discs before you run out of space. You can also use STAT to find out the size of the files on one of your discs. Type STAT or STAT Example A is your logged-in drive: there's a file called TUESDAY on the disc in A whose size you want to know. Type STAT TUESDAY A display like this will come up: Message Recs Bytes Ext Acc 46 6K 1 R/W A: TUESDAY Bytes Remaining on A: 120K CP/M commands 33 The important information here is the number under Bytes: the file A: TUESDAY is 6 kilobytes long. Recs (records) and Ext (extents) are alternative ways of measuring the disc space allocated to the file. R/W means that the file has read/write status - you can read it and write to it (that is, update it). The display ends with the amount of space left on the disc. You could find out the sizes of all the files on a disc by using an ambiguous file reference: type STAT *.* or STAT *.* 34 CP/M commands Copying discs This command copies a whole disc. Type: COPY Prompt: CP/M Disc Copier 1.0 To copy a disc place the disc in drive A and a formatted disc in drive B then press SPACE BAR To return to CP/M press RETURN Follow the instructions. If you press , the A> prompt will reappear. If you press the space bar, you'll see: Prompt Are you sure you want to overwrite the disc in drive B? Type Y or N Again, follow the instruction. If you type N, the A> prompt will reappear. If you type Y, the copying will now be carried out, and a message will appear on your screen, showing the number of each track on the disc as it's copied. Then you'll see: Message Copying complete Prompt To return to CP/M press RETURN To copy another disc place the disc in drive A and a formatted disc in drive B then press SPACE BAR You can now either go back to the A> prompt or copy another disc. It's very important to keep copies of your data discs, in case a disc gets damaged. Unless you have a reasonably up-to-date copy, you run the risk of losing hours of work. The copying process is called making a back-up. CP/M commands 35 Formatting discs FORMAT Every disc you use must be correctly prepared: use the FORMAT command. This destroys any data already on the disc, so formatting is a good way of wiping clear an old disc, and making it ready to re-use. Type FORMAT Prompt CP/M Disc Formatter 1.0 To format a disc place the disc in drive B then press SPACE BAR To return to CP/M press RETURN Follow the instructions. If you press , the A> prompt will reappear. If you press the space bar, you'll see: Prompt Are you sure you want to format the disc in drive B? Type Y or N Again, follow the instruction. If you type N, the A> prompt will reappear. If you type Y, the formatting will now be carried out, and a message will appear on your screen, showing the number of each track on the disc as it's formatted. Then you'll see: Message Formatting complete Prompt To return to CP/M press RETURN To format another disc place the disc in drive B then press SPACE BAR You can now either go back to the A> prompt or format another disc. 36 CP/M commands Copying CP/M SYSGEN 'SYSGEN' is short for system generation: this command generates system discs. It copies the operating system software on the disc you specify, so that you can use the disc to load CP/M from. It doesn't copy the transient commands. The following description assumes that the disc that contains SYSGEN is a system disc, and is in drive A. Type SYSTGEN Message SYSGEN VERSION 1.00 Prompt SOURCE DRIVE NAME (OR RETURN TO SKIP) Type A Prompt SOURCE ON A THEN TYPE RETURN Press Prompt DESTINATION DRIVE NAME (OR RETURN TO REBOOT) Put in drive B the disc you want to copy CP/M to. (Make sure that it's been formatted.) Type B Prompt DESTINATION ON B THEN TYPE RETURN Press CP/M will now be copied on to the disc in drive B. Message FUNCTION COMPLETE Prompt DESTINATION DRIVE NAME (OR RETURN TO REBOOT) The program is giving you the chance to put another disc into drive B and copy CP/M on to this new disc. If you've finished with SYSGEN, press . Prompt A > CP/M commands 37 Special key meanings in CP/M When you're working directly with CP/M, you can give certain instructions to your computer by holding down while pressing another key. The most important one is C. This tells the computer you've changed the disc in a disc drive. When you're working with a disc, information about it is kept in the computer's memory. If you swap discs, this information will not match up with the new disc, and if you try to put data on the disc you may get an error message. After you've changed discs press C Then you can carry on working as normal. If you change discs when prompted to within an applications program, you don't need to use C. Other special key meanings under CP/M are: P to output text to a printer S to stop screen activity such as scrolling X to delete a line. The first of these is perhaps the most useful. After pressing P, anything you type in, or that the system types on your screen, will also be printed by your printer. To turn the printing off, press P again. These instructions have the effects we've described when you're working directly with CP/M; when you're working inside an applications program, they may have quite different effects. 6 The Z80 pack in action Your Z80 personal computer should now be running, and you're probably beginning to feel at home with CP/M. But it's the other software in the Z80 pack that will put your machine into productive action. This chapter is a survey of what the system can do, both at home and in the office. It's no more than an outline; as you use the system, you'll discover more of its capabilities, and new applications will suggest themselves. How the Z80 works When you connect up your Z80 processor to a BBC Microcomputer, the two machines communicate through a device in the Z80 that's unique to the BBC microcomputer system. This device - the Tube - is a connector and software interface that permits very high speed communication. The Z80 handles the program itself, and the processor in the BBC Microcomputer handles the hardware: for example, your printer and your disc drives. The result is that you have more memory available in the Z80 to run your programs than in many other CP/M systems. The software in the Z80 pack As well as CP/M and its graphics extension GSX, your Z80 pack includes the following software: applications software programming languages office software accounting system software generator BBC BASIC Professional BASIC CIS COBOL FilePlan GraphPlan MemoPlan Accountant Nucleus The Z80 pack in action 39 Applications software FilePlan is a personal filing system - you can think of it as an automated card index, or more grandly as a database management program. You'll be able to use FilePlan to keep, for example: • your address book • a club membership list • stock records • mailing lists. GraphPlan is a financial modelling program. You enter data on an array of rows and columns - a spreadsheet - and GraphPlan then enables you to try out financial decisions before putting them into practice. You can test options on the screen and watch as the program works out the implications. In addition, you can use GraphPlan to present data about your personal or business finances in the form of graphs and charts. With GraphPlan, you'll be able to visualise how your finances stand, or the way your business is developing. You could, for example: • work out your cashflow over the next quarter, so that you can keep cash efficiently, earning interest until you really need it • calculate how your tax bill varies with your income • set up a graph so that you can see at a glance which parts of your business are most profitable • prepare figures and graphs for important meetings with your accountant or bank manager. MemoPlan is a word processor. It can handle anything you'd now type, or ask someone else to type. Your words come up on the screen first, so it's easy to make corrections before you have anything printed out. Use it to write, for example: * letters * advertisements * reports * quotations * price lists * programmes for events * poems, stories - even novels. You can also use MemoPlan to prepare and edit computer programs. 40 The Z80 pack in action Accountant is a book-keeping program for business or household accounts - or, for example, club finances. It will replace your sales daybook, purchase daybook and cash book. You enter into it your day-to-day transactions; it posts each item to a nominal ledger, and you can then produce: • lists of transactions of particular kinds (for example, all the transactions in your 'heat and light' account) • summaries of your income and expenditure whenever you need them • reports telling you whether you're over or under the budgets you can set • an audit trail • an analysed summary of the year's business. Nucleus is a system generator: it helps you to develop your own programs without needing specialised programming knowledge - and the work you do with Nucleus will be fully compatible with the Accountant software. You can use Nucleus to write software exactly tailored to your special interests or business activities: almost any routine, laborious task can be automated. For example: • keeping specialised personnel details • working out many kinds of statistics • scheduling rehearsals for a play production • working out sports fixtures, or running a league or tournament • keeping a diary to remind you when regular tasks have to be done, or quarterly bills have to be paid • keeping a bar stocked • keeping records of stocks and shares • running the routine record-keeping in, say, an estate agent business • generating particular kinds of reports of the data you've entered and processed using the Accountant program. The Z80 pack in action 41 Programming languages BBC BASIC is the advanced version of BASIC that was developed for the BBC Microcomputer. BASIC is by far the most popular of microcomputing languages, probably because it's particularly easy to learn and use. There is a full reference guide to the BBC version in the User Guide which comes with every BBC Microcomputer. The BBC BASIC in the Z80 pack is slightly different from ordinary BBC BASIC, because there are essential hardware differences between the Z80 and the BBC Microcomputer's processor. But the two BASICs are compatible, and the guide to BBC BASIC included in the Z80 pack gives details of the differences. Professional BASIC runs programs written in a dialect of BASIC similar to those of the industry-standard BASICs developed by Microsoft and Digital Research. These are the dialects most commonly used for business software. You'll be likely to use BBC BASIC to write your own software, and Professional BASIC to run programs written professionally by others. CIS COBOL, developed by the British company Micro Focus, is the leading microcomputer version of COBOL. This is the language that has proved itself over the last twenty years with commercial applications on large mainframe computers. The CIS COBOL in your Z80 pack includes two useful programming aids: ANIMATOR, an award-winning debugging tool which takes you step by step through your COBOL program on the screen, and FORMS2, an aid to designing data-entry screens. 42 The Z80 pack in action Follow-on software One great advantage of CP/M is the vast range of software that has been written to run under it. You'll find a large and growing selection available for your Z80 personal computer, including a special series of products that will work in parallel with the software in your Z80 pack. These follow-on products have been developed by the same software writers, and are designed to be used side-by-side with FilePlan, Accountant and the rest. This means: • you can expand your computerised activities without having to re-enter data • you won't have to learn new methods or jargon: once you've got to know the basic programs, you'll find the follow-ons immediately familiar • your basic programs will not be made obsolete by the extra products: instead, they'll become the core of a wider sphere of computerised activities. The follow-on products include: • DocuPlan: a program that gives MemoPlan documents a wider range of formats. Its main use is for longer reports - with it, you can produce footnotes, indexes and contents lists automatically • the MicroPlan software, which lets you carry out more sophisticated calculations on your GraphPlan spreadsheets - working out, for example, depreciation and tax computations • a range of accounting programs - sales ledger, purchase ledger, stock control, payroll, invoicing and so on - that you can run in parallel with Accountant, without having to key your data in a second time. The Z80 pack in action 43 Computerising a business: the planning stage If you run a business and are planning to use the Z80 personal computer as a business machine, it's a good idea to plan your computerisation carefully. • Don't try to do too much too soon. The Z80 pack has been designed to help you start with the basics and master them before you go on to more complicated systems. • Try out each of the programs in the pack, to see what they're capable of. Read through the first few pages of each manual, trying out the instructions as you go along. Treat this try-out as an evaluation of the programs, so you can begin to plan how you're going to use them in your business. Use small amounts of trial data at this stage - and it's worth making a few deliberate mistakes, to see the consequences. • After this evaluation, decide now what to computerise - work out on paper some ideas of the kinds of thing you'll do with each program. • With a computer, you'll need to be more tidy, not less. Plan where you'll keep copies of your valuable discs - in a different building, preferably. Arrange some space where you'll file your printouts - they can be surprisingly bulky and they're not as easy to file neatly as ordinary A4 papers. Ask your dealer about the special binders that are available for both fanfold (continuous) paper and burst paper (separate sheets). • It may seem obvious, but it's important to assign separate data discs to separate programs, and to different subjects within programs. You might like to use coloured labels. For example, all your text discs, produced with MemoPlan, might be given yellow labels; you will have separate yellow-label discs for, say, letters, quotations and advertisements. • If you put badly organised data into a computer, you'll get badly organised data out of it. Computers can't sort out a mess - they'll perpetuate it. Before entering any accounting or card-index records, read through them to check that they're accurate and up-to-date. Make any corrections before you enter them on to your computer. 44 The Z80 pack in action Managing your computerised systems • Be prepared to carry out manual checks on the data that goes into and comes out of your computer. Check data as soon after entry as possible: ideally, a second person should check what's been entered. • Glance over printouts as they come out of your printer: give everything a common-sense check. Computers, particularly in spreadsheet programs like GraphPlan, can sometimes magnify small errors. • Keep paper records: most importantly, an index of contents of your discs. It's also important to keep hard copies (that is, printouts) of your data. • So that you don't lose data irrecoverably, it's extremely important to make frequent copies - back-ups - of your data discs. The next section explains how to do this. • Have a regular disc management session: clear out old files, and update your paper index. • Decide on a system of filenames - particularly for text files. Look chapter 3 of this guide. • After a while, review things. Decide at this stage what else you might computerise, and what not to computerise. If you find you can do some tasks faster or more enjoyably by hand, then feel free to carry on doing them by hand. Backing up A back-up is a copy of a file or disc kept in case your working copy gets damaged. Data stored on disc is always vulnerable to accidental damage, so it's vital to make frequent back-ups. Keep your back-up discs separate from the discs you work with each day. The best time to make back-ups is at the start of a day's work, not at the end of the day when you're feeling tired. If you decide to back up every day, you might follow a routine like this: Tuesday morning: copy your disc on to back-up disc 1 Wednesday morning: copy your disc on to back up disc 2 Thursday morning: copy your disc on to back-up disc 3 Friday morning: copy your disc on to back up disc 1 - recording over Tuesday's copy Relabel the back-up with today's date each time you copy on to it Looking after your discs Your discs are the most sensitive part of your equipment and, if they are damaged, you can lose a lot of hard work. Bear in mind the following points when using floppy discs: * store discs in their jackets in a proper box * don't touch the exposed parts of discs * don't bend the discs * don't let your discs get damp, cold (less than 10 degrees C) or hot (more than 35 degrees C) * avoid putting discs near magnetic fields * don't remove a disc while the red light is on don't load a disc when any part of the machine is switched off * don't switch off while a disc is in a drive * always keep back-up copies * always label your discs * write on your disc labels before you stick them on your discs, not after. Looking after your hardware Here are a few guidelines to help you look after your hardware: • switch your micro and its second processor off when you're not using them • avoid leaving your machine for long periods in direct sunlight or in moist conditions • don't rest drinks or other liquids on your equipment - spilling something over it is the easiest way to cause a short-circuit, which will do considerable damage • clean the surfaces of your equipment with a slightly damp cloth: don't use solvents or spirits • wipe the screen with a dry cloth when it gets dusty: don't use an abrasive cleaner • in your disc drive are heads which record information on to your discs and read it back. Clean them occasionally with a kit supplied by your dealer. It's a good idea to take out a maintenance contract: ask your dealer for details. CP/M error messages This is a guide to the error messages that will appear on your screen if you make a mistake while carrying out CP/M operations. Some of these can occur when you're working in an applications program. They will automatically take you out of the program. After correcting your mistake, you will have to re-start the program. NO FILE The file you have named, or the command you have given, is not on the disc (you will also get this message after DIR if your directory is empty). Action: check first that you didn't make a spelling mistake when typing in the file or command name. If not, check the disc directory. If necessary, switch to another disc which does contain the file you need. FILE EXISTS You have tried to rename a file with a name already in use on the disc. Action: use REN again, but with a different filename. Disc fault The disc your computer is trying to read is damaged, faulty, unformatted or incorrectly formatted. Action: if the disc is a new one, use FORMAT. If the disc is damaged, use PIP to copy any files it contains one by one to a new, formatted disc to save as many as you can. Then throw the disc away. Not a CP/M System disc You are trying to load CP/M from a disc that is not a system disc, or that has been corrupted. Action: try pressing If you still don't get the CP/M prompt, replace the disc with one that you know does contain CP/M, and press to load the operating system. Bdos Err on : Select You have selected a drive other than A or B. or an empty drive. Action: press C, then retype the command selecting the correct drive. Bdos Err on A: Bad Sector or Bdos Err on B: Bad Sector The computer cannot read or write to the disc: it may be unformatted, damaged or protected with a write-protect patch. Action: press C to get the CP/M prompt back. If the disc is a new one, use FORMAT. If the disc is damaged, use PIP to copy any files it contains one by one to a new, formatted disc to save as many as you can. Then throw the disc away. If the disc has an unwanted write-protect patch, remove it. Bdos Err on A: R/O or Bdos Err on B: R/O You have changed a disc without telling the computer. Action: press C Bdos Err on A: File R/O or Bdos Err on B: File R/O You have tried to write to a file which has been protected using one of the technical facilities in the STAT program. Action: follow the instructions in the Digital Research documentation for changing the R/O attribute using STAT. Formatting error You have tried to format a write-protected disc, or your drive is faulty. Action: check whether the disc is write-protected. If not, ask your dealer to check your disc drive. Verify error The computer has had difficulties in formatting your disc. Action: try FORMAT again. If the error message reappears, throw the disc away. Glossary This is a general glossary for the Z80 system. Other manuals in the pack contain more specialised glossaries. ambiguous file reference A reference, similar in form to a filename, that refers to a group of files, rather than just one file. applications program A program written to carry out a specific task. The applications programs in the Z80 pack include, for example, MemoPlan (for word processing) and Accountant (for book-keeping). back-up A copy of a disc or file kept in case your working copy is damaged. BASIC Beginner's All-purpose Symbolic Instruction Code: the most popular programming language for microcomputers. The Z80 pack includes the software you need to work with two dialects of BASIC: BBC BASIC and Professional BASIC. BDOS Basic Disc Operating System: the part of CP/M that controls the computer's communication with its disc drives. BIOS Basic Input Output System: the part of CP/M that controls the computer's communication with its keyboard and screen. built-in commands CP/M commands available all the time that CP/M is loaded in your computer. burst Printer paper that has been split into individual sheets. Glossary 51 byte A unit of data, usually corresponding to one character of text. COBOL COmmon Business Orientated Language: a language designed for commercial applications on large computers. The CIS COBOL in the Z80 pack is a version adapted for microcomputers. CP/M Control Program/Monitor: the operating system that runs your Z80 system. data Information that can be processed by a computer. database A collection of data: for example, a computerised card-index. data disc A disc on which you store the data produced by your programs. directory A list of the files on a disc. disc A plastic device coated with magnetic material, on which you store data. More fully, a flexible or floppy disc. Also called a disk or diskette. disc drive The unit in which you put discs so that the computer can read from them and write to them. The BBC dual disc drive is in fact two drives, in one unit. drive identifier Under CP/M, the disc drives in your system are referred to by letters: A and B in a dual drive system. When giving CP/M commands, you refer to a drive by typing the drive letter followed by a colon (that is, A: or B:); this combination is a drive identifier. 52 Glossary error message A message which appears on your screen if there is a fault, or if you have made a mistake. fanfold Printer paper that comes as a continuous strip, folded like a fan. file The data stored on a disc is organised into files, each with its own filename. filename A name for a file. In CP/M, there are rules governing the kinds of name you can use. formatting Preparing a disc so that it can receive data. function key A key that can carry out a particular function in one program, and different functions in other programs. The BBC Microcomputer has ten function keys: they're the red keys across the top of the keyboard. graphics Illustrations displayed on the screen - charts, for example. GSX Graphics System Extension. The software that works with CP/M to produce graphics. hard copy A printout of a program or data. hardware Computer equipment. Processors, disc drives, discs, connecting leads: anything tangible counts as hardware. interface The meeting place between two systems: in your personal computer, the Tube is the interface between the Z80 processor and the BBC Microcomputer's processor. Glossary 53 K One kilobyte (1K) is 1024 bytes. language Programs can be written in a variety of different kinds of code. Each kind of code is a language: BASIC and COBOL are examples of languages. A language may have different versions or dialects. BBC BASIC is a dialect of BASIC; CIS COBOL is a dialect of COBOL. load To transfer a program from disc into your computer's memory. logged-in drive CP/M addresses one drive at a time, though it can easily switch between drives. The logged-in drive is the one currently being addressed. memory Data can be stored inside your computer, as well as on discs. The part of the computer that stores data is its memory. Memory can be read only memory (ROM) or random access memory (RAM). ROM is used to store certain kinds of software permanently; RAM is normally for temporary storage of the data you enter and process. microprocessor Or simply processor. The device inside a microcomputer that processes data and performs calculations. The BBC Microcomputer has a 6502 microprocessor; the matching add-on unit contains a second microprocessor, a Z80. operating system A program that carries out the basic tasks involved in running your system - handling, for example, the processor's communications with the disc drives. Most of the time, it leaves you free to work with your applications programs or programming languages. prompt A message that tells you the computer is ready to receive further instructions or data. In a dual drive system, the CP/M prompt is either A> or B>. 54 Glossary read To transfer data from a disc to your computer's memory. software The programs which put the hardware into action. Software is any item in computing that isn't a solid, tangible object. spreadsheet An array of rows and columns, used for storing and manipulating numbers - usually, financial data. system disc A disc which contains the CP/M software, from which you can load CP/M into your computer. You use the CP/M command SYSGEN to make new system discs. system generator A program that writes programs, handling the routine parts of programming for you. Not to be confused with the CP/M command SYSGEN, which generates system discs. transient commands CP/M commands which are stored on disc, and - unlike built-in commands - have to be loaded each time you want to use them. Tube The device, unique to the BBC Microcomputer system, which links the Z80 processor to the processor in your BBC Microcomputer. write To transfer data from your computer's memory on to a disc. word processsor A program that enables you to enter text into your computer, edit it, and then store it on a disc or print it out. write-protect patch A piece of adhesive paper which you can stick over the notch on a disc, to protect the disc from being written over. Index Accountant 40 discs 15 ambiguous file references 22 backing up 45 ANIMATOR 41 copying 19, 34 applications programs 19, 39 copying CP/M on to 36 formatting 19, 35 back-ups 45 getting information about 32 BBC BASIC 15, 41 looking after 46 BDOS errors 49 disc management 44 book-keeping software 40 master discs 18 built-in commands 24 program discs 18 business, computerising a 43 write-protecting 16 CIS COBOL 41 equipment commands looking after 47 description of 26 setting up 9 using 24 ERA 28 COPY 34 erasing files 28 copying error messages 48 CP/M 36 discs 34 FilePlan 39 files 30 files 19 CP/M 17, 24, 26 copying 30 directories of 27 database management 39 erasing 28 DIR 27 filenames 20 directories 27 getting information about 32 disc drives 16 renaming 29 connecting 10 FORMAT 35 identifiers 21 formatting 19, 35 logged-in 18 FORMS2 41 function key cards 12 GraphPlan 39 housekeeping 19 loading CP/M 17 logged-in drive 18 56 Index maintenance 47 utilities progam disc 19, 24 MemoPlan 39 Micro Focus Limited 41 word processing 39 Microsoft Inc 41 work station mistakes, recovering from 25, 48 components 8 looking after 47 Nucleus 40 setting up 9 write-protecting 16 operating system 17 Z80, how it works 38 PIP 30 PREPARE 19 printer connecting 10 sending text to 37 Professional BASIC 41 program discs, making 18 programming languages 41 program generator 40 using MemoPlan in 39 prompt 18 REN 29 renaming files 29 software applications 39 follow-on 42 operating system 17 programming languages 41 spreadsheets 39 STAT 32 SYSGEN 36 system discs 17, 36, 48 system generator 40 track 15 transient commands 24 Tube 14, 38