Commodore 2001-8 User Manual page 82

Table of Contents

Advertisement

turn on printer
read from floppy
printed listing, instead of a video screen listing. However, since neither the CMD nor LIST command
terminate bus operation for the device, a PRINT# is required to terminate a CMD command.
Examples of a CMD Command
To list:
OPEN 3,4
where 4 is the printer device number
CMD3
LIST
wilt list just the Same as the screen, except on the printer.
to print and write a disc at the same time:
*CMD 3
where logical file 3 is open to the printer.
PRINT#15,A,B,C
where 15 is the floppy disc logical file number
(previously opened).
will result in A,B, and C being stored on the floppy but also being displayed on the printer.
To monitor an input device:
**CMD 3
INPUT#15,A,B,C
This will result in the data from the floppy being transferred to A, 8 and C but also being printed as they
are being transferred.
CLOSING FILES
Any logical files which have been opened during a program should preferably be closed when no longer
required, and in the case of tape or disc files, must be closed before the program ends. The following
should be kept in mind:
a) If the total number of logical files currently exceeds' ten, then loss of
PET operation will result.
b)
If
a logical file assigned to a tape unit is not closed, no "end of file"
mark will be recorded at the end of the physical tape file. If this tape is then
loaded into memory, the PET will have no way of knowing the file has
ended, and if the unwanted and erroneous data is present from a
previous recording, it will also be read into memory.
EXAMPLE OF A CLOSE STATEMENT
To close any file, the following simple statement is sufficient:
CLOSE logical file
If it is required to close logical file number 5, then this becomes:
CLOSE 5
TAPE FILE CLOSURE
It a file had been opened on the tape, there are two operations that occur: an "end of file" marker is
recorded in the next data character, then the tape buffer is forced out onto the cassette.
If during OPEN the "end of tape" option was chosen, an "end of tape file" header block is also
forced out on the cassette.
"Must be given each time because PR1NT# unlislens the bus.
"Need not be given each time, more code can be included between instructions.
79

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents