Commodore 2001-8 User Manual page 71

Table of Contents

Advertisement

single tone is written between blocks. This signal is used to syncronize both position and speed of the
tape. Varying lengths of tone are used at the beginning and between the data blocks of the tape. By
writing about ten seconds of the tone on each opening of a file, the PET automatically corrects for normal
leader. Individual tape blocks are separated by shorter tone durations.
FILE HEADERS
An important assumption underlying the tape system design was that the user would often want to
record more than one file of data on a tape. In order to facilitate this and to allow for proper label
checking, the first physical data recorded on tape for any operation is a file header. This file header looks
exactly the same as the normal data block, except that the first character of every block on tape contains
an identification character which enables the operating system to differentiate between program blocks,
data blocks, file headers and end of tape headers.
The PET allows for up to 128 characters of a file name to be stored in the file header. This is the name
which is searched for and matched on in the various OPEN/CLOSE options.
TAPE BUFFERS
Another basic premise in the design of the tape operating system was that the user would want to write
tape independently of what is occurring on tape at a given moment. This is accomplished in the operating
system by permanentlY assigning a block of memory as a data buffer for each cassette. A 192 character
buffer is located at decimal address 634 for cassette #1, followed by a 192 character buffer at decimal
address 826 for cassette #2. The tape file header is written into the buffer first and then written on tape.
Data files are accumulated in the tape buffer until 192 characters are exceeded, then the contents are
either written on tape for write, or if the program is reading tape, the next block of data is read into the
buffer. Tape file headers and all data blocks are, therefore, 192 characters long.
Tape buffers are not used in the case of program files, since these are written onto the tape directly from
the memory in which the program resides. In order to accomodate the variable memory location, the file
header for a program file contains the beginning and ending address for the program. The full program is
written onto tape in the usual form of two consecutive redundant blocks.
MULTIPLE FILES
In order to have multiple files on tape, the user needs the ability to add files to a tape and also know when
a tape is at its end, It is, therefore, important that the operating system give an "end of file" and "end of
tape" indication.
In the case of data files, an "end of file" marker is appended after the last data character. This is available
to the user in a status word on reading;the "end of file" marker is automatically inserted when a write file
is closed.
In the case of program files, because all data is always contained in a single block, the end of the block
signifies the end of the program.
To signify that the end of the tape has been reached, a special separate file header is written. When this
is encountered during a search for files, the PET automatically stops the tape and indicates "file not
found" to the user. A typical multiple file tape could contain first a data file, then a program file, followed
by an "end of tape" header as illustrated in the example of figure 7.14.
68

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents