Published In the United Kingdom by


Watford Electronics
Jessa House
250 High Street
Watford
Herts
WD1 2AN
England

Tel. (0923) 37774
Fax. 01 950 8989

ISBN 0 948663 00 6

First published June 1983
Fifth edition February 1988

Copyright (c) 1988 Watford Electronics

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form by any means, electronic or mechanical, photocopying, recording, or otherwise, without the prior specific written instructions of Watford Electronics. The only exceptions are as provided for by the Copyright (photocopying) Act or for the purpose of review or in order for the software contained herein to be entered into a computer for the sole use of the owner of this book.

Watford Electronics have now been established for over 15 years. We are one of the major electronics distributors and retailers in the country, supplying thousands of different electronic components and micro peripherals by mail order and through our retail outlet at Watford. In the last six years Watford Electronics have expanded from being one of the largest component suppliers in the U.K. to one of the most prolific software houses for the BBC microcomputer. We market a range of books, software, add on hardware and peripherals for the BBC microcomputer. The ‘Disc Filing System Manual’ is a complement to the less technical ‘Mysteries of Disc Drives & DFS Revealed’ also published by Watford Electronics.

INTRODUCTION

This book explains the operation of the BBC Microcomputer Disc Filing System. It takes you from the simplest commands for the beginner right through to the full technical specifications of the DFS. Full details on all the commands and OS entry points are given.

This manual has been written primarily for the Watford Electronics DFS and DDFS. However it is equally relevant to users of the Standard BBC micro computer disc filing system. The Watford Electronics DFSs are a super—set of the standard DFS. Commands unique to the Watford Electronics DFS have been marked with ‘[’ and ‘]’ so that users of the standard DFS can ignore these sections, although it will be worth scanning through them. The standard DFS is defined by the BBC’S ‘Disc Filing System User Guide’.

In this fifth edition, the manual has been extended to give full coverage of the Watford Electronics DDFS and the many new features that have been added to the DFS in the last three years. Small changes were made to the commands used by the DFS to give full tube compatibility, and to contain the tube host code, eliminating the need for another ROM in your micro when using second processors. Details are included of the commands for both the old and new versions.



The Watford Electronics DFS was written by Andrew Bray
B.A. (Cantab). The idea of writing the DFS came from the
Managing Director of Watford Electronics, Mr. N.P. Jessa.
A Note on Upgrades to Watford DFS users

DFS 1.43 AND DDFS 1.53 OR GREATER

All the commands within The Watford DFS may be prefixed with an ‘O’ to overcome ROM clashes, e.g. *FORM80,0 becomes *OFORM80,0

1.44 OR GREATER

The use of the *OPT command to select between 40 and 80 track has now been automated. When a drive reports a disc read error, it attempts to alter its current step mode to remedy the problem. If the read error still persists it is then reported as normal.

The *OPT 2,1 command is now used to give faster file handling, making it comparable in speed to the Acorn DNFS.

*ENABLE is no longer required before a disc operation that would destroy information on the disc e.g. entering a *FORM8O,0 command will produce a ‘Go (Y/N)?’ prompt, instead of the usual ‘Not enabled’ error message. Proficient users of the Watford DFS, will realise the usefulness of this feature, new comers to using a DFS on the BBC micro are advised to type *ENABLE before a potentially destructive command, until they understand more fully the possible consequences of the command.

A NOTE TO USERS OF DDFS 1.54T

The Watford Electronics DDFS 1.54T is the DDFS ROM for our MK2 DDFS kit only, and will not function on earlier versions of the Watford Electronics DDFS. The MK2 DDFS offers Acorn 1770 DFS compatibility and will allow the use of the Acorn ADFS in the BBC Micro computer.

The DDFS 1.54T incorporates the same extra facilities as the 1.44 DFS, but regrettably the disc sector editor has had to be sacrificed to incorporate the tube host code.

UPGRADES

Watford Electronics are normally able to offer upgrades, either from early to latest versions of their DFS and DDFS, or from the standard BBC DFS to Watford Electronics DFS. For prices and availability of upgrades please contact our retail outlet at the address at the start of this manual or on (0923) 37774.


CONTENTS
1 WHY DISCS? 7
The Disc Filing System
Controlling the filing system

2 GETTING GOING 11
Connecting the disc drive
Inserting a disc
Formatting a disc
Elementary filing system commands

3 INDISPENSABLE COMMANDS 19
The commands which will be needed in normal usage

4 USEFUL COMMANDS 30
Explanation of the remaining commands for easier use
Useful information
Other filing systems

5 FLOPPY DISCS 39
Disc handling
Backing up
Formatting
35/40/80 tracks
Double Density

6 TEXT FILING 44
Random access filing

7 COMMANDS 50
Complete list of commands

8 USING THE FILING SYSTEM FROM ASSEMBLER 88
The correct entry points into the system

9 TECHNICAL INFORMATION 100
Storage formats
Filing system initialization
Link settings

10 USING THE DISC SECTOR EDITOR 105
11 ERROR MESSAGES 108
12 COMMAND SUMMARY 111
13 INDEX 112


1.0 WHY DISCS?

When a program is entered into the BBC microcomputer it is stored in RAM (Random Access Memory). The program will stay in the RAM until it is overwritten or the computer is switched off.

It is very useful to be able to keep a copy of a program on some sort of storage device that will not lose its contents when switched off. The normal device for this purpose is a cassette recorder. The cassette system is perfectly adequate for many people but it suffers from many problems, especially its extreme slowness and the difficulty of finding a program once it has been saved.

The need for some sort of storage is clear, but why disc drives? The disc system is very fast at transferring programs and also keeps a careful record of which program is where. The capacity to find a program very quickly and completely automatically wherever it is on a disc is an extremely useful part of the system, with the speed giving the advantage over such systems as floppy tape drives. A disc system is easier to use than a cassette recorder once the basic principles have been mastered, however familiarity with the BBC cassette system will be assumed as the tape system is standard on all BBC micros. The cassette system is also considerably simpler in its capabilities and so rather easier to understand. The cassette system is fully explained in the User Guide.

1.1 WHAT IS A DISC SYSTEM?

The fundamental parts of the BBC disc system are the Disc Filing System ROM, the Disc Interface inside the computer, the Disc Drive and the floppy discs themselves.

The floppy disc is a piece of round floppy plastic coated in magnetic material. It is very much like a large round piece of cassette tape. This section of the disc is held inside a square plastic jacket as the disc material is sensitive to physical damage. The jacket has slots and holes in it to allow the disc drive to access the disc, but also to protect as much as possible of the surface. These two pieces make up what is known as a disc. Discs are also supplied in a protective envelope made of paper. This stops dirt getting onto the section of the disc surface on which the data is recorded. Data is stored magnetically on the disc as it is with cassette tape.

The disc drive contains a head that is responsible for reading or writing information from or to the disc. Most of the mechanical parts of the disc drive are responsible for rotating the disc and moving the heads so that they are over the correct section of the disc. There is a central hub that grips the hole in the middle of the disc which spins it as required. The heads move radially across
the disc, along the slot in the surface of the disc jacket. These two motions combine to give access to the entire usable surface of the disc.

The disc drive is manufactured to a very high precision. This allows the heads to be positioned accurately anywhere on the disc. It is possible to put information onto the disc and to go straight back to it later without any of the tedious searching used with cassette systems.

When a program is saved onto tape with the BBC micro the program is put on to the tape in blocks, each containing 256 bytes (or characters) of the program. The surface of the disc is divided up in a similar way into blocks of 256 bytes known as sectors.

The sectors on a disc differ from those on a cassette in that they are in fixed positions on the disc surface. Indeed when a disc is first used it is necessary to cover the disc in empty sectors to register their positions (this is known as formatting the disc). The sectors are then filled with data as needed.

The sectors are physically arranged in a number of tracks (either 40 or 80) in concentric circles around the disc. Each track being divided up into ten sectors.

The sectors are all uniquely numbered and the precision of the disc drive enables the computer to seek out any particular sector very quickly and accurately. It is obviously possible to go straight from one sector to another that may he some considerable physical distance away without scanning all the intervening sectors. This capability is known as Random Access which means that any position can be found without having to check all of the positions in between.

The details of tracks and sectors are not usually of any importance to the user as the disc filing system program does all the hard work of deciding where programs are on the disc. The power and flexibility of a disc drive comes from the random access capability which allows the computer to find any particular piece of information very easily. A computer cannot control a tape recorder in the same way due to the lack of control of fast forward and rewind, and the lack of precision in positioning the tape.

The situation is complicated slightly by the existence of the double density disc interface. A standard BBC micro DFS will only work in ‘single density’ mode. By adding a special controller board it is possible to make the BBC micro use the double density storage system. The result of this is to permit more data to be stored on each disc by fitting 18 sectors per track instead of 10. The Watford DDFS (double density) and DFS are nearly identical as far as the
commands accepted are concerned. Further information on double density discs is given in section 5.8.

Throughout this text a ‘file’ is defined to be a program or a piece of data or any other information stored in a group of sectors on the disc (or on tape or any other filing system).

To simplify the problem of storing files on the disc a list of the files on the disc is kept in a specific place at the beginning of the disc. This list contains the filenames together with the number of the sector in which the program is stored. The list is called the catalogue.

When a file is loaded by the user the operating system calls up the Disc Filing System ROM (DFS), tells it that a file must be loaded and passes over all the necessary information such as the file name. The DFS then looks at the catalogue and finds the file name specified in the list of names. It then looks at the number of the sector at which the program is stored, moves the disc drive heads to this sector and loads the information it contains. The catalogue also stores the number of sectors occupied by the file so that the DFS can continue reading sectors in until the whole program has been loaded.

The search for the file is very much like scanning through a cassette with *CAT to find a particular file. However the process is completely automatic. It is this capacity of the disc drive that is most useful; the speed of loading is not the most important feature of a disc system. It is the ability to find a file automatically that sets it apart from the tape system and so greatly simplifies using file storage.

The storage system of the disc is controlled by the DFS ROM, together with the operating system. The operating system hands files and commands to the DFS which then deals with the nitty gritty of actually storing them. The disc drive and the disc interface are themselves capable of moving the disc drive heads to any particular sector and transferring a sector’s contents, either to or from the computer. Without the DFS program the actual hardware of the disc system is useless. The DFS program maintains the list of files on the disc, allows files to be added or deleted and so on. All the capabilities of the disc system are a result of the way this ROM program has been written. Fortunately for the user the system has been carefully designed to be user friendly, whilst retaining flexibility in the control of the files.

Commands are given to the disc system with the * prefix just like cassette system commands such as *LOAD. The machine code programmer has all the standard 'hooks' into the filing system as usual. The disc system uses all the commands of the tape system, though the
meaning of some has been altered slightly, and many new commands have been added which would have been meaningless with cassettes. There are also a few commands that may be used on cassette files as well as disc such as *DUMP which displays the contents of any file on any filing system.

The Basic LOAD and SAVE commands are unchanged so the disc system can be used just like a tape recorder until its full capabilities are mastered. The only thing to watch out for here is that the LOAD”” command doesn’t work in the same way on disc.

1.2 TO SUMMARISE:

The Disc stores the information magnetically on its surface.

The Disc Drive is responsible for physically positioning the heads on the surface of the disc.

The Disc Interface provides the signals that physically control the disc drive.

The disc is divided up into Sectors that divide up the surface of the disc.

The Disc Filing System (DFS) is responsible for allocating sectors of the discs s surface to specific files.

The DFS keeps a Catalogue of files on the disc to facilitate the finding of any particular file.

The DFS does all the work of locating files and putting information in them.

The filing system is controlled in the same way as the tape system, through Basic and with the * commands.

2.0 GETTING GOING

This chapter is intended to get your disc system working with the use of the simplest commands. [Users of the Watford DDFS (double density) should note that using the DDFS is almost exactly the same as using the single density DFS. The only difference to be noted at this stage is a slight change to the *FORM commands, explained below].

The first problem is how to connect the disc drive to the computer. Firstly make sure that the whole computer system is switched off. Now plug the ribbon cable coming from the disc drive into the connector on the bottom of the computer marked ‘disc drive’. The cable is fitted so that the notch and key on the two connectors line up, this will ensure that the cable is fitted the right way round. Normally the cable will be taken out behind the computer, running underneath. The other end of the cable should be attached to the disc drive. The power lead also needs to be plugged in. If your drives are powered from the BBC micro then they will be supplied with a special plug to connect to the power out socket on the underside of the computer. DO NOT UNDER ANY CIRCUMSTANCES cut off this plug and wire the drive directly to the mains this will destroy the disc drive, is potentially lethal and will invalidate your guarantee. If your drives do have their own power supply then they can be wired to the mains in the normal way. If you are at all unsure about this get in contact with your supplier.

If you are not sure about the connection of the drives take the system to someone who can do it for you, a friend with disc drives is much the best idea. It is quite difficult to connect them wrongly as the connector should have a ‘polarizing’ piece that fits a notch in the socket. Wrong connection of the data cable is unlikely to damage either drives or computer. If the lead is reversed the drives will spin continuously when drives and computer are switched on.

If your drives have never been used, or have been posted to you, they should have cardboard inserts in the slot where the disc fits. These are to protect the drive in transit and should be removed before use by opening the door and pulling them out.

Make sure that the door on the drive is open so that the drive cannot access the disc. Switch on the computer and the drives. It is normal to switch on the disc drives and then the computer, but it doesn’t really matter. The result should be a display something like this:
BBC Computer 32K

Watford Electronics DFS 1.43

BASIC
>

If the Watford Electronics DFS message is missing from this display then your disc upgrade has not been performed correctly as you do not have the DFS ROM active! It is also possible that the ROM paging system has not been enabled by fitting 1C76, a 74LS163, and cutting links S12,S13.

Now press Shift-BREAK, holding down the SHIFT and tapping the BREAK, just like pressing a shifted character. One disc in use light should
come on together with a whirring noise from the drive. For users of dual drives this is drive 0, remember which one it is. Press BREAK without Shift to stop the drive.

If that didn’t work (light doesn’t come on/no whirring noise) check that the cable is plugged into the computer properly and that the power to the drive is switched on. The drive has probably got an on/off switch on the back, try this in either position. If it will not work then something is faulty, so take it to someone who can fix it.

Now put a blank disc in drive 0. There are many different ways to put a disc in a drive. They usually result in the disc ending up the wrong way round, or upside down. Put your thumb on the disc label put there by the manufacturer, with your forefinger running behind the disc. Pull the disc out of the protective envelope and insert it in the drive with the label upwards. If the disc is inserted wrongly it may damage the disc, or the disc drive, and you will get Disc error when the disc is accessed.

Shut the drive door. It is impossible to access a disc without the door closed. Closing the door puts the central hub onto the disc and allows the disc to rotate.

<< Picture : inserting a disc >>

2.1 FORMATTING A DISC

As has been explained it is necessary to FORMAT a disc before it can be used.

[[[[[Users of the Watford DFSs can do this with the *FORM command. If you have 40 track drives use *FORM40, and *FORM80 if you have 80 track drives. The procedure is:

*ENABLE
*FORM4O 0
Large (62 file) catalogue? press Y
CONFIRM FORMATTING OF DRIVE 0? press Y again.

This now produces:
Formatting drive 0

A series of numbers (in hexadecimal) are produced, showing the track
numbers as each individual track is formatted. At the end the
Disc formatted message is produced.

Users of the Watford Electronics DDFS will be asked an extra question after the *FORM command:

Double density ?

To create a double density disc press Y, to create a single density disc press N. It doesn’t really matter which you choose at this stage. When using the double density DDFS the density of the disc is stated at the top of the *CAT display.

It is possible that a single question mark will be printed after one of the numbers. This indicates that the disc needed to be formatted more than once before it could be made to work. This indicates a disc that could be unreliable. If two question marks are printed after any one number then the disc could not be formatted correctly and is faulty. If so try formatting another disc. If all the tracks show errors then contact your supplier as there is some sort of problem with either the drive or the disc interface. The Watford Electronics DFS user can now skip the COPYING THE UTILITIES DISC section as you do not have a utilities disc with this DFS.]]]]]

2.2 COPYING THE UTILITIES DISC

The standard DFS user is supplied with a disc formatting program on a disc. Obviously this disc is very valuable, if you lose the contents of this disc you will not be able to format another disc. To protect the disc contents the ‘Write protect tab’ should be fitted, the disc should be supplied with one. This is a small
rectangular adhesive tab that covers a small cutout in the edge of the disc (see diagram in chapter 5). Your first action should be to insert the ‘formatting’ disc into the drive. Follow the instructions with the disc on how to enter the formatting program. When the program has loaded and started up remove the formatting disc being careful not to start the formatting process until you have removed the disc. Now insert a blank disc into drive 0 and obey the printed instructions to format this disc to the correct number of tracks on drive 0.

You will need two formatted discs so format another one when the first has finished. Most utilities disc based disc formatters are very similar to the *FORMnn command. Usually a list of track numbers is produced, if any track number is followed by ‘?‘ then that track could not be formatted, if so format another disc.

When you have two formatted discs you must copy the formatting disc onto one of the new discs. If you have a two drive system then insert your FORMATTING disc into DRIVE 1. Ensure that the new formatted disc is in DRIVE 0. Now type:

*ENABLE
*BACKUP 1 0

This copies the entire contents of the disc in drive 1 onto the disc in drive 0. Make absolutely sure that Drive 1 contains the original formatting disc, and that drive 0 contains the blank.

If you have a single drive system then insert your formatting disc into the drive, now type:

*ENABLE
*BACKUP 0 0

This will prompt for the source disc, this is inserted so press a key. Shortly afterwards you are prompted to insert the destination disc, put in the blank disc and press a key. Repeat this procedure until the '>' prompt re—appears. Please do this carefully; make absolutely sure that you have inserted the FORMATTING disc when prompted for the SOURCE disc, and have inserted the BLANK disc when prompted for the DESTINATION disc.

This will produce a second copy of the formatting disc. You should now put away your original copy of the formatting disc and use the new one until you are familiar with the system. When you are confident about using the copying commands of the system you can put the formatting program onto other discs. You should always have at least three copies of the formatter. If you do not want to clutter up your discs then keep a tape copy.

2.3 DISC HANDLING

A few comments on the handling of discs are necessary. Discs will usually take a great deal of abuse and still work perfectly. They do, however, sometimes fail spontaneously. This usually happens to your most valuable disc just before you back it up. Discs are vulnerable to physical damage from heat, weights, magnetic fields, greasy fingers and coffee. Never allow anything to touch the recording surface of the disc. One very common cause of disc faults is failing to put them in the drive straight. If the disc makes loud noises whilst spinning and produces ‘Disc fault’ try taking the disc out of the drive and re—inserting it. The system for copying the entire contents of a disc will be explained later.

2.4 USING THE FILING SYSTEM FOR YOURSELF

Make sure that the disc you have formatted is in drive 0. Type *CAT (followed by Return of course). This command lists the catalogue that is stored on the disc, the list of the files on the disc. As the disc is empty it will only produce the title thus

*CAT
(00)
Drive: 0 Option: 0 (NONE)
Directory: 0.$ Library:0.$
Work file $.

00 files of 62 on 80 tracks
>

The information given will vary slightly depending on which DFS or DDFS is being used.

Type in this:

NEW
10 FOR A = 1 TO 10
20 PRINT TAB(A) ; “HI THERE”
30 NEXT

This gives a demonstration program to play with. Type SAVE”FRED” and press RETURN. After a couple of seconds the prompt will re—appear. The program has now been saved on the disc, rather more easily than saving on a cassette. Type *CAT again to see the file FRED in the catalogue. For demonstration of the catalogue a few more files are needed, so alter the program a bit and save it with a different name; make a few versions. Now *CAT should produce a more meaningful list. It is a feature of the DFS that files are listed in the catalogue in alphabetical order. And one of these programs can be
loaded in seconds with LOAD"name" in the normal way. It should now be clear that the disc drive is much easier to use than a cassette recorder for the purposes of saving your own programs. The DFS insulates the user from the actual storage of the files on the disc so you don’t have to worry about how it works at all.

Play around with the programs on the disc, try using CHAIN and LOAD. An interesting idea to try is adding CHAIN to the end of one of the programs to CHAIN another one.

If a file is saved with the same file name as a file that already exists on the disc then the file on the disc will be overwritten with the new file. There is no warning that this will happen, so check with *CAT to see if the file name you are about to use is already on the disc. There are better ways to protect against this, but they are not described here for simplicity. (See later on *ACCESS and file locking sec.3.08).

Having put all these files on the disc how do you get rid of them? You can save over the old files by using the same name as described above. However to actually remove a program from the disc you have to use a special command called *DELETE. With a tape system, to delete a file you simply save over the top of it. Deleting a file on a disc system is slightly different. All that actually happens when *DELETE is used is that the file name specified is removed from the catalogue. Thus the file is not physically removed from the disc but you cannot access it as the reference to the file no longer exists. Do not worry about this for the moment, but there is a special command *COMPACT that removes all the useless files from the disc that have been deleted from the catalogue and gives back all the space on the disc. Having deleted a file it is usually extremely difficult to recover it, even though it is still on the disc.

A filename may only contain 7 characters. Do not include any of
# * . : as these have special meanings and will only confuse things until you are familiar with their special uses.

We have so far only used one drive for program loading and saving. If you have double—sided drives or twin drives the command to select a different drive is (logically enough) *DRIVE followed by a number in the range 0 to 3. Drive 0 is the default, selected at switch on. Drive 1 is the other drive. Drives 2 and 3 are the back of drives 0 and 1. It is, of course, necessary to have formatted discs in whatever drive you are using. If you have double sided drives the format command should be used as before to format the other side of the disc [*FORM80 2]. You can transfer your already formatted disc to the other drive if you have two. Type *DRIVE 1 and use it as before.

<< Picture : drive numbers >>



3.00 INDISPENSABLE COMMANDS

3.01 LOAD SAVE CHAIN

These Basic commands are unchanged in meaning. Use just as you would for the cassette system. [Only LOAD"", SAVE"" etc. work differently, this is explained in *WORK (sec.3.05)].

3.02 *LOAD *SAVE *RUN

The operating system commands *LOAD *SAVE and *RUN work on the disc system as they do on the cassette system. The only difference being the restriction in the length of the filename, only seven characters. It is worth noting that it is very dangerous to load a file directly into the DFS work space area from &E00 to &l900, the file will probably be corrupted and DFS will become confused.

3.03 DRIVE SELECTION

If you have a multiple drive system it is extremely useful to be able to specify the drive number for a file to be loaded from or saved to. *DRIVE is used to select the drive normally but if you want to load one file from a different drive it is easier to specify the drive in the filename thus: LOAD":l.FRED". This will load FRED from drive 1. The colon identifies the drive number and the full-stop terminates it. This only temporarily sets the drive to be used. It does not affect the *DRIVE value. *CAT can access any drive more simply: *CAT 1 for instance.

3.04 DIRECTORIES

The file name of all files used by the DFS has an extra character that is not normally displayed or typed. This character sets the Directory in which the file is grouped. The directory character is very like the file extensions found on more powerful operating systems. The main use is to distinguish easily between blocks of files, each of a similar type.

A file’s directory is specified by putting "D.Name" where 'D' is the
directory required. The full—stop in the middle is necessary to tell
the filing system that the file is for a specific directory. An example is W.LETTER, which would save the file LETTER in directory
W.

If the directory is not specified in the file name then the directory set by the command *DIR is used. When the machine is switched on the character for the directory is set to ‘$‘, this is the default directory in which all files will be put if no directory is specified elsewhere.
Put in a disc with some programs on it. Type *DIR A and press RETURN. Now type *CAT and the display will have '$.' preceding all the files. SAVE a short program without specifying a directory in the name and *CAT again. This file is displayed on its own at the beginning of the catalogue.

When the catalogue is put on the screen all the files in the directory set by *DIR are displayed without the directory in the first block. Then the rest of the files are given with all their directories specified in the second block.

To clarify this imagine the files as files in a filing cabinet. Imagine lettering each drawer with an identifying character, the directory. One drawer is set open (*DIR) to which all accesses occur, unless someone temporarily opens another drawer.

The system is intended to simplify storing many types of file on the same disc. You could use W for wordprocessing files, B for Basic programs, C for machine code files and so on.

No matter which directory has been set by *DIR any file can be accessed from any directory by specifying the file’s directory in the name with the full—stop notation. *DIR should be used when you are going to be handling a batch of, say, wordprocessing files.

A temporary drive and directory can both be set in any filename: SAVE “:2.W.ALBERT” will save ALBERT in directory W on drive 2 (that’s the back of Drive 0). This is in fact the full file specification. The *DRIVE and *DIR commands are implemented so that you don’t have to put both of these every time a file name is used. A file is always saved with, effectively, :Drive.Directory.Name even if only the name is specified. If the drive and directory are not specified then 0 and $ are assumed so normally all files are saved as :O.$.Name . The *DIR and *DRIVE commands are to change the default values used if directory or drive are omitted when a filename is used.

3.05 [[[[[ *WORK

When a command is used without a filename e.g. LOAD"" or *SAVE"" 2000 +10, the filename set by the *WORK command is used. This is used to set the the file name with which you are currently working, for instance if you are editing a particular program. Its function is purely to save you typing.

*WORK ALBERT will result in SAVE"" in fact executing SAVE"ALBERT". If you are going to type the same filename more than once it is worth using *WORK to save typing. *WORK does not affect commands when they are used with a full file name.
*WORK :Drive.Directory.Name will set the current Drive (*DRIVE value) to the number specified. Directory is NOT used to set the current directory, so your directory for normal save and load is left unchanged, but the work file can be in a different directory. This command is very like *DIR and *DRIVE in that it sets the name to he used if none is specified.

The *WORK command also supports an automatic version numbering system. If an I is put after the filename then digits 6 and 7 of the name are incremented as a decimal number e.g.

*WORK JIMMY27 I

Any SAVE or OPENOUT command will automatically increment the number.
If non numeric characters are given then the number defaults to 00.
When this mode is selected an ‘(incrementing)’ message is given in
the catalogue.]]]]]

3.06 WILDCARDS

Many of the DFS commands described later in this section can be used on many files at once. The method used for this is to put wildcard characters in the filename given. These characters represent ‘anything at all’. # represents a single character. Whenever a catalogue is searched, # will match whatever character is actually found in the catalogue. * represents any number of any characters. As an example the *INFO command will be used. This gives information
on a file and can do so for many files.

*INFO #.FRED will give information on all files called FRED in any directory, not just the default.

*INFO FRE# gives information on all files such as FRED FREZ FRE& FRE= and so on, but not FREDA.

*INFO AB* gives information on all files whose name starts with AB followed by any other characters.

*INFO *.* is used to give information on all the files on the disc,
*INFO #.* is just as good.

INFO W.*X is not allowed in the standard DFS as the '*' must be the last character in the name.

[[[[[When using a Watford DFS the wildcard system is extended to permit e.g.

*INFO W.*FRED* which matches any file in directory W containing FRED anywhere in its name.]]]]]

It is not possible to specify a ‘wild’ drive number. When # or * is used in a filename then that name is said to be ambiguous, i.e. you have supplied an ambiguous file specification (<afsp>).

3.07 DELETING FILES

When a file is deleted it has gone permanently. Even though the information it contained is probably still on the disc it is extremely difficult to get DFS to access it again. Make sure that the file you are deleting is the correct one. An easy mistake is to delete a file on the wrong drive or in the wrong directory, for instance deleting the text that goes with a program. Keeping regular back up copies of everything helps guard against these problems.

*DELETE is the usual command used to delete a single file. It is used with a filename but will not work with an ambiguous name i.e. one containing wildcard characters. This is to make it harder to delete a large group of files when you meant to delete one.

There will be many occasions when it will be necessary to delete many files at once. There are two commands that will achieve this.

*DESTROY takes an ambiguous file name, * and # can be used. This will display a list of the files that agree with the file specification given. It will then ask Delete (YIN)? Pressing Y will result in the files being deleted, anything else will not. This command is very destructive so you must type *ENABLE as the last * command before using *DESTROY. This is to make it harder to lose important files. E.g.

*ENABLE
*DESTROY #.BL*
$.BLOGGS
W.BLOGGS
P. BLGGS 1.
B. BL457

Delete (Y/N)?Y
Deleted
>

*WIPE is very similar to *DESTROY except that it produces the file names one by one and you may press Y to delete an individual file, or any other key to go onto the next without deleting. This command is the recommended one to use as you must consciously press Y to delete each file individually. It would be quite an achievement to delete something accidentally. E.g.
*WIPE #.BL*
$.BLOGCS :N
W.BLOGGS :Y
T.BL435 :Y
>

When files are deleted by any of these commands, references to them are removed from the catalogue. This leaves the data still on the disc, taking up space. The command *COMPACT removes all the data on the disc that is not referenced by the catalogue. This will give back all the space that has been left by the delete commands. *COMPACT will probably destroy the contents of memory, so SAVE your program before using this command.

[[[[[See chapter 10 on the disc sector editor for instructions on recovering deleted files]]]]]

3.08 FILE LOCKING

To protect a file against accidental deletion the command *ACCESS is used. A file can be either locked or unlocked. When it is locked it cannot be deleted (or WIPEd or DESTROYed or RENAMEd), or overwritten by saving a file with the same name.

The syntax is *ACCESS Name L. The L causes the file to be locked, if omitted the file will be unlocked. The name can of course be ambiguous.

This technique should be used for all files on a disc that are essential for the operation of the system. Examples are the !BOOT file that is explained in the autostart section and utility programs. If you wish to change a locked file you must unlock it before changing it, otherwise 'File locked' will be displayed when you attempt to re—write it. Remember to lock the file again afterwards.

In the catalogue a locked file is displayed with an L after the name marking it as locked.

3.09 BACKING UP FILES

It is very important to keep backup copies of all your programs. The problem with the complexity of disc systems is that corruption on any part of the disc may lose its entire contents by making the disc unreadable. With tape it is easy to load the file and patch the error, with the disc system this can be nearly impossible. The catalogue on the disc is very vulnerable; if there is corruption here then the disc is unlikely to function. This is the reason for putting the catalogue around the outside edge, where the data is
most spread out on the disc.

In business situations backup copies are usually made at least daily and on discs in sets of three, copying the day’s disc onto the oldest of its two backups. This amount of backing up is perhaps excessive in the home situation where one backup is perfectly sufficient. If you do not wish to use more discs you can keep your backups on tape.

A popular technique is to back up one side of a disc onto the other. This is rather dangerous as physical damage to the disc will often make both sides unreadable.

There are a number of methods for putting copies of files on other discs. The clumsiest, but simplest to understand, is to LOAD a program from one drive and SAVE it with another drive specified in the file—name with ‘:Drive.’. There is a command that will do this process automatically for any file, whether it is a Basic program or something completely different. This command is *COPY. The command can copy a number of files by giving a file name containing wildcard characters as defined previously. An example is:

*COPY 0 1 W.*

This will copy all files in directory W on Drive 0, and will put them on Drive 1.

*COPY 2 0 FRED will copy file FRED from Drive 2 to Drive 0.

This command should be used for all general file shuffling. It can be used on a single drive system, prompting for source and destination discs. A large file will be copied in parts so the discs will have to be swapped a few times. Use *COPY 0 0 filename. A slight problem with *COPY is that any program in memory will probably be destroyed by the command. Just save it on disc and re—load it afterwards.

The quickest way to copy a complete disc is the *BACKUP command. This copies the entire contents of one disc onto another, destroying whatever was on the second disc originally. This works by copying groups of sectors. The command is not concerned with the contents of the disc and blindly copies the entire disc. The only problem with this method is that the spaces in a disc created by *DELETE are left on the copy. Use *COMPACT first. *BACKUP should be used with extreme caution as it will destroy the contents of the disc being copied onto. Check that the copy disc is the correct one. The command must be enabled with *ENABLE as the last * command before the copy is made. This is to afford extra security. The normal backup command will be:
*ENABLE
*BACKUP

This command will work as above for *COPY on a single drive. It will also destroy the contents of memory.

3.10 TEXT FILES

The disc system is very useful for manipulating text files as well as programs. There are several commands which will create or display text built in to the standard system.

A text file is rather different to a program file in that the contents of the text file are not in any way a copy of the contents of memory. They contain a series of ASCII characters, put out singly to the disc system. The file is handled internally in groups of 256 bytes, characters being put into a buffer before actually being transferred to disc. This means that it is necessary to inform the DFS when writing a file has finished. This is extremely important otherwise the last buffer full of information may never be written to the disc. Whenever a file is active 256 bytes of that file are kept in a special area of memory called the buffer. As you move through the file the DFS will put this buffered section of the file back on to the disc in its modified form and will then load the next buffer full of information. A very useful piece of computer jargon is the description of a file as 'open' or 'closed'. When a file is first accessed you are said to have ‘opened’ the file. When you finish accessing the file you close it.

In principle each text file is considered to be like an office file. It can accept text: and can produce text. However it is necessary to tell the computer which files you wish to have open, and to close them when you have finished. There is a maximum limit of 5 files open at any one time. This does not limit the number of files that can be used, but you can only have 5 files that can be accessed by your program at any one time. This number should be easily sufficient for most needs. Usually only 1 file will be open at any one time.

As an example *BUILD is used from the keyboard to make up lines of text. Try typing *BUILD FRED. This produces a line number (nothing to do with Basic). Type in some text and press Return at the end of the line. Continue for a few lines. For example:

*BUILD FRED
0001 Hi there
0002 This is
0003 An example
0004 of building a file
0005 <Escape>
Pressing the Escape key informs the system that you have finished
writing the file. The buffered section of text is put onto the disc
and the file is closed.

You now have a text file on the disc. *BUILD is a very crude way of making up text, but very useful if you don’t have a wordprocessor. It works by opening a file called FRED, reading a line of text from the keyboard and outputting that text to the file. When Escape is pressed the file is closed and control is returned to Basic.

The next problem is to have a look at the contents of a file. Use
*TYPE FRED to see the text stored in file FRED. This produces:

Hi there
This is
An example
of building a file
>

This command prints onto the screen the contents of a file blindly
interpreting the contents as ASCII information.

*LIST is very similar to *TYPE but displays the line numbers used for entry by *BUILD. Try *LIST FRED to see the effect. Note that the line numbers are not stored in the file. The system simply detects the ‘Return’ character (ASCII 13) and puts out line numbers for each return it finds.

*DUMP also displays the contents of a file, but will work correctly on any file. *DUMP displays a list of the contents of the file as Hex numbers with a list of the ASCII equivalents. This command
displays a full—stop for characters that cannot be printed. It is
very useful for looking at programs as stored on the disc. Basic
programs are not stored as ASCII, but in tokenised form. Variable
names, comments and much other information is held as ASCII as part of the program. Teletext control codes and similar are given in the
Hex listing of the file, but are not printed, so any protection in
the program to stop it being listed can be found and its location in
memory calculated.

Another very useful method of creating text files is the *SPOOL command. *SPOOL ALBERT will cause all characters printed from then

on to also be output to the file ALBERT. This is extremely useful for transferring Basic programs to word processing facilities. It is essential that *SPOOL is given with no name to close the spool file when you have finished 'spooling'. If this is not done then part of the data is lost, and the system will be confused.

*EXEC is the opposite of *SPOOL. It takes a text file from the disc and effectively types it at the keyboard for you. A good example is to make up a text file containing a program listing (with *SPOOL) and to use *EXEC to type the program in for you. E.g.

LOAD"FRED"
*SP~L JIM
LIST
(program lines are listed on screen and in file JIM on disc)
*SPOOL
(buffered section of file is written)
*TYPE JIM (displays contents of the file JIM now contains the
program listing)

Files can be used from within a program but this will be explained later (chapter 6) as it is rather complicated. The most useful technique with text files is the use of *SPOOL and *EXEC on Basic programs. It is very easy to append part of one program onto another by *SPOOL name followed by LIST. *SPOOL to close the file. Load the next program and *EXEC to get the extra part added on.

3.11 AUTOSTART

When Shift—BREAK is pressed the DFS tries to find a file on the disc called !BOOT. This is known as the boot file as this file is loaded and executed when the system is ‘booted’ by pressing Shift—BREAK. The file can be set to be *LOADed, *RUN or *EXECed. The *EXEC is most commonly used on a small text file containing a CHAIN statement to load and run a Basic program.

The action to be taken when Shift—BREAK is pressed is specified by *OPT 4,X. Where X is:

0 ignore the file
1 *LOAD !BOOT
2 *RUN !BOOT
3 *EXEC !BOOT

This option is stored on the disc and displayed in the title of the catalogue. For example:


*BUILD !BOOT
0001 PRINT "THIS IS THE BOOT FILE"
0002 *KEY0 "Useful for defining f—keys"
0003 (Escape)
*OPT 4,3

Now press Shift—BREAK and the file will by EXECed, i.e. it will be typed in. Any text file can be used. You could use a SPOOL file of a program listing, with a RUN on the end to start the program that has been typed in running. The usual method is to make !BOOT contain CHAIN"name". A machine code program can be saved as !BOOT and *RUN automatically.

The links on the keyboard can be changed so that the file is dealt with when Shift is not pressed, and is ignored when Shift is pressed.

[[[[[The operation of the auto—booting system is affected by which version of the DFS you are using as later versions retain the drive number over a soft BREAK. This results in the !BOOT file being searched for on the drive selected before BREAK was pressed. To stop this happening press Shift—Ctrl—BREAK see sec.9.3.]]]]]

3.12 HELP

*HELP is a command supported by the operating system designed to help you discover the correct syntax for the command you are trying to use. For instance type *DRIVE and press return. This displays the correct syntax for the command. Typing *HELP gives:

Watford Electronics DFS 1.43
DFS
FILES
SPACE
UTILS

OS 1.20

Typing *HELP DFS will list the syntax of all the DFS commands and *HELP UTILS gives the syntax of the utilities. [If you type *HELP DRIVE it will give the help information for the command *DRIVE.] Try out this command, it is extremely useful. Most of the terms used are fairly clear: <afsp> means a file specification containing wild card characters and <fsp> means a file specification that doesn’t. [It is possible to type *HELP DRIVE COPY to be given the syntax for both commands, indeed any number may be strung together in this way.]

[[[[[Two special uses of the *HELP command are *HELP SPACE and

*HELP FILES. The *HELP SPACE (<drive>) command scans through the disc giving a list of all the gaps on the disc. This shows all the gaps left by deleting files. If you are considering using *COMPACT on a disc then this command will show you how much space will be gained. The total number of sectors free on the disc is also given.

*HELP FILES produces a list of all the text files that are currently open. This is extremely useful for de—bugging Basic file handling programs. This is discussed more thoroughly in the section on random access filing.]]]]]

3.1 3 TITLE

Typing *TITLE Name will title the current disc 'Name'. Typing *CAT will now show the title in the top line thus

Name (34)
Drive 0 Option 0 (NONE)
Directory: O.$ Library: O.$
Work file $.

list of files

It is possible for the title of the disc to contain ‘control’ characters. *TITLE |!|CFRED will result in a yellow title on the teletext display. The ‘|’ notation is used as normal, as for instance in *KEY. |! generates a code of 128+ASCII, thus |!|C is ASCII &83, teletext yellow. DFS does not permit the entry of these control characters into filenames. Only the title may contain control characters. This is because control characters in filenames confuse the DFS when trying to generate the *CAT display.

3.14 RENAME

A special command is provided to let you change the name of a file. The syntax is: *RENAME oldname newname e.g.

*RENAME FRED BERT

To move a file between different directories use:

*RENAME C.FRED D.FRED

A drive number may be specified for the first name, and will be ignored for the second if given. Early versions of the standard DFS will not function correctly if a drive number is specified in *RENAME.

4.00 USEFUL COMMANDS

The point of this chapter is to introduce you to most of the remaining commands and features of the DFS. The easiest way to learn about the features of the DFS is to experiment with the commands given.

4.01 [[[[[ 31/62 files

One of the biggest problems with the standard DFS is the fact that the maximum number of files that can be contained in the catalogue is 31. In Watford Electronics DFS this has been increased to 62 files in the catalogue.

To maintain compatability with discs formatted under the standard system it was necessary to allow the use of a 31 file system. The 62 file capability is at the cost of an extra two sectors at the beginning of the disc, used to store the extra catalogue information. The limited number of files is purely because the catalogue is restricted to certain sectors on the disc and so has limited space to occupy. 31 files is ridiculously small hut should you wish to use a disc that can be used normally by the standard DFS then you must use a disc formatted with a small catalogue, the format of which is exactly to the correct standard.

When using a disc formatted for 62 files the DFS has to recognize the fact that the extra catalogue space exists. This is achieved through the use of a series of &AA recognition bytes in the area that would be used for the title in the second catalogue. Some loss of speed results from the untidiness of having to check for the existence of the second catalogue. This is only apparent when saving a file, when a maximum of five catalogue accesses can be made in finding a space to fit the filename. The speed reduction on loading is very small indeed.

If a double catalogue disc (62 files) is used under the standard DFS then the standard system will be unaware of the second catalogue and all the files it contains. It is possible to load files that exist in the first catalogue, but saving files will probably overwrite the second catalogue or some of the files on the disc. Copy 62 file discs onto 31 file discs before attempting to use them this way.

The only possible problem when using a standard format disc on Watford Electronics DFS is the possibility that the first file on the disc may contain the recognition bytes that identify the second catalogue. This is extremely unlikely, but should it occur simply copy the first file onto another disc, delete it, compact the disc and copy the file back again. The first file is the one first listed by *INFO *.* .]]]]]

4.02 *ENABLE

The very destructive commands within the DFS require the last executed * command to be *ENABLE. This is to make sure that you don’t accidentally do something that is disastrous. [All the format commands,] *BACKUP and *DESTROY need enabling before use as these can all destroy the contents of a disc rather easily.

4.03[[[[[ *FORM35 *FORM40 *FORM80

The *FORM40 and *FORM80 commands are described earlier. They format a disc on either a 40 or an 80 track drive. These commands are where the catalogue size of the disc is selected. The *FORM35 command is to allow the use of 35 track drives on the BBC micro. The 40 and 80 track formats are fully compatible with the standard DFS if the small catalogue is selected.

The Watford double density DFS (DDFS) does not support *FORM35. This is due to lack of space in the DDFS ROM. 35 track drives tend to be of older design and are generally not capable of supporting double density operation. 1]]]]

4.04 [[[[[ READING AND WRITING 40 TRACK DISCS ON AN 80 TRACK DRIVE

Typing *OPT40,0 makes the DFS use its double stepping mode for drive
0. This allows 40 track discs to be accessed by your 80 track drive.
40 track discs have half as many tracks as 80 track discs, but still spread over the same width of disc. The DFS simply has to step twice between tracks to find the correct track, rather than doing one step as it would normally.

The result is that *OPT40,0 will allow you to read a 40 track disc on an eighty track drive. You can similarly use *OPT40,0 to let you write to a 40 track disc using your 80 track drive. lit is recommended to use a freshly formatted 40 track disc for writing to. Creating 40 track discs with an 80 track system is not quite as reliable as using a proper 40 track drive, though in practice problems very rarely occur.

This command is not applicable to those with 40 track drives. If
*OPT40,0 is typed when using a 40 track drive then the drive will work in 20 track mode. As you cannot format discs to 20 tracks this mode cannot be used safely.

It is possible to set double step mode or normal mode for each individual drive number. E.g. *OPT40,3 will set drive 3 to double step and *OPT80,0 will set drive 0 to normal. It is very important to remember to reset to 80 track mode as you can read the zeroth track of a forty track disc on an eighty track drive anyway which
allows the catalogue to be read. Writing to an eighty track disc in double step will result in disc errors and could damage the disc drive.

The best way to use this command is to copy files from the forty—track disc in double step mode onto a standard eighty track. Simply set the double step mode for the appropriate drive and *COPY as normal. It is much more convenient to have all your discs with the same number of tracks.

Much commercial software is supplied on 40 track discs. As this software will usually only work if Shift—BREAK is used, *OPT40,0 is not convenient. Pressing Shift—Shift Lock—BREAK causes drive 0 to boot up in double step mode, curing the problem of reading these discs with 80 track drives. Note that double step mode status will be retained over a soft BREAK (see section 3.11 and 9.3) so that you could type *OPT40,0 and then press Shift—BREAK. To ensure that drive 0 is booted in double step on any version of the Watford DFS press Shift—Shift Lock—Control Break.

Versions of the Watford DFS before 1.43 (double density DDFS before 1.53) used a different command to select double step mode. The command used to select double step was *FX11O,drivenumber,255. To select normal mode *FX11O,drivenumber,0 was used. The use of *OPT was necessary for full Tube compatibility.]]]]]

4.05 [[[[[ OSARGS &FE

This call has replaced OSBYTE 111 which was used by versions of the Watford DFS prior to 1.43 (double density 1.53). It returns the drive number of the last *LOAD or *RUN command. The value is returned as a binary number. The main use of this is for a Basic program to be able to discover which drive it was loaded from (LOAD and CHAIN are forms of *LOAD) The command allows other files to be loaded from the same drive as the program, without having to set *DRIVE

To call OSARGS use:
A%=&FE:Y%=0:X%=&70:CALL &FFDA:drive=?&70

If you have an earlier DFS use:
A%=111:drive=(USR(&FFF4) AND &FFOO) DIV &100

to read the drive number.]]]]]

4.06[[[[[ AMBIGUOUS FILE NAMES

As well as commands such as *INFO which are designed to work on many files at once, commands such as *LOAD can be given an ambiguous file name (one containing ‘wildcard’ characters such as *). The effect of
this is to operate on the first file that matches the file specification given as the name. This is intended to save typing. It is safest to type enough characters of the name to uniquely identify the file and replace the rest with a ~. E.g. *LOAD AL* is shorter than *LOAD ALBERT, and will load the correct file if ALBERT is the first name in the catalogue that starts AL.

The first file in this context is the first file stored in the catalogue. It is not the first file of the *CAT display. The order of the files on the disc is given by *INFO *.* . It is not very safe to specify so little of the file name you want that it is necessary for the file you want to be nearer the beginning of the list than some other. It is better to specify an extra character or two. Remember that specifying the full name will always load the correct file, the abbreviated form is for convenience only.

Certain commands do not allow the use of an ambiguous file name these are:

*DELETE (use *WIPE or *DESTROY)
*SAVE (and all other OSFILE calls except *LOAD and *RUN)
*WORK
Open files. The text file handling system does not permit ambiguous names. Many commands use this such as *SPOOL, *DUMP, *TYPE etc.]]]]]

4.07 [[[[[ *MLOAD and *MRUN

*MLOAD will load a file to &1200 whatever the load address given in the file. It will then switch off the disc system and move the file to the correct place. *MRUN does the same and then jumps to the execution address (as stored when the file was saved).

To make proper use of these commands you need to be aware of the re—load address for *SAVE thus:

*SAVE “FRED” 1900 +2345 8023 0E00

This will create a file with a load address of 0E00, despite the fact that the file is a copy of memory from 1900 when it was originally saved. The 8023 is the execution address, in this example it is the execution address of issue two Basic.

To use this command for a machine code program on tape:

*TAPE
*OPT 1,2
*LOAD”” 1900
produces NAME MN LLLL SSSS EEEE
*DISC
*SAVE “name” 1900 +LLLL EEEE SSSS
The final SSSS is known as the re—load address. It can be specified in the tape system, though the User Guide doesn’t say so. It is simply a fourth parameter that replaces the default load address of the address from which the file is saved, with a different value. You MUST include an execute address (EEEE) as the operating system will assume that your re—load address is actually an execution address if you do not.

You now have a file that can be *MRUN normally, which will he loaded and executed just like it would have been off tape.

If it is a Basic program that you are moving then there is a slightly bigger problem. It is necessary to *MLOAD the program and then to set PAGE correctly and start executing. The solution is to define a function key thus:

*KEYO,*MLOAD”NAME”|MPAGE=!&C8|MOLD|MRUN|M

Then insert this function key into the key buffer with *FX138,O,128. The proper start address of the file is stored at &C8 for your convenience.

A short loader program can be used to do this — define the function Key, insert the characters with the *FX call and then END. The file will be loaded, the disc system switched off and PAGE set to the correct value and the program will be RUN. !&CC will contain the correct execution address of the file as displayed by *INFO. This may be of use to the machine code programmer.

These commands are necessary because of the extra memory swallowed by the disc system from &OEOO to &1900 which many programs require to run correctly. It is not possible to *LOAD directly into this area as the program will be corrupted; the area is workspace and is used by DFS to work in! If you have both Watford Electronics DFS and the standard DFS in your machine then memory up to &1BOO will be swallowed, as both discs systems take private workspace areas (see sec.9.3).]]]]]

4.08 SPARE MEMORY

If a Basic program needs more memory to RUN in, if for instance you are using MODE 0, then some memory can be grabbed back from the disc system. PAGE=&1200 <Return> NEW <Return> will allow a longer program to be used. However many disc commands will corrupt the program, as will pressing BREAK. This technique is not recommended but will work if you restrict yourself to LOAD, SAVE and other simple commands. Text filing will corrupt the program. DFS uses the area from &1100 to &1200 extensively, so lower settings of PAGE will not work.

[[[[[When using a Watford DFS you can set PAGE lower than its normal value of &1900, provided that you only use a limited set of the DFS commands. PAGE can be set as follows for load and save operations together with other functions limited by the available memory:

&1100 catalogue a 31 file disc
&1200 catalogue a 62 file disc
&1300 62 file cat or 1 file open
&1400 62 file cat + 1 file or 2 files
&1500 62 file cat + 2 files or 3 files
&1600 62 file cat + 3 files or 4 files
&1700 62 file cat + 4 files or 5 files
&1900 full facilities

i.e. a 62 file catalogue requires one page and each text file open requires one page.]]]]]

4.09 *INFO

This command displays all the information about a file that the disc
system stores. The syntax is *INFO ambiguous filename. The result is:

A.NAME L SSSSSS EEEEEE LLLLLL CCC

Where the first L indicates a locked file, SSSSSS is the start address, EEEEEE the execution address and LLLLLL the length. CCC is the start sector number of the file. CCC/10 will give the track on which the file is stored [CCC/18 on a double density disc]. It is useful to note that the Disc system uses 18—bit addressing rather than the 16—bit addressing of the 6502. The main reason for this is for use with tube processors. The extra file length may well be needed by the 32016 tube processor. Setting the top bits of the address to 1 (i.e. use FF1900 as a start address) forces the file to be loaded into the BBC micro itself. Any other value will allow the file to be sent across the tube to your tube processor. This doesn’t matter if you haven’t got a tube processor.

4.10 *OPT 1,X

When *OPT 1,1 is used it will result in all future disc accesses displaying the full information stored on the files being accessed. That is the information that is normally given by *INFO filename.

*OPT 1,0 returns the system to normal.

4.11 LIBRARIES

When you type a command that the operating system and DFS do not recognize the disc is searched for a file of that name. If a file is
found of that name then it will be *RUN. For example *GEORGE is equivalent to *RUN”GEORGE”. This is a very simple mechanism for starting up a machine code program. Simply type *NANW. The main use is for utility programs such as disc searchers, specialized copy programs, or whatever. The only requirement is that the file must be executed as machine code as it can only be *RUN.

When the disc is searched the current drive and directory (usually Drive 0 Directory $) is searched for the file. The *LIB command is used to change which Drive and Directory are used. *LIB :3.W will cause 4name to search Directory W on Drive 3 for the file. This does not affect the current *DRIVE or *DIR setting, so you can be working on one disc and have all your utility programs on another without needing to specify the Drive for each filename. The DFS will in fact search the current Drive and Directory for the file, then search the Library drive and directory.

The system of libraries is intended to make the environment more friendly as it allows utility programs to be called by simply passing their command name to the DFS without having to type *RUN or ‘:Drive.Directory.’.

You can specify drive and directory e.g. *:2.L.CRUNCH. However some directory letters will be recognised as abbreviations of other commands; *L.FRED is *LOAD"FRED" for instance. The shortest solution to this is to type '*/name'. The '/' is the shortest abbreviation for *RUN

[[[[[The Watford DFS uses the library system whenever a file is read so that *LOAD, LOAD, OPENIN etc. will all check the library for the file. This is extremely useful when using a language which reads command files from a utility disc e • g. BCPL. The auto—exec feature is also useful for your own commands, see sec.7.14.]]]]]

If characters are put after the name they can be read by the utility program. The mechanism for reading the parameters is given in the section on Assembler, under OSARGS (sec.8.3).

4.12 *RENAME

*RENAME oldname newname will replace the name for file oldname with newname.

[[[[[An ambiguous name may be specified for this command. This can be rather confusing but essentially allows groups of similar files to have the identical part of their names replaced. For example to change FRED1,FRED2,FRED3 into BERT1,BERT2,BERT3 use:
*RENAME FRED* BERT*
$.FRED1 : renaming to $.BERT1
$.FRED2 : renaming to $.BERT2
$.FRED3 : renaming to $.BERT3

The part that is left ambiguous is not renamed. You can also use the
*XXX* ambiguous format. Experiment with these capabilities. It is not possible to create illegal file names with it so you can’t do any harm. Combinations which result in two files of the same name on the disc will produce the error message ‘File exists’ without creating two identical names. The ambiguous section of the name is in fact left alone when the new file name is being generated.

if this confuses you do not put ambiguous filenames in RENAME! You can always specify each individual name with its replacement. This special capability of the command is intended to make life easier —you don’t have to use it if you don’t want to. If RENAME does not list any files then it has not changed the name of anything.]]]]]

4.13[[[[[ *MOVE

This command is just like COPY in that it transfers files between discs and has exactly the same arguments. However the user is presented with each filename that fulfils the ambiguous file specification. Pressing Y will copy the file, N will move on to the next without copying the file. This is very useful for blocks of files with a very similar name of which you want to copy a few.]]]]]

4.14 *VERIFY

A disc may be verified at any time. This does not corrupt the contents of the disc [or memory]. Type *VERIFY <drive>. The message: ‘Verifying drive 0’ will be produced, followed by a list of track numbers in hex. If a track number is followed by a question mark then it took up to ten tries at verifying the track for it to verify properly. If two question marks are printed next to any track number then that track could not be read in the ten tries that DFS does for you. Trying again with VERIFY is a little pointless as the DFS will already have tried each track ten times before calling it useless. Do however try removing the disc, re—inserting it, and verifying again. Consistent verifying errors indicate that the disc is faulty. Copy all the files off it that you can and then try re—formatting it, this often cures the problem.

There may be a verify program present on the utilities disc for the user of the standard DFS. This will corrupt memory as the program has loaded somewhere! As the disc based format and verify commands are not totally integrated into the DFS they are slightly more prone to failing on disc errors. One question mark indicates a track that
did not work after 10 tries.

4.15 OTHER FILING SYSTEMS

The BBC micro can support many different filing systems, of which the DFS is just one. The commands that will select a filing system that is resident in the OS 1.20 ROM are:

*TAPE3 300 baud cassette
*TAPE12 1200 baud cassette
*TAPE default tape speed (1200 baud)
*ROM cartridge ROM system

Other filing systems that are resident in extra ROMs are:

*NET Net filing system
*TELESOFT Telesoftware downloading system
*DISC Disc Filing System (or *DISK)

5.0 FLOPPY DISCS

The floppy disc is in normal use a very robust means of data storage. However when a disc fails all the data on it is usually lost. This is because the catalogue stored on the disc is usually the part that becomes corrupted by physical wear. The catalogue is accessed more than any other area of the disc’s surface.

5.1 HANDLING DISCS

Do not remove them from the black plastic envelope to reveal the round piece of plastic that is the disc itself.
Do not touch the exposed area of disc.
Do not leave discs without a protective jacket, they will get covered in dust.
Do not physically abuse them by heating them up, bending them or standing things on them.
Do not leave them near strong magnetic fields such as televisions, transformers etc.
Do keep them in a proper storage box.
Insert them carefully into the drive without bending them.

Misuse of a disc will usually lose ALL of the data on it and may damage the disc drive itself so be careful with them.

5.2 THE WRITE PROTECT NOTCH

On one side of the square black plastic holder of the disc is a small notch. If this is covered with a write protect tab, or a piece of tape, the disc drive will not be able to write anything onto the disc but will be able to read it. This is very useful for discs that contain valuable programs which must not be written over such as the utilities disc.

5.3 THE NEED FOR TAKING BACK UP COPIES

The disastrous effects of damaging a disc have resulted in most users regularly taking copies of their discs. In the home environment it is perfectly adequate to keep one copy of each disc that is in constant use; a tape copy would be just as good. In a business situation or where valuable information is being stored it is best to use three discs in rotation with the copying process putting the newest information onto the disc containing the oldest information. Copying should be performed daily if the computer is in constant use. The *BACKUP, *COPY [and *MOVE] commands of DFS allow copies of discs to be made even on single drive systems with relative ease.

5.4 HOW THE SECTORS ARE ARRANGED ON THE DISC

The disc is divided into concentric circles. Depending on the type of drives in use there are either 40 or 80 of them forming tracks. The tracks are divided into 10 sectors each [18 sectors on a double density disc], each sector holding 256 bytes. The tracks are numbered inwards from track 0 at the outside.

5.5 FORMATTING

This records the positions of the sectors on each track by putting empty sectors onto the disc.

An empty catalogue is also stored on the disc. For the filing system to make any sense of the disc it must have the catalogue recorded on it as well as the blank sectors. The first two [or four] sectors of track 0 are reserved to store the catalogue which the format program sets up to contain no files to inform the DFS that the disc is empty.

Whenever a new disc is purchased it must be formatted before use. Formatting will completely destroy the contents of a disc so you must be careful about which disc you are actually formatting or you could lose your files. Trying *CAT on an unformatted disc will result in a ‘Sector not found message or no response except to Escape, indicating that the disc is not formatted (or has been corrupted).

5.6 DISC ERRORS

When a disc error occurs remove the disc from the drive and carefully re—insert it. Most disc faults are cured by re—insertion as it is critical that the drive hub is central in the hole in the disc. If this does not work and *CAT does not work you have a problem as this indicates a damaged catalogue which is very difficult to deal with. If the catalogue still exists copy all the files that you can get off the disc without errors. The disc will usually start working again if re—formatted, but remember that this will destroy the data on the disc. Try re—formatting a few times if necessary, if this still produces errors then the disc is faulty. The section on editing disc sectors may prove useful when a disc is damaged.

5.7 35/40/80 TRACKS

When you purchase a disc system you either buy 40 or 80 track disc drives. The number of tracks is set by the number of positions that the head can be in across the disc, either 40 or 80. A disc itself may have either 40 or 80 tracks. This is decided by the number of
tracks given when the disc is formatted. The disc itself will have a label that specifies a number of tracks — this gives the maximum number of tracks at which the disc is guaranteed to work. A disc that is nominally 40 track according to the manufacturer will often work formatted to 80 tracks, however it will be less reliable than a disc that was intended to be used at 80 tracks.

The disc drive may also be either single or double sided. The standard disc configurations for the BBC are a single, single sided 40 track disc drive, or twin 80 track double sided disc drives. Any other combination is possible. Again discs are supplied as either single or double sided. Single sided discs often work double sided, but this is not necessarily reliable.

The best idea when purchasing discs is to buy the type of disc intended for your drive. Either 40 or 80 tracks and single or double sided. This may cost more in the short term is well worth it for the long term security of your data. Using a nominal 80 track double sided disc on a 40 track single sided drive will work perfectly reliably but it is rather a waste of money.

If you are confused by all this then buy 40 track single sided discs if you have a 40 track single sided drive. Buy 80 track double sided discs if you have an eighty track drive.

Almost all discs are manufactured to work on an eighty track double sided drive. They are then tested to see if they are reliable. If they fail at 80 tracks but work at 40 then they are labeled up at 40 tracks. Similarly for the second side.

To confuse the issue even more the Watford Electronics DFS allows the use of 35 track drives [not the double density DDFS]. These are generally older in design and cheaper than 40 or 80 track drives. Use discettes intended for 40 track drives in these. Obviously you cannot read 40 track discs, and the double step mode will not do anything useful. The standard DFS can use 35 track drives if you can re—write the disc formatting program to format on 35 tracks.

When formatting a disc NEVER try to format more tracks than the disc drive has. [Exercise extreme caution in double—step mode]. Using
*FORM80 on a 40 track drive will force the heads too far in. This may push the drive out of alignment or jam the heads at the end of their travel, these will result in an expensive repair job. If you realize that you have used the wrong command while the disc is still formatting hit BREAK immediately.

5.8 [[[[[ SINGLE/DOUBLE DENSITY

A further complication to the disc system is the use of a double density disc controller. The standard BBC micro disc interface will

only use single density mode. By adding a special board containing a new disc controller chip it is possible to make the BBC micro use the superior double density format. The result of using double density is to allow upto 80% more data to be stored on each disc. This massive increase is achieved by using a different method of storing the individual bits of data on the disc. Another useful result of this is that reading double density discs is 80% faster than reading a single density disc, simply because the data is that much closer together.

The data is stored in 18 sectors per track instead of the normal 10. You simply choose when the disc is formatted whether it will be in single or double density. A disc formatted by the DDFS in single density is indistinguishable from one produced by a standard single density system. When purchasing discs it is important to check that the discs are designed to work in double density.

The DDFS automatically works out the density of a disc whenever you try to access it. This means that you are free to copy files between different discs of different density and generally put a disc of either density in any drive at any time. The *BACKUP command will still work correctly between discs of different density, though you cannot back a double density disc up onto a single density as there isn’t enough space.

The DDFS works out what density the disc inserted is by a trial and error method. It assumes that the density of the disc is the same as last time it accessed that particular drive. If it then gets a disc error it swaps density and tries again. This procedure is repeated until it succesfully accesses the disc. After a total of 10 attempts have been made on one sector the DFS will abort with a disc error.

The density sensing process is quite slow. This is due to a ‘feature’ of the disc controller used. For every single retry on a sector performed by the DDFS the controller insists on performing 4 attempts. This means that there can be a lengthy pause while the density is changed.]]]]]

<< Picture : A Floppy Disc >>








6.0 TEXT FILING

As was stated in section 3.10 a text file is a list of ASCII characters. Some commands have already been described to create and display the contents of disc files. These include *SPOOL, *EXEC, *TYPE and *LIST. These files can be easily manipulated from Basic with a number of special keywords and variables.

For a file to be accessed it must be OPENed with a special command. Opening a file assigns a number known as the file’s handle to the file. All accesses with the file are then sent to the correct file by giving the file handle as well.

Once a file is open it may be considered as a very long string of consecutive characters. This collection of bytes is physically arranged in sectors on the disc by the DFS. As you move through the file the DFS will automatically load and save each sector of the file as required. Thus it is not necessary to concern yourself about the storage of the file in sector units. As the information is buffered inside the computer’s memory, the buffer containing the present sector being altered, it is necessary to CLOSE a file after use. This transfers the buffered sector back to the disc.

Text files are also known as Random Access files as you can go immediately to any part of the file anywhere along its length without having to scan through the file character by character.

6.1 FILING FROM BASIC

The Basic keywords used for file manipulation are:
OPENOUT
OPENIN
PTR#
EXT#
INPUT#
PRINT#
BGET#
BPUT#
EOF#

Issue II Basic users have an extra command; OPENUP. This is for updating files. Issue I Basic’s OPENIN is exactly the same. However Issue II Basic has OPENUP as well which only allows input from the file. The Issue I OPENIN and Issue II OPENIUP allow reading and writing to a file. To tell which Basic you have press BREAK and then type REPORT (Return). 1981 is Issue I, 1982 is Issue II.

As an example of the use of these commands make yourself up a *SPOOL file of a program listing thus:
LOAD"program"
*SPOOL TEXT
LIST
*SPOOL

This gives us a text file called "TEXT".

Now type:

X=OPENIN("TEXT") (X=OPENUP("TEXT") for Issue II Basic)
(Stores the file’s handle in variable X)
PRINT X
17 (is the file handle)
REPEAT VDU BGET#X:UNTIL EOF#X

This will GET Bytes from the file one by one until the End Of the File is reached.

Now type:

PRINT PTR#X, EXT#X

This shows that the PoinTeR to your current position in the file is the same as the EXTent, or length, of the file.

Type PTR#X=O, this will move the pointer back to the beginning of the file.

Now type BPUT#X,65: BPUT#X,65:CL0SE#X

Type the file out with *TYPE TEXT, this will reveal that the first two bytes of the file have been overwritten by the ASCII character for 65, 'A'.

You can change PTR#X to any value within the length of the file and put bytes directly into the middle. It is also possible to position the pointer at the end of the file and output more bytes with BPUT, this will extend the length of the file upto a certain maximum.

The BPUT and BGET commands together with PTR# etc. can in fact be used on any sort of file to take bytes from any part of the file and/or to replace some of those bytes. It is therefore possible to modify the contents of a file without actually loading the entire contents of the file into memory.

The command OPENOUT is slightly different in that it creates a file to store information in.

X=OPENOUT("FRED") does the following:

Deletes any file called FRED that already exists.
Creates a file called FRED in the catalogue and assigns it with length 64 sectors (16k), unless there was an old file FRED in which case the length of the old file is used.
PTR#X and EXT#X are set to zero as the file does not yet contain any data.

You are now prepared to write data into this now empty file. The DFS will in fact have loaded the first sector of the file, but this is of little concern as the file is best considered as a continuous line of characters. The user can usually ignore the sectored structure.

6.2 PRINT#X, INPUT#X

These commands are used to store strings, variables etc. in text files. The data will be put into the file at the current position of PTR#X. For proper random access capability you must write your program so that PTR#X is moved to a specific place for each data item e.g.

1OA=OPENOUT( "NAMES")
2OFOR P=0 TO 30 STEP 10
3OPTR#A=P
4OREAD A$
5OPRJNT#A, A$
6ONEXT
7OCLOSE#A
8OEND
9ODATA ALFRED ,BERT, JOHN , MATTHEW

This will put the names given at intervals of 10 along the length of the file. Note the CLOSE#A on the end, this is necessary to actually cause the buffered section of the file to be sent to the disc. The data can be read back from the file similarly:

lOA=OPENIN( "NAMES" )
2OFOR P=O TO 30 STEP 10
3OPTR#A=P
4OINPUT#A ,
5OPRINT A$
6ONEXT
7OCLOSE#A
8OEND

If you now want to change one of the names then execute:

A=OPENIN("NAMES") (OPENUP for Issue II Basic)
PTR#A=20 (moves us to the position of 'JOHN')
PRINT#A, "ANDREW"
CLOSE#A

Now RUN the reading program and the file will have changed. This idea can be extended (and used from within a program) to allow databases to be handled that could not fit into the main memory of the computer because they are too large.

The single most important thing to remember to do when using the filing commands in this way is to CLOSE the file after accessing it. Failing to do this will result in loss of data as the current sector will only be updated when you move away from that sector, or you CLOSE the file. The contents of that one sector will be left as their original version if you forget.

The system of buffering the file is necessary because it is not practical to read or write the disc every time a single byte of the file is read or written. This would be incredibly slow so a complete sector is held in memory whenever a file is open. Changes within one 256 byte block will just change the contents of memory. When you move on to another sector, or you CLOSE the file, the contents of the memory are sent to the disc. This will replace the contents of the sector on the disc with the contents of the buffer.

The methods of data output discussed in the section on file handling in the User Guide will work under DFS. PTR#X is moved to the end of each piece of data as it is output so a series of PRINT# commands will result in a continuous stream of data being put into the file with no gaps. The problem is that it is extremely difficult to go straight to a part of the data stored in the middle of a file this way. It will be necessary to scan through data item by data item to find the required one. Not setting PTR# has some advantages though, it does not waste the space otherwise left in the file by moving PTR# on further, and you cannot overwrite part of the contents of the file by setting PTR# to the wrong value. The whole point of Random Access is that you must know precisely where each data item is stored in the file.

When data is written to a file with PRINT#, or when data is read with INPUT#, the data is in a specific format. The data is stored as a series of bytes. The first byte of any data item defines the type of the data.

The types are:
&00 String
&40 Integer
&FF Real number
&00 is followed by the length of the string and then the characters of the string stored last character first in the file (Basic stores strings the wrong way round).
&40 is followed by 4 bytes MSB first, LSB last.
&FF is followed by 5 bytes in exponential format.

(MSB means the most significant (largest) byte and LSB is the least significant)

Upto 5 text files can be open simultaneously. This allows you, for instance, to be SPOOLing the output from a program that is reading from two files simultaneously and writing the data out to two different files having modified it. You are very unlikely to need more than 2 files at once. Multiple files are possible because of the system of handles; each file open simultaneously will have a different handle so PRINT#handle will go to the different files.

[[[[[To discover which files you have open at any time type
*HELP FILES e.g.

*HELP FILES
# FILE PTR EXT TYP
11 :O.$.FRED 000020 000020 W0

Showing that the file FRED has handle &ll (17 decimal), PTR and EXT of &20, and is write only. The other type possibilities are R0 for read only and R/W for read write.

To close all files at any time you can type *TIDY. This is exactly the same as Basic’s CLOSE#O command. Poorly written languages may leave files open after errors etc. It can be extremely difficult to execute code equivalent to *TIDY, this command is usually easily given.

It is also recommended to put this command at the beginning of any program doing file accesses. Files can be left open when BREAK is pressed (see 9.3) which can be rather confusing.]]]]]

6.3 THE PHYSICAL STORAGE OF THE FILE

Whenever a file is used its length is limited by the space allocated to it. OPENOUT allocates 16k (64 sectors) to the file. In many situations this will be insufficient. If the file is the last file on the disc then the file can extend over more sectors. But if it is not then extension would overwrite other files so ‘Can’t extend’ is produced as an error. To make a large file OPENOUT the file and then write dummy information to it until it is as long as you require. This will ensure that all your data will fit. If you cannot predict a maximum length for the file then it will have to be arranged that the data file is the last file on the disc, so that it can write all
the way up to the end of the disc. Alternatively, huge files could be best stored on their own on the disc.

As any file can be used by the random access filing system it is possible to create large files by *SAVEing a dummy file to the length required and then using OPENIN (OPENUP) to access the file. This will keep the space reserved for the file when it was saved. E.g. *SAVE”TEXT” 0000 +8000 will create a file 32k long. For enormous files remember that you may specify a fifth digit for the file length, 31EOO is the longest a file can be on an 80 track drive (&5A000 when using double density). This also has the advantage that the load and execute addresses of the file may be set, these are not used by the random access system but may be needed if the file is to be accessed with *LOAD or is to use the auto—exec mechanism (see
7.14).

[[[[[When allocating the space for a file to be used by OPENOUT the DFS will usually use the first space on the disc, big enough to take the file, that it finds. To reduce the frequency of the ‘Can’t Extend’ error to a minimum this process has been optimised to create the file in the biggest gap on the disc. Thus OPENOUT will always use the largest gap, usually the one at the end of the disc. If you still run out of memory for a file you can be sure that *COMPACT or deleting a file will be the only cure. Also when allocating the file it is possible that no 64 sector gap exists on the disc. If this is so then the largest gap is used, with the full size of the gap allocated to the file.

For files created by OPENOUT the Watford DFSs set the load and execution addresses to &EFFFFF. This is very useful for the auto—exec mechanism (see 7.14)]]]]].

A control block is held in memory for the use of the DFS in accessing the files. Should the control block become corrupted (by the indiscriminate use of ‘?‘) ‘Bad sum’ will be produced. Followed by ‘file disconnected’ or ‘all files disconnected’ to indicate that the buffer contents have been lost as the DFS is no longer sure where they should be stored. Sensible programming will never result in either of these errors occurring. If they do appear make sure that you are not overwriting the area of memory from &E00 to &1900. If you are not then you may have a memory fault, though this is extremely unlikely. Either of these error messages indicates that the modified data in the buffer has not been written to the disc, so the file may contain incorrect data. Early versions of the standard DFS do not maintain the checksums, and so will allow a buffer full of data to be written to the disc without being sure that the correct sector is being written.

7.00 COMMANDS — a complete list

This section of the manual is intended as a reference section. A brief explanation of each command is given together with the full syntax. Examples and related commands are given where appropriate.

[[[[[To avoid command name clashes any DFS or DDFS command may be preceeded by the letter 'O' e.g. *OEORM8O, *OACCESS etc. As the DFS commands have lower priority than any other ROM they can easily be lost to other ROMs. The 0 prefix should cure any problems of this nature. This facility was added in DFS version 1.41 (DDFS 1.51.]]]]]


7.01 *ACCESS <afsp> (L)

This command is used to lock and unlock files. When a file is locked it cannot be deleted, wiped or destroyed. It also prevents overwriting and renaming. A locked file will display a ‘L’ after its name in *CAT or *JNFO. If any attempt is made to overwrite the file then ‘File locked’ is produced.

E.g.
*ACCESS FRED L — locks the file FRED
*ACCESS FRED — unlocks the file FRED

File locking should be used on important files that should not be deleted. It exists to prevent accidents and losing important work.

If the disc has a write—protect tab files cannot be locked as it is necessary to store the fact that the file is locked on the disc.

Locking is very useful when copying discs to avoid erasing the latest copies of your programs by copying in the wrong direction.

A locked file can only be altered if it is unlocked first. *BACKUP and re—formatting the disc are the only ways to destroy a locked file without unlocking it first.


7.02 *BACKUP <source drive> <dest.drive>

This is the fastest way to copy the entire contents of a disc. It blindly copies the disc sector by sector. It will overwrite the contents of the destination disc whether they are locked or not. All information is copied, including the disc title and boot options etc.

This command should be used if a complete copy of a disc is required.

It is necessary to type *ENABLE as the last * command before the
*BACKUP. This is to make it harder to accidentally destroy the wrong disc. Always *CAT the source and destination discs to make sure that you are copying the right files to the right place.

E.g.
*ENABLE
*BACKUP 0 1

It is possible to BACKUP a disc on the single drive system. Type:

*ENABLE
*BACKUP 0 0

You will be prompted for source and destination discs repeatedly __ until the entire transfer has been performed.

The contents of memory (i.e. your program) will be overwritten and destroyed by this command. Save the program on disc before use.


7.03 *BUILD <fsp>

Used to create text files directly from the keyboard. This command is extremely useful if you do not have a wordprocessor. The text filing capabilities of the system are very useful and can only be fully utilised under the control of a high level language like Basic. However *BUII4D is useful for generating short files.

The most common use is to generate the !BOOT file on the disc E.g.

*BUILD !BOOT
0001 *DRIVE 1
0002 CH.“MENU”
0003 (Escape)

Generation of the file is stopped when Escape is pressed.

Now type *OPT 4,3 and pressing Shift—BREAK will cause *DRIVE 1, CH.”MENU” to be typed in.

7.04 *CAT <drive>

Displays the catalogue stored on the disc. If a drive is specified then the catalogue for that drive is displayed, however this does not change the *DRIVE setting.

Files are displayed in alphabetical order with all files in the current directory in one block. Followed by the contents of all the other directories in a second block.

The header displays much useful information, though most of it is not actually stored on the disc. The Drive is the drive number actually being catalogued. Directory shows the current default drive and directory. Option shows the action to be taken on BREAK. Library shows the library setting. The number next to the title is a two—digit decimal count of the number of write—operations that have occurred to this disc. [Work file shows the work file name. The double density system also displays the density of the disc at the top right.]

E.g.
*CAT 0
TITLE (34)
Drive 0 Option 3 (EXEC)
Directory :2.$ Library :0.$
Work file $.COMM2

!BOOT BERT
HERBERT COMM2

A.MOTHER A.NYWAY
F.FRED L T.LETTER
G.GAME

09 files of 31 on 40 tracks double step

File F.FRED is locked, as shown by the L after the name.

The catalogue on the disc can contain either 31 [or 62] files. These limits (set at formatting time) are the maximum number of files it is possible to store in the catalogue, and hence on that side of the disc.



7.05 *COMPACT <drive>

Removes spaces on the disc left by *DELETE and similar commands. When a file is deleted from the disc the data the file contained is left on the disc. Only the reference to the data is removed from the catalogue. A new file will be put into the gap left by deleting, if it will fit, but gaps are usually left. Compacting a disc removes all the spaces by shuffling all the data back on the disc to fill up the spaces and adjusting the catalogue accordingly.

The ‘Disc full’ message may very well be in fact wrong, in that there is sufficient room on the disc to save the file. However the space may be spread all over the disc. Compacting the disc may well allow the file to be saved.

This command overwrites the contents of memory, so save your program before using it. It may be necessary to save the program on a different disc. If you don’t have any formatted discs with room on then format another.

The *COMPACT command lists the files as they are moved into position, providing all the information given by *INFO. The number of sectors that are left empty after the operation is displayed at the end. PRINT &sectors—free * 256 to find the approximate number of bytes that may be saved on the disc before filling it completely.

If no files have been deleted from the disc since its last compaction then this command will simply list the files and produce the space free value.

[[[[[The *HELP SPACE command will list all the spaces that *COMPACT will remove. This is very useful when deciding whether to *COMPACT a disc.]]]]]



7.06 *COPY <source drive> <destination drive> <afsp>


Copies files from one disc to another. E.g. *COPY 0 1 FRED will copy file FRED from drive 0 to drive 1. The filename specified can of course be ambiguous.

This command works on a single drive system. *COPY 0 0 FRED will prompt for Source and Destination discs, follow the printed instructions to transfer a file.

When copying it prints the *INFO information for the file as it is put on the destination disc. If *OPT1,1 is selected then it will also give the information for the source disc.

See also *MOVE and *BACKUP

This command works by loading the file into memory and saving it onto the other disc. Thus it will fill in spaces left in the destination disc after deleting files, if possible.

This command will overwrite the contents of memory so save your current program before using.



7.O7 *DELETE <fsp>

Deletes a single file from the disc. To delete more than one file use *WIPE or *DESTROY

When a file is deleted its reference is removed from the catalogue. The data the file contained is left on the disc, but cannot be accessed as the file name and other information has been removed. This leaves a space on the disc. If another file is saved it may be put in the gap, if it will fit. All spaces left in the disc can be removed by *COMPACT.

A file can be protected against deletion by fitting a write—protect tab to the disc. This will stop any writing to the disc at all so the catalogue cannot be re—written without the filename. The file can also be locked to stop deletion. See *ACCESS.

Note that it is extremely difficult to restore a file after it has been deleted.




7.08 *DESTROY <afsp>

This is used to delete a block of files. For single files use *DELETE. When the command is entered it produces a list of the files to be deleted and asks Delete (Y/N)? Pressing Y will delete all the files. Locked files cannot be deleted and are ignored when making up the list of files to be deleted. Use this command with extreme care — once deleted it is extremely difficult to get the files back again [see the chapter on the disc sector editor].

The destructive capabilities of this command are such that it is necessary to *ENABLE it before use.

E.g.
*ENABLE
*DESTROY FR*
$.FRED
$.FROME

Delete (Y/N)?
Deleted

Press Y to delete the files, anything else to abort.

See *WIPE for a more controlled form of this command.


7.09 *DIR (:<Drive>,)<Dir>

Changes the current directory. The *DIR value is set to $ when BREAK is pressed.

Directories are used to group files into sections. A directory may be supplied with any filename e.g. B.LETTER. The *DIR command changes the default directory i.e. the directory to which accesses will occur if no directory is specified in the file name.

E.g.

*DIR T

The directory cannot be set to any of # * • : as these have special meanings.

This command does not affect your files on the disc in any way. It only defines which group of directories you access as default.

The current directory is displayed at the top of the catalogue display.

If a drive number is specified it is used to set the *DRIVE value.



7.10 *DRIVE <drive>

Sets the default drive. This command is used to change the disc —drive that is used if no drive is specified in a file name. Use the command if you are going to make a few accesses to a different disc drive. One of the most common causes of losing files is failing to access the correct drive, setting *DRIVE will guard against accidents.

The *DRIVE value is used for the default. Commands accessing another drive will not affect the setting of *DRJVE. *CAT 2 will NOT set *DRIVE to 2. The current drive is displayed at the top of the catalogue with the current directory setting.

[The *WORK command will change the *DRIVE setting if a drive is specified.]

The default value of *DRIVE 0 is set at switch on. Versions of the Watford DFS prior to 1.42 (double density 1.52) and versions of —standard DFS prior to 1.20 will also reset to drive 0 whenever BREAK is pressed. More recent versions will preserve the drive number along with various other information over BREAK (see sec.9.3).



7.11 *DUMP <fsp>

This lists the contents of any file in Hex and ASCII. This is extremely useful for checking the contents of files. All the contents of the file are produced in the Hex part of the listing but the ASCII equivalents are only given if the character is printable,
unprintable characters are given as '.'.

This command is very useful for discovering protected parts of programs saved on disc. Using it does not affect the contents of main memory so you can find the protection and alter the appropriate bytes on a program in memory. The ‘address’ at the beginning of the line starts from 0000 and will go to 6 digits if you have a very large file.

The use of page mode is recommended on large files i.e. Ctrl—N.

*LIST and *TYPE are similar commands but will only function correctly on purely ASCII files.

*DUMP can he used with any filing system, not just disc.



7.12 [[[[[ *EDIT

This enters the disc sector editor. Use TAB to swap between fields in the top lines, and between hex and ASCII in the editing section.

Exercise extreme caution when using the editor. Take a copy of the disc with *BACKUP first. See the section on the disc sector editor.]]]]]



7.13 *ENABLE

Those filing system commands which can be used to destroy large portions of the contents of a disc must be *ENABLEd before use. This is simply to protect your data.

*ENABLE must be the last * command before any command needing it.

Commands needing *ENABLE are:

*BACKUP
*DESTROY
[*FORMnn]

If *ENABLE is not typed the ‘Not enabled’ message is produced.


7.14 *EXEC <fsp>

Executes a file. This is used to take the contents of a text file character by character and simulate typing them at the keyboard. This is useful for commands that you find yourself typing repeatedly. *EXEC may be shorter if there are several commands to be dealt with.

*EXEC can be used to type anything into the computer that could be typed normally at the keyboard. It is for instance possible to make the computer type in a program. This is done by making up a text file containing a program listing, see *SPOOL. Then *EXEC the text file into the computer to see it being typed in.

The most common use of *EXEC is when Shift—BREAK is pressed. If *OPT4,3 has been executed on the disc in drive 0 then the DFS will execute *EXEC !BOOT. The file !BOOT will then be typed as if you typed its contents at the keyboard. A !BOOT file can be made up with *BUILD, or a wordprocessor. The file may be displayed on the screen by tLIST, *TYPE or *DUMP.

[[[[[An even easier way to get a file typed in is to set its execution address to &FFFFFF. This is done automatically by OPENOUT (including *BUILD). You may then *RUN the file (or simply type *name). The DFS automatically traps the execution address &FFF’FFF as it is meaningless on the 6502. Having detected this address the DFS will automatically *EXEC the file rather than *RUNning it. Thus lists of typed commands can be entered just by typing *name.]]]]]



7.15 *FORM35 <drive>, *FORM4O *FORM8O

These three commands are used to format a blank disc. When a new disc is first used it is necessary to cover it in blank sectors, these commands do this for you.

The appropriate command should be selected for the type of disc drive that you have. You need to know the number of tracks your drive has; this will be 35,40 or 80. Type e.g.
*ENABLE
*F0R1440 3
Large (62 file) catalogue? Y

CONFIRM FORMATTING OF DRIVE 3? Y

Formatting drive 3

00 01 02 .....

Disc formatted

A list of track numbers is produced; if a track number is followed by one question mark then that track had to be repeatedly re—formatted before it would work indicating a track that could be unreliable. If two question marks are printed after any one track number then the disc is faulty as that track could not be formatted at all.

[[[[[It is in formatting the disc that either 31 or 62 files may be set for the directory. If 31 files are used then the disc will be fully usable by standard DFS, being in exactly the same format. If 62 files are selected then an extra 2 sectors are taken up by the catalogue.

Users of the double density DDFS must also select the density of the disc when it is formatted. If single density is selected then the disc is identical to one created by a normal single density system. If compatibility with a standard DFS is required then the disc should be formatted in single density with a 31 file catalogue.

The command MUST have a drive number specified for extra security. Formatting does NOT affect the contents of memory, so it is perfectly safe to format a blank disc with a program in memory. This did not apply to some very early versions of the DDFS which destroyed memory during formatting. Version 1.50 and later do not affect main memory. The Watford DFS formatter uses sophisticated skewing techniques to produce a disc that works faster than “normal”. ]]]]]

7.16[[[[[ *FX11O,drive,n

This command was used in versions of the Watford DFS prior to version 1.43 (double density 1.53). It sets or clears double step mode for a particular drive. Use 255 to enable double step and 0 to clear it e.g. (on an 80 track system)

*FX11O,0,255 sets drive 0 to be 40 track.
*FX11O,2,0 set drive 2 to be 80 track.

When copying a 40 track disc simply set the drive containing the —disc to double step mode and copy as normal.

This command has been replaced by *OPT4O and *OPT8O in later versions. This is for better Tube compatibility.]]]]]



7.17[[[[[ *FX111


This command was used in versions of the Watford DFS prior to 1.43 (double density 1.53). Used as an OSBYTE call it returns the drive number of the last *LOAD or *RUN command in the X register of the 6502.

This also works with the Basic LOAD and CHAIN.

This command has now been replaced by OSARGS &FE for better Tube compatibility.]]]]]



7.18 *FX199

Returns file handle of current SPOOL file in the X register of the 6502. This should be called through OSBYTE with A=199, X=O, 1=255 to avoid destroying the number.



7.19 *HELP (<keyword>)

*HELP is used to give the syntax of commands or utilities. The keywords which may follow the *HELP command are DFS and UTILS which list all the HELP information, [[[[[and any DFS command. E.g.

*HELP DRIVE
Syntax :
DRIVE (<drv>)

05 1.20]]]]]

More than one keyword may be specified in a list after *HELP. Try *HELP DFS UTILS to get the syntax of all the commands. Commands such as *LOAD and *SAVE are Machine Operating System commands and are not listed in *HELP as they operate outside the disc filing system. *HELP is also a MOS command, it should give help information on any sideways ROM fitted in your machine though some ROMs do not use the command.

[[[[[*HELP SPACE and *HELP FILES have special meanings.

*HELP SPACE ((drive>) lists the spaces left by deletions on the current drive. This shows the spaces that would be removed by *COMPACT. The total free space on the disc is also given.

*HELP FILES lists all the files currently open with their file handles, pointer values etc.]]]]]


7.20 *INFO <afsp>

Displays information about a file or group of files. All the information stored about each file is given. Much more information is displayed than is given by *CAT. The files are listed in the order in which they are stored in the catalogue on the disc, not in the alphabetical order in which files are displayed by *CAT.

The format of the information is:

D.NAME L SSSSSS EEEEEE LLLLLL CCC

Where D is the directory in which the file is stored, NAME is the name. L indicates a locked file. SSSSSS is the load address (start address) of the file. EEEEEE is the execution address used for *RUN. LLLLLL is the length of the file in bytes. CCC is the start sector of the file, CCC/10 gives the track on which it starts [CCC/18 for a double density disc].

Ambiguous file names can of course be used. *OPT1 can be used to cause all this information to be displayed whenever a file is accessed.



7.21 *LIB:(<drive>).<dir>

Sets the library to be a particular drive and directory.

The library is a group of files (i.e. files on the same drive in a particular directory). These files are generally utility files, that is extra commands stored on the disc. They are used by typing *NAME to execute *RIJN NAME. This then searches the current drive and directory for the file NAME. If it is not found here then the drive and directory set by *L]IB are searched for the file. When the file is found it is *RJJN

This capability is exactly equivalent to *RJJN NAME and the library system allows utilities to be on a disc or directory other than the current ones, without having to specify the drive and directory.

For the machine code programmer to write such a utility you must make up a file that can be *RUN in the normal way. Make sure that the file loads into a spare piece of memory. OSARGS A=1, Y=0, X=base of address of zero page parameter block will return the address of any text following the utility call. This is explained more fully in the assembler section.




7.22 *LIST <fsp>

Displays a text file on the screen. This works by scanning through the file character by character printing each one. Line numbers are put in at the beginning of each line, these correspond to the line numbers used by *BUILD.

This command should only be used on text files. Use on any other sort of file will result in illegal characters being printed and crashing the system.

Text files made with *BUILD, *SPOOL etc. may be used.

If the file is large pressing Ctrl—N to select paged mode may be useful. Press Escape to abort the listing at any time.

*TYPE can he used to give a display without line numbers and *DUMP will give the contents of any file safely without sending dangerous characters to the VDU.



7.23 *LOAD <afsp> <address>

This command is provided by the MOS. It loads a file from the disc and stores the file in memory. The file may either be put at the load address specified when the file was saved or at the address given after the load command.

E.g.
*LOAD FRED
*LOAD "FRED"
*LOAD ALBERT 2000
*LOAD ":2.C.JIM" 6COO

Quotation marks are optional. The full file specification may be given or the defaults will be assumed.

A very useful command is *LOAD “name” 8000. This loads the file into the DFS ROM. This does not affect the contents of memory, but will check that the file is saved correctly. This will verify quickly and easily that the file has been saved properly on the disc.

[[[[[If an ambiguous file name is given the first file matching the specification is loaded. The filenames are scanned in the order in which they are stored in the catalogue. This order is given by *INFO *.* .1]]]]

See also *RUN


7.24[[[[[ *MLOAD <afsp>

Just like *LOAD this command loads a file into memory. However it permits files to be loaded over the disc workspace area. This works by loading the file to &1200, switching off the disc system, and then moving the program to its correct load location. This allows programs to be used from tape very easily as they can be automatically moved to their correct address.

The load address of the file is stored at !&C8 and the execution address is stored at !&CC. See also *MRUN

Do NOT use either *HELP SPACE or *HELP FILES after the use of this command. The results are unpredictable.]]]]]


7.25 [[[[[*MOVE<source drive><destination drive><afsp>

This command is almost identical to *COPY. The only difference is that each file name to be copied is prompted for. Pressing Y will copy the file, pressing any other key will move onto the next file without copying.

This command is extremely useful for moving blocks of files that contain a few files that you don’t want to move.

The contents of memory may be destroyed by the use of this command so SAVE your program first.]]]]]


7.26 [[[[[ *MRUN <afsp>

Very similar to *MLOAD and *RIJN. This loads a file to &1200, switches off the disc system and then moves the file to its correct load address. The files execution address is then called. Note that the execution address used is exactly that stored with the file. No adjustment is made when the file is moved.

!&C8 contains the address to which the file was moved, !&CC contains the execution address that was used.

Do NOT use *HELP SPACE or *HELP FILES after using this command. The results are unpredictable.]]]]]


7.27 *OPT 1,(n)

This enables or disables the display of full file information. This can be used to display the full *INFO information whenever any file is accessed.

*OPT 1,1 enables messages
*OPT 1,0 disables messages (the default setting)

Note that this produces exactly the same information as *INFO.


7.28 *OPT 4,(n)

Sets the autostart option. This is used when Shift—BREAK is pressed
to boot the system. On Shift—BREAK the file !BOOT is accessed as
given by the *OPT4,3 setting of the disc. The *OPT4 number is stored
on the disc so it must not be write protected when *OPT4 is
executed. The disc must be the current *DRIVE value as a drive cannot be specified in *OPT 4.

The options:

*0PT 4,0 does not attempt to load file
*OPT 4,1 *LOAD !BOOT
*0PT 4,2 *RUN !BOOT
*OPT 4,3 *EXEC !BOOT

If any option other than 0 is set, and Shift—BREAK is pressed, the file will be searched for. If not found then ‘File not found’ is displayed. The option chosen is displayed at the head of the catalogue display.

The file will normally be searched for on drive 0 in directory $. However if a Watford DFS 1.42 or later (DDFS 1.52) is used then behaviour is slightly different. If data is retained over BREAK then !BOOT will be loaded from the current drive, directory $. See section 9.3.

The usual !BOOT file is set with *OPT 4,3 to be *EXECed, containing:
CHAIN “MENU”

The file can be created with the *BUILD command.


7.29 [[[[[ *0PT40,<drive>; *OPT8O.<drive>


Sets double step or normal mode on the given drive e.g.

*OPT40,0 sets drive 0 to be 40 track
*OPT80,2 sets drive 2 to be 80 track

These commands should only be used with 80 track drives. The default is of course to normal 80 track operation which can be restored to all drives by pressing Ctrl—BREAK.

When copying a 40 track disc simply set the drive containing the 40 track disc to double step mode. Copy onto either a 40 or 80 track disc as normal.

The current double step settings are retained over BREAK unless Shift—Lock is held down to force drive 0 to double step. See section
9.3.]]]]]


7.30 *RENAME <old afsp> <new afsp>

Changes file names from old name to new name.

E.g. *RENAME C.FRED F.GEORGE

[[[[[It is possible to rename groups of files E.g.

*RENAME FRED* BERT*
will rename FRED1,FRED2,FRED3 to BERT1,BERT2,BERT3.

When rename is used it gives the message:
oldname : renaming to newname

The ambiguous section of the filename is not altered. If the DFS does not list any names in the above format then it has not done anything. ]]]]]

If the new file name to be created exists then 'File exists' is produced and the file is not renamed.

The disc must not be write protected.


7.31 *RUN <afsp> (parameters to utility)

This command is used to *LOAD and then execute machine code programs. E.g. *RUN PROGRAM will load PROGRAM and then jump to the execution address stored for the file, as given by *INFO.

Typing *RUN NAME is equivalent to typing *NAME. See *LIB and earlier for an explanation of libraries.

*/ is an abbreviation for *RUN


7.32 *SAVE<filename> <start address> <finish address> (<execute address>) (<reload address>)

This is used to store a copy of the contents of memory from the start address to the end address. The syntax is:

*SAVE “PROG” 5555 FFFF EEEE RRRR
or
*SAVE “PROG” 5555 +LLLL EEEE RRRR

5555 is the Start address of the memory to be saved
FFFF is the finish address
EEEE execution address, can be ommitted
RRRR reload address, the value that is kept in the files information block as its load address (can be omitted but if present then an execution address must be present)
LLLL preceded by a ‘+‘ this indicates a file length rather than the finish address

If RRRR and EEEE are omitted then they are assumed to be the files start address.

‘Disc read only’ will be produced if the write protect tab is fitted.

‘Catalogue full’ is produced if an attempt is made to exceed the maximum number of files per disc, either 31 [or 62].

If the filename given already exists then the old file will be overwritten, unless the file was locked in which case ‘File locked’ is produced.

If no room can be found on the disc large enough to store the file as a single block then the message ‘Disc full’ is produced. *COMPACT may help, but save the file onto another disc first.


7.33 *SPOOL <fsp>

This opens a text file to store all screen output. Thus it will make up a text file containing all the characters printed to the screen until spooling is turned off with *SPOOL with no file name.

This is particularly useful for creating text file listings of Basic programs e.g.

LOAD"FRED”
*SPOOL FREDTXT
LIST
(the lines are listed and stored on the disc as well)
*SPOOL

The *SPOOL command can be used to put any text into a disc file that is put to the screen. Some DFS commands internally disable spooling because of clashes in memory usage that make having an open file impossible. This includes *CAT and *INFO.

The OSBYTE call with A=199,X=0,Y=255 will return the handle of the current spool file in the X register of the 6502.


7.34 [[[[[ *TIDY

Closes all files.

This command is equivalent to the Basic command CLOSE#0. Poorly written languages may leave files open which can then be very difficult to close. *TIDY is usually easy to execute from any language.]]]]]


7.35 *TITLE <disc name>

Changes the title of the disc as displayed at the top of the catalogue display.

A maximum of twelve characters may be entered; all characters are permitted including teletext control characters. Thus coloured titles may be obtained e.g.

*TITLE |!|CFRED will give a yellow FRED as the title. ‘|!’ adds 128 to the next ASCII value in the string.

To include spaces in the title you must enclose it in quotes.



7.36 *TYPE <fsp>

Displays the contents of a text file on the screen by reading it in character by character and printing each one. This is very similar to *LIST but does not display line numbers.

The use of page mode may be useful, selected with Ctrl—N.


7.37 *VERIFY (<drive>)

This scans the entire contents of the disc checking each individual sector to see if the sectors’ internal checksums match the actual contents. As each track is scanned its number is printed in hex. If one question mark is printed after a track number then that track only verified correctly after a number of tries at reading it. Two question marks after a track number indicates that the track could not he verified after 10 attempts.

This does not corrupt the contents of the disc [or of memory].

This may be present on the utilities disc for the standard DFS user.
Only one question mark will be printed, indicating complete failure.
The use of a disc based verify will corrupt memory as the verifier
has to load somewhere.


7.38 *WIPE <afsp>

Selectively removes a group of files from a disc. E.g.

*WIPE *.FRED*

will find all files that fulfill this specification such as $.FRED1 and W.FREDZZZ and will present the file names one by one. For each file you can press Y to delete the file, or any other key to move on to the next file without deletion.

No attempt is made to remove locked files. Note that this command leaves spaces in the disc like *DELETE, see *DELETE and *COMPACT. Files are extremely difficult to recover after this command has been used.


7.39 [[[[[ *WORK (:drive.) (<dir.>) NAME (I)

Sets the file name to be used if a null name is given i.e. SAVE”” is used. If a drive number is specified then this is used to set the *DRIVE value. If a directory is given this is NOT used to set the *DIR value, but the file will be put in the directory given when the SAVE occurs.

It is possible to LOAD”:1.” to load the work file from drive 1. However a directory cannot be specified in this way i.e. you cannot use LOAD":l.H." to load the work file from drive 1 directory H. The directory is an integral part of the work file name. The drive number is separate.

If ‘I’ is given after the filename e.g.

*WORK JIMMY I

Then the 6th and 7th characters of the name are treated as a decimal version number. This is automatically incremented on any save or openout operation generating e.g. JIMMY00, JIMMY01, JIMMY02 ....

If illegal digits are given then the value defaults to 00. Auto increment mode is shown in the catalogue display.

Many file accesses will require the use of ““ to allow the use of a null filename e.g. *RENAME FRED ““ will rename FRED to the work file name.]]]]]


8.0 USING THE FILING SYSTEM FROM ASSEMBLER

It is a feature of the BBC micro operating system that ALL routines that are needed within the operating system or filing system ROMs are accessed through a standard set of entry points.

The correct entry points to the system exist for your convenience, all filing system commands should be called through the operating system in the normal way. The Watford Electronics DFS is internally structured for simplicity in writing, there are NO entry points to the DFS that cannot be accessed through the normal routes. A11 the information you can possibly want about the files on a disc can be obtained through the operating system. Reading DFS workspace memory locations is unlikely to work correctly, especially reading the catalogue out of memory as this is swapped quite frequently with the second catalogue.

The correct entry points are used by a JSR to a fixed location at the top of the operating system ROM. These entries go through indirection vectors to the actual address where the command is interpreted in either the operating system or the DFS.

If the correct entry points are used then the commands will also work correctly with the Tube in operation. [The Watford DFSs are now fully Tube compatible. Versions before 1.40 (double density 1.50) did not work correctly under some circumstances.]

The routines, entry points and vector addresses are:

OSBYTE FFE4 BYTEV 020A Miscellaneous OS operations, using
registers for parameters
OSFIND FFCE FINDV 021C Open or close a file
OSARGS FFDA ARGSV 0214 Load or save data about a file
OSFILE FFDD F1NDV 0212 Load or save a complete file
OSBGET FFD& BGETV 0216 Read a single byte from a file into A
OSBPUT FFD4 BPUTV 0218 Write a single byte to a file from A
OSGBPB FFD1 GBPBV 021A Read or write a number of bytes, and disc
title, catalogue information etc.
OSWORD FFF1 WORDV 020C Miscellaneous sector operations



8.1 THE ROUTINES

Throughout this section it is assumed that you are conversant with the use of OSBYTE, OSWORD calls etc. If you are not then read the appropriate chapters in the User Guide.

A,X,Y refer to the A,X,Y registers of the 6502 processor, C,N,V,Z,D are flags in the 6502 status register.

Whenever X,Y are said to point to a control block then X is the low byte and Y is the high byte, usually presented as XY.


8.2 OSFIND FFCE

Opens a file for reading or writing or both, or closes files after access.

A=0 Closes file or files.
Y=0 on entry causes ALL files to be closed,
Y as file handle closes that file
A=&40 Open file for input only
A=&8O Open file for output only
A=&CO Open file for input and output (random access)

XY point to address of file name terminated by ‘Return’ (ASCII &0D). On exit A contains channel number (handle) for all future operations to the file. If A=0 then the file could not be opened.

On exit from the routine C,N,V and Z are undefined and D=0. Interrupt state is preserved but interrupts may be enabled during the operation.


8.3 OSARGS FFDA

Reads or writes a file's attributes. On entry X points to a zero page control block and Y contains the file handle.

If Y=file handle:
A=0 Read sequential pointer (PTR#)
A=1 Write sequential pointer
A=2 Read length (EXT#)
A=&FF Update file onto the disc to ensure no data is lost
in the buffer
IF Y=0:
A=0 Returns file system in use in A:
0 No file system
1 1200 baud cassette system
2 300 baud cassette system
3 ROM pack filing system
4 Disc filing system
5 Econet filing system
6 Teletext/Prestel Telesoftware system
7 Advanced DFS
A=1 Returns address of the rest of the command line in
the control block for use after *RUN"NAME"
[A=&EE Returns drive number of last accessed drive used by
an OSFILE call (*SAVE, *LOAD, *RUN etc)].
A=&FF Update all files onto the disc.

To read the text for Y=0, A=1, use OSWORD with A=5 (read I/O processor memory). Set Y=0, then X will point to the parameter block returned by OSARGS. Repeated calls to OSWORD will then read the parameters character by character.

[[[[[Call &FE replaces OSBYTE 111 which was used by versions of the Watford DFS prior to 1.43 (double density 1.53).]]]]]

On exit X and Y are preserved, C,N,V and Z are undefined, D=0. Interrupt state is preserved hut may have been enabled during operation.



8.4 OSFILE FFDD

Loads or saves a whole file. XY points to an 18 byte control block. A defines action to be taken

Control block:
(00 LSB....03 MSB)

00 Address of file name, terminated by &0D
01

02 Load address of file
03
04
05

06 Execution address of file
07
08
09

0A Start address of data for write,
0B length of file for read
0C
0D

0E End address of data,
0F byte after last byte to be written,
10 or file attributes
11

Functions performed on value of A:

0 Save section of memory as a file, including catalogue
information
1 Write catalogue information for named file
2 Write load address (only) for named file
3 Write execution address (only) for named file
4 Write attributes (only) for named file
5 Read named file’s catalogue information, file type in A
6 Delete named file
FF Load the named file

When loading a file the byte at XY+6 (LSB of execution address) determines where the file will he loaded in memory. If zero then the file will be loaded to the address given in the control block. If non—zero then the address stored with the file is used.

File attributes are stored in four bytes, the disc filing system
only allows the use of attributes more simply for locking files. This is equivalent to setting bits 1 and 3. The full meanings are used on more powerful filing systems such as the Net filing system. Full meanings are:

Bit Means not by
0 readable you
1 writable you
2 executable you
3 deletable you
4 readable others
5 writable others
6 executable others
7 deletable others

File names returned give:

0 nothing found
1 file found
2 directory found

On exit X and Y are preserved, C,N,V and Z are undefined, D=0. Interrupt state is preserved but may have been enabled during operation.


8.5 OSBGET FFD7 and OSBPUT FFD4

Read and write a single byte.

On entry Y must contain the file handle as given by OSFIND. X is not used and is preserved. A contains byte to be put, or receives byte to be read. The action occurs at the position set by the pointer set by OSARGS (as used by the Basic PTR#).

On exit C clear indicates a succesful transfer and C set indicates an end of file condition occurred.


8.6 OSGBPB FFD1

Read or write a group of bytes, and much other disc information.

A control block is used pointed to by XY.

For A=:
01 Put bytes using byte offset
02 Put bytes ignoring offset
03 Get bytes using offset
04 Get bytes ignoring offset

The control block structure is:
00 Channel
01 Pointer to data
05 Number of bytes to transfer
09—0D Byte offset into file if used


The other OSGBPB calls use the control block above and return their own data structures as follows, pointed to by the pointer to data. These OSGBPB calls should be entered with of fset=0, number of bytes to transfer=1.

05 Read disc title and start option:
00 &0C
01—0C Title+nulls
3D Startup bits (OPT4 setting)
0E Current drive number

06 Read current drive/directory
07 Read library drive/directory
00 01
01 ASCII disc number
02 01
03 Directory letter

08 Read filenames in current directory sequentially from offset
which should be zero initially
00 07
01—08 Filename+spaces
(The offset is automatically incremented as needed)

[09 Read work file directory and name
00 1
01 Directory
02 7
03—0A Filename]


On exit C clear indicates a succesfully completed transfer.

If C is set then the end of the file was reached before the transfer was completed. Number of bytes and byte offset are modified to show how much data was transferred.

New pointer value is the old pointer value + total amount actually transferred.

[[[[[When OSGBPB 8 is being used to read filenames setting *DIR * will result in all filenames on the current drive being returned. The data is returned in the format of OSGBPB 9. This should simplify
the task of writing menu programs. When using OSGBPB 8, Carry flag set on return indicates that all filenames have been returned.]]]]]


8.7 OSWORD FFF1

Called with A=&7F this routine offers more opportunity to wreck the contents of a disc than any other! This is used to read or write a sector of the disc, use with extreme caution. The commands given are those listed in the 8271 Data Sheet. The DFS automatically selects the correct Interrupt handling routine etc. to process the given command.

XY points to a control block:

00 Drive number
01—04 Start address in memory of source or destination of data
05 Number of parameters
06 Command
07 Parameters
. .
. .
. .

E.g.
Number of parameters =3

Command =&53 to read a sector, =&4B to write.

Parameter 1 = Track number
Parameter 2 = Sector number
Parameter 3 = &21 (specifies sector length of 256 bytes and 1 to be
acted upon)

On exit 0 in the last parameter address + 1 indicates a successful transfer. Otherwise the disc error number is returned.

Other commands which may be used with OSWORD &7F are:

5F — Verify sector
5B — Read disc sector I.D.s
63 — Format track

These commands should only be used if you are familiar with the 8271. Please refer to the data sheet.

[[[[[Perhaps one of the most important parts of the double density DDFS is its 8271 emulation. As the double density disc system uses a different disc controller a special program must be used to interpret the 8271 commands and convert them into commands for the 1770. The 8271 emulation in the Watford DDFS is, we believe, the best and most powerful ever written. The standard of emulation achieved has been gradually improving from the first versions. The
DDFS will now run almost any protected software. Almost every command of the 8271 has been implemented, though it is not technically possible to implement every last detail.

It is of course possible for a program to beat the emulation. If direct hardware accesses are made, or if the program uses some of the most obscure features of the 8271, then it will not work. Fortunately, however, the vast majority of protected software works correctly with the DDFS.

For those familiar with the 8271 the following facilities are not implemented by the emulator in the DFS:

The drive control input and output port so direct control of the drive hardware is not possible.

The mode register showing whether you are in DMA, using double/single actuator etc.

You cannot read the drive status, this will not normally be done from OSWORD &7F anyway.

Registers concerned with the scanning for a byte mode as this is normally used with DMA.

As an addition to the 8271 commands the double density system also allows the reading of double density discs. The DDFS will normally try to read the disc using the density last used and will give a disc error if this density is incorrect. To force it to use a particular density set bit 5 of the drive number (decimal 32). Then bit 4 (decimal 16) selects double density if it is set, single density if it is clear. Once a density has been chosen it will remain until changed through this mechanism. When using the DDFS through *commands etc. it automatically swaps density for you. When using OSWORD &7F it is up to you to do this if required.]]]]]



OSWORD &7E returns the number of bytes on the disc (i.e. number of tracks * 256) as a parameter block pointed to by XY.

OSWORD &7D returns packed BCD write count pointed to by XY



8.8 OSBYTE FFF4

[A=110 sets double step mode for drive in X if Y is negative (255), normal mode if Y is positive (0). This call has been replaced by
*OPT4O and *OPT8O in DFS version 1.43 (double density 1.53).]

[A=111 returns last drive used for *LOAD or *RUN in X. This call has been replaced by OSARGS &FE in DFS version 1.43 (double density 1.53).]

A=199 returns *SPOOL file handle in X.


9.0 TECHNICAL INFORMATION

9.1 18 BIT ADDRESSING

The DFS stores addresses in 18 bits, rather than the 16 bits of the 6502. Usually the extended addressing is not needed, but a maximum file length of &3FFFF is only slightly longer than one side of an eighty track disc. The load address of a file has special meaning if the top two bits are set, this indicates that the file is to be forced to load into the 'I/O' processor in a tube system. This means that the file will be loaded into the BBC micro itself rather than being sent down the tube to the second processor. If you have a tube processor then it will be necessary to alter your non tube compatible software to have the top two bits set in the load address, thus forcing it to be run on the correct computer.

[[[[[The double density system further extends the addressing system used by the normal DFS. One extra bit is used for the start sector of the file and one extra bit for the file length. This is necessary to allow one file to fill a whole double density 80 track disc, this giving a file &5A000 long.]]]]]


9.2 DISC CATALOGUE

In Watford Electronics DFS there can be either one or two catalogues on the disc. They are both in track 0 one occupying sectors 0 and 1, the other occupying 2 and 3. The two catalogues are identical in structure:

Sector 00:

00—07 First 8 bytes of the 12 byte disc title
08—OE First filename
0F Directory of first filename, top bit set if file locked
10—16 Second filename
17 Directory of second filename
.
.
.
Repeated for up to 31 files

Sector 01:

( (H) indicates High order two bits of a number that doesn’t fit one or two bytes)

00—03 Last 4 bytes of disc title
04 Count of total number of writes to disc in packed BCD
05 Number of catalogue entries * 8
06 bits 0,1 — number of sectors (H)
bits 4,5 — !BOOT start option (*OPT4 value)
07 Number of sectors on disc
08—09 First file’s load address (Low byte, High byte)
0A—0B First file’s execute address
0C—0D First file’s length in bytes
0E bits 0,1 — First file’s start sector (H)
bits 2,3 — First file’s load address (H)
bits 4,5 — First file’s length (H)
bits 6,7 — First file’s execute address (H)
0F First file’s start sector, S low bits of a 10 bit number
.
.
.
repeated for up to 31 files

Sector 02:

This will contain the first file on a 31 file disc. If this is a 62
file disc then it will contain:
00—07 8* &AA recognition bytes
08..... As for sector 00
Sector 03:

If this is a 62 file disc:

00—03 5*nulls
04.... as for sector 01

[[[[[For double density the extra two bits required are obtained from the top bits of the filename. In sectors 00 and 02 the top bit of the 5th byte in the filename is used to store the highest order hit of the file length. The top bit of the 6th byte is the high order bit of the start sector. The top bit of the 7th byte is used to show that the file is locked in the normal way. It is of course essential that filenames are not entered with the top bits set. The DFS will not permit names to be entered with the top hits set.]]]]]

[[[[[The disc is recognised as being a 62 file disc by the &AA recognition bytes in the disc title area of the second catalogue. This area would otherwise be unused.

Standard DFS will not recognise the second catalogue, and will allow it to be overwritten.

Should the first file of a 31 file disc contain 8 &AA bytes at the beginning then this will result in a catalogue being recognised. This file must be moved elsewhere on the disc. Copy it onto another disc, delete it from the original, compact, and copy the file back. This will cause the dangerous file to be in a different place on the disc. This is extremely unlikely to occur and cannot happen if you use the double catalogue system anyway.]]]]]

It should he clear that each catalogue sector contains the data about 31 files. The first S bytes of each sector containing miscellaneous information, and the rest of the sector containing data on each file in 8 byte blocks. With sectors 0 and 2 containing file names and sectors 1 and 3 containing load addresses etc.

9.3 FILING SYSTEM INITIALISATION

When BREAK is pressed the operating system scans through the sideways ROM sockets calling each ROM in turn from the rightmost socket inwards. The ROMs can grab workspace memory at this point. It is here that OSHWM (PAGE) is set.

The sideways ROMs are then offered the opportunity to switch themselves on. If a character is held down on the keyboard at BREAK then that character is passed to the ROMs and if the ROM does not recognise the character it does not switch itself on. If no sideways ROM recognises the character then the cassette filing system is
brought into use. Despite the fact that the other filing systems are not switched on, they will still have all the required memory reserved for their use. This is to allow for the possibility of their being switched on by a * command.

Thus pressing any key other than ‘W’ (‘D’ in standard DFS) whilst pressing BREAK will result in the CFS being selected, but PAGE will still be at &1900.

If Shift is pressed with BREAK then the selected filing system will attempt to find a file called !BOOT and will act on it accordingly. The cassette filing system does not do this, so the ROM cartridge system is called on Shift—BREAK if no other filing system is fitted. If LINK 5 is made then pressing BREAK will attempt to access !BOOT and pressing Shift—BREAK will not. [If Shift—lock BREAK is pressed this will boot up the system with drive 0 in double step mode. This allows the use of commercial games discs with 80 track drives as this software will usually be supplied on 40 track discs.]

[[[[[For those using the DNFS together with a Watford DFS or DDFS there is a special feature of the Watford DFSs that eliminates the DNFS. This stills permits the use of the DNFS to drive the Tube and the NFS (if fitted) but means that the DFS aspect of the DNFS does not function. The result of this is that PAGE stays at its normal value of &1900. If the second DFS were active it would go to &1B00. This is achieved automatically by the DDFS as the DNFS does not recognise the DDFS hardware. The DFS has a special routine to search for and disable the DNFS.]]]]]

Some versions of both the Watford DFS and the Standard DFS feature the retention of information over BREAK. The result of this is that information like the current drive number, open files etc. are retained when BREAK is pressed. This happens with DNFS 1.20, Watford DFS 1.42 and later and Watford DDFS 1.52 and later. DNFS 1.20 does not implement the full facilities correctly as it tends to retain the data even when its workspace is corrupted.

The information retained is:

The workfile name i.e. *WORK setting
The current drive and directory (*DRIVE and *DIR)
The current library (*LIB)
The current *OPT1 settings
The current double step settings (*FX110 or *OPT40, *OPT80)
Any open files remain open
Current density settings (double density only)

The Watford DFSs perform checks to ensure that the workspace has not been corrupted when regenerating its state. If workspace is corrupt or if Ctrl—BREAK is pressed then these are set to their default
values.

9.4 LINKS

On the front edge of the keyboard a DIP switch is fitted to set up various parameters for the disc system. This switch is not fitted in a cassette machine, though some of its functions still apply. The switches are numbered from 1 to 8 from left to right; their functions are:

1 unused
2 unused
3 access time setting
4 access time setting
5 swap shift action at BREAK
6 High bit of graphics mode at BREAK
7 Middle bit
S Low bit

Bits 6,7,8 are inverted, i.e. leaving a switch unmade sets the bit for the mode.
Bits 3 and 4 are set to define the type of drive you are using. These set the delays left for various actions to occur. All drives will work with both links unmade, but for maximum access speed set the links as necessary. Do NOT set your drives to run faster than they are supposed to, this may damage the drives. Follow the instructions with your drives on this point.

Bits Step rate Settle time Head load
3 4

1 1 2 8 0
1 0 3 8 0
0 1 3 25 4
0 0 12 10 S

Times are given in fiftieths of a second. A ‘1’ indicates a made link.



10 [[[[[ USING THE DISC SECTOR EDITOR

The point of a disc sector editor is to allow the sectors of the disc to he modified directly. This allows corrupted programs to be repaired without actually loading the program into memory.

Typing *EDIT enters the editor. To leave the editor press BREAK. Earlier versions of the DFS (and DDFS) require Ctrl—BREAK or *BASIC to exit the editor as *EDIT was executed as a language in these.

The cursor is put next to the message ‘OS command’, here you may type any operating system command such as CAT to look at the disc or whatever. Pressing the TAB key will move the cursor down to the sector and track number settings. This key moves you between the various sections in the top lines. The Return key is used to read in the selected sector. Pressing '\' <Return> to the OS command prompt will read in the next sequential sector. If a file name is given the first sector of that file is read in. All the sector numbers on this line are interdependant.

Having read a sector of a disc the cursor will be on the Hexadecimal portion of the display. Each line contains the contents of 16 bytes of the sector, in Hexadecimal and in ASCII representation. Use the cursor keys and overtype to change any byte. At any time you may press the TAB key to switch between the ASCII section and the Hexadecimal section, this will move only representation, you will in fact be editing the same byte after the swap. Experiment with the editor on an unimportant disc (though it should have some files on it).

Editing the screen display does not directly affect the contents of the disc. Pressing the COPY key will transfer the display back to the sector on the disc itself, to return to the OS command prompt simply press Escape. Pressing Escape without pressing COPY will abort the edit without affecting the contents of the disc.

It is worthwhile experimenting with simply reading and playing around with files. Try reading different tracks and sectors. Do not however write the sectors hack, as you will almost certainly corrupt the disc.

If you are actually going to write to the sectors, which is what the editor is for, you must exercise extreme caution. It is recommended to take a backup copy of the disc before changing it in this way (with *BACKUP as this produces an exact copy).

The first four sectors contain either one or two catalogues, study their contents with the aid of the technical section if you must change these. As an example try renaming some files. Load sector 00, track 00 of an u7limportant disc. Now TAB into the ASCII section and
move the cursor onto a filename (these should be fairly obvious). Type some new ASCII text over the filename, being careful not to overwrite any other information. Press COPY to transfer the sector and Escape to return to the prompt. Now CAT will show that the
filename has indeed been altered on the disc.

To alter a part of a program while it is still on the disc is fairly easy. Simply enter the filename in the track/sector line and press Return. This will move you to the start sector of the file. The biggest problem is recognising which bytes you wish to change. It will be necessary to scan through the following sectors until you find the one required. Simply press '\' <Return> to the OS command prompt. Having found the correct place overtype the correction and press COPY. Examination of the file will now reveal that the alteration has occurred. If it hasn’t then you have altered the wrong sector.

A very common need for disc sector editing is to patch back a deleted program. This procedure is very chancy. If you delete a file you did not intend to delete then immediately *BACKUP the disc onto another disc and only then try to repair the damage. This is so that even should you fail you will still have the data on the other disc
(do use *BACKUP not *COPY).

To re—instate a deleted file firstly save a new empty file:

*SAVE "FRED" 2000 +0000

This gives a catalogue entry to work on. Now the pointer to the start sector must be set. Find the new file name in the catalogue in either sector 00 or sector 02. Now note the address in the sector and go to the same address in sector 01 (or sector 03 as appropriate). This area must now be changed to point to the old file.

The next major problem is: do you know where the file starts on the disc? If you don’t you will have to scan through the entire disc looking for the file. If you manage to recognise it then all is well, simply note the absolute sector number. If you are (very) well organised then you will keep accurate records of where each file is on every disc you possess. Most of us don’t. This information is the last 3 digits of the *INFO display.

Having found the start sector number insert this into the catalogue entry. The low byte of the start sector is stored as the seventh byte from the beginning of the 8 byte block. Put the high two bits in the 6th byte.

The only problem now is the length of the file. You only need to have an approximate idea of the length. If necessary count sectors
from the start until the start of the next recognisable file. Now insert the length into the 4th and 5th bytes.

This will give a file that can be accessed with *LOAD, use *LOAD 1900 and then *SAVE the entire file onto another disc just to make sure. Now you can sort out whether you have in fact got the correct file length; simply adjust it until the file is correct, if necessary.

Having recovered the file you must *SAVE the file onto another disc; then *DELETE the file that you have recovered. If this is not done then the catalogue will he out of order. The results of this are catastrophic, files will be overwritten and *COMPACT may destroy most of the contents of the disc.

None of this file recovery method will work if you save any file with contents onto the disc after the deletion, as the new file will probably be put in the gap.

If you have saved an empty file over an already existing one then simply alter the length up to the original value and all the contents will re—appear.]]]]]


11 ERROR MESSAGES

Error messages are listed in order of error number (given in Hex). The circumstance in which they occur is given.


BD Not enabled
Command is used that needs *ENABLE, e.g. [*FORM40 or] *BACKUP

BE Catalogue full
Catalogue space of either 31 [or 62] files has been used up

BF Can’t extend
An attempt is made to increase the length of a random access file

CO Too many open files
The random access filing system allows a maximum of five files to be open at any one time

Cl File read only
Attempt to write to a file opened with OSFIND with A=&40, OPENIN on Issue II Basic

C2 File open
Attempt to re—open an open file, or attempt made to delete an open file

C3 File locked
Alteration to a locked file

C4 File exists
RENAME attempted to name a file with a name that already exists

C5 Drive fault NN at TT/SS
Disc drive faults are listed at the end

C6 Disc full
No gap large enough on the disc for the file to be created, may be cured by *COMPACT

C7 Disc fault NN at TT/SS
Damaged, faulty or unformatted disc. TT/SS gives the track/sector of the error, NN is the error number listed at the end of the section

C8 Disc changed
Disc swapped whilst files on it are open

C9 Disc read only
Attempt to write to a disc with a write—protect tab fitted
CA Bad sum
Checksum for random access file indicates that the control block has been corrupted in memory

CB Bad option
Only *OPT1 and *OPT4 exist

CC Bad filename
Invalid filename, longer than 7 characters for instance

CD Bad drive
Only legal drive numbers are 0 1 2 3

CE Bad directory
Illegal directory character, or more than one character supplied

CF Bad attribute
Anything other than 'L' or '1' is illegal

[D0 Ambiguous filename
Ambiguous filename used where they are not legal]

[Dl Illegal character
Control characters are not allowed in filenames]

D6 File not found
File given was not found in the catalogue of the drive/directory given

FE Bad command
*command not recognised and could not be found on default drive/directory or library drive/directory


Drive fault and disc fault numbers:

8 Clock error
A Late DMA
C ID CRC error
E Data CRC error
10 Drive not ready
12 Write protect
14 Track 0 not found
16 Write fault
18 Sector not found


Some of these errors will never be produced by disc or drive fault as they are trapped and given as different error messages.


12 COMMAND SUMMARY


ACCESS Locks or unlocks a file
BACKUP Copies entire disc
BUILD Makes up text file from keyboard
CAT Displays disc catalogue
COMPACT Removes spaces from disc after deletions
COPY Copies specified files from one disc to another
DELETE Removes a single file from the catalogue
DESTROY Removes many files from disc with a single Y/N at the end
DIR Select current directory
DISC Alternative spelling for DISK
DISK Alternative spelling for DISC
DRIVE Select current drive
DUMP Produce Hex and ASCII listing of any file
ENABLE Needed before *BACKUP, *DESTROY, [*FORM]
EXEC Types in the contents of a file
[FORM35 Formats a disc in a 35 track drive]
[FORM40 Formats to 40 tracks]
[FORM80 Formats to 80 tracks]
HELP Gives syntax for commands
INFO Displays full information on specified files
LIB Select drive/directory for library
LIST Displays text file on the screen with line numbers
LOAD Reads a file from disc into memory
[MLOAD Loads a file and then moves it]
[MOVE Selective transfer of files between discs]
[MRUN Loads a file, moves it then executes]
OPT 1 Switches INFO information on or off for all future disc
access
OPT 4 Set option for !BOOT file
[OPT40 Set double step mode]
[OPT80 Clear double step mode]
RENAME Changes filenames
RUN Loads a file and then executes it
SAVE Stores an area of memory on the disc
TITLE Sets the title of the current disc
[TIDY Close all files]
TYPE Displays a text file on the screen without line numbers
[VERIFY Checks legibility of all sectors of a disc]
WIPE Selective deletion of a group of files
[WORK Sets default file name]


13 INDEX

18 bit addressing 4.09, 9.1
31/62 files 4.01, 9.2
35/40/80 tracks 5.7
\ 10

*ACCESS 3.08, 7.01
afsp 3.06, 4.06
ambiguous file name 3.06, 4.06
assembler 8.0
auto—exec 7.14
autoincrement 7.39
autostart 3.11

backing up 3.09, 5.3
*BACKUP 3.09, 7.02
BGET# 6.1
BPUT# 6.1
buffer 3.10, 6.0, 6.2
*BUILD 3.10, 7.03

*CAT 2.4, 7.04
catalogue 1.1, 2.4, 7.04
catalogue format 7.04, 9.2
CHAIN 3.01
changing filing system 4.15
CLOSE# 6.1, 6.2
closed 3.10, 6.0, 6.2
commands 7.00
command summary 12
*COMPACT 7.05
connecting the drives 2.0
*COPY 7.06
copying 2.2, 3.09, 7.02, 7.06, 7.25
copying the utilities disc 2.2

data retention 9.3
*DELETE 2.4, 3.07, 7.07
deleting files 3.07
*DESTROY 3.07, 7.08
DFS 1.1
directories 3.04
*DIR 3.04, 7.09
discs 1.1, 5
disc drive 1.1, 2.0
disc drive heads 1.1
disc errors 11
disc filing system 1.1
disc handling 2.3, 5.1
double catalogue 4.01, 9.2
double density 1.1, 2.0, 5.8, 7.15, 8.7, 9.1, 9.2
double step 4.04, 7.16, 7.29
*DRIVE 2.4, 7.10
drive numbers 2.4, 3.03
drive selection 3.03
*DUMP 3.10, 7.11

*EDIT 7.12, 10
*ENABLE 4.02, 7.13
EOF# 6.1
erasure prevention 3.08, 5.2, 7.01
error messages 11
*EXEC 3.10, 7.14
EXT# 6.1

file handle 6.0
file locking 3.08, 7.01
file specification 3.04
file system initialising 9.3
filename 1.1
files 1.1
filing from Basic 6.0
fitting a disc system 2.0
formatting 2.1, 4.03, 5.5, 7.15
*FORMnn 2.1, 4.03, 7.15
free space 3.12, 6.2, 7.19
*FX110 4.04, 7.16
*FX111 4.05, 7.17
*FX199 7.18

getting going 2.0

*HELP 3.12, 7.19
*HELP FILES 3.12, 6.2, 7.19
*HELP SPACE 3.12, 7.05, 7.19

*INFO 4.09, 7.20
INPUT# 6.2
inserting a disc 2.0

*LIB 4.11, 7.21
library 4.11, 7.21
links 9.4
*LIST 3.10, 7.22
*LOAD 3.02, 7.23
LOAD 3.01
locked 3.08, 7.01

*MLOAD 4.07, 7.24
*MOVE 4.13, 7.25
*MRUN 4.07, 7.26
multi—file operations 3.06, 4.06

open 3.10, 6.0
OPENIN 6.1
OPENOUT 6.2
OPENUP 6.1
*OPT1 4.10, 7.27
*OPT4 3.11, 7.28
*OPT40 7.29
*OPT80 7.29
other filing systems 4.15
OSARGS 8.3
OSBGET 8.5
OSBPUT 8.5
OSBYTE 8.8
OSFILE 8.4
OSFIND 8.2
OSGBPB 8.6
OSWORD 8.7

storage of the text file 6.3
PRINT# 6.2
PTR# 6.1

random access 1.1, 6.0
reading 40 track discs 4.04, 7.16, 7.29
recovering files 10
re—load address 4.07, 7.32
*RENAME 3.14, 4.12, 7.30
*RUN 3.02, 4.11, 7.31

SAVE 3.01
*SAVE 3.02, 7.32
sectors 1.1, 5.4
sector editor 10
Shift—BREAK 3.11, 9.3
single drive copying 2.2
spare memory 4.08
*SPOOL 3.10, 7.33

text files 3.10, 6.0
*TITLE 3.13, 7.35
*TIDY 6.2, 7.34
tracks 1.1, 5.7
Tube 8.0
*TYPE 3.10, 4.14, 7.37

utilities disc 2.2, 4.14, 7.37
*VERIFY 4.14, 7.37

wildcards 3.06, 4.06
*WIPE 3.07, 7.38
*WORK 3.05, 7.39
work filename 3.05, 7.39
write—protection 5.2