Commodore 2001-8 User Manual page 74

Table of Contents

Advertisement

uncoverable read error occurred, the operating system automatically prints ?LOAD ERROR and stops
the load program.
If the program load was from direct mode, the clear function is performed at the end of the load, thereby
initializing all variables.
If the LOAD is called from a program, then the PET treats this LOAD as an overlay. The new program is
loaded into the space used by the previous program, but the values of all of the variables are maintained
from the previous program. This allows for one program to call another and pass parameters to the called
programs.
The only restriction on this is that all the called programs must fit in the same, or less space as the first program.
Because BASIC totally replaces the current program, it is not directly possible to have a single main
program and several subroutine overlays, however, by including the main program with each overlay, the
same effect is obtained with some loss of speed.
The combination of the use of named files and overlays allows the writing of very large structured
programs of appreciable complexity.
VERIFY
This very instruction is a special case of LOAD. It should be used after every program SAVE.
The command causes BASIC to go through all the steps of a program LOAD, with the exception that the
data does not get loaded into memory, but, instead, gets compared with memory. If either first or second
pass errors occur, the PET will type out ?VERIFY ERROR which means that the program should be saved
again before it is lost. On VERIFY, the status word has the following meanings
Code
Meaning
4
Short block
8
Long block
16
Checksum error on tape
32
Checksum ERROR on tape
SAVE
SAVE also performs an automatic open and close. The SAVE is specified by the statement:
SAVE name, device number
11 the physical device is one of the two tape units, the operating system automatically initiates a tape
header and opens a tape file with the appropriate name. The file header is written with the beginning and
ending address.
If the device is an IEEE-48B device, a special open message is sent indicating that the PET is sending a
program file.
The program is then written directly from its memory locations to the tape or the IEEE-4B8 bus.
If the SAVE is on tape, a checksum is computed and also saved and then the whole program is written
again to give the redundant recording. At the end of the program, the tape is automatically stopped and
positioned for the next data.
IEEE·488 SPECIAL FEATURES
In the tape, the program beginning and ending address are stored in and retrieved from the tape file header.
In order to more efficiently use the IEEE·48B data, the starting address of the program is sent as the first
two bytes of data on a SAVE and retrieved from those positions on a LOAD.
71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents