Initialization - Commodore vic-1540 User Manual

Table of Contents

Advertisement

in BASIC. The latter will delete the program currently in memory and clear all
variables before entering a new program.
INITIALIZATION
Whenever a diskette is inserted into the drive, for any reason, it MUST be
initialized to ensure that the information on the BAM (in the disk memory) is
the proper information for the diskette currently in the drive. Failure to proper
ly initialize a diskette each time it is inserted or reinserted into the drive will
result in a DISK ID MISMATCH ERROR and/or loss of data.
The VIC-1540 utilizes a DOS 2.6 software routine each time the disk is ad-
dresed to determine if initialization is required. If a different ID is detected, the
VIC-1540 will automatically initialize the new disk. Operator initialization is
not required if unique IDs are assigned each diskette.
The format of INITIALIZE command is:
PRINT#15, "INITIALIZEdr"
Where: dr=drive number 0
(0 may be ommitted).
Note: You may abbreviate INITIALIZE to I.
Example 1: OPEN 15, 8,15
PRINT#15,"I0"
Example 2: OPEN 15, 8,15,"I"
(You may omit the closing double quotation)
NOTE: FILE OPEN ERROR could occur if a previously opened file was ad
dressed with a second OPEN command. When this error appears such logical
file must be properly closed by typing CLOSE lfn.
The diskette in the drive is now initialized. Do not confuse formatting and
initialization. Remember that formatting is usually a one-time operation and
that re-formatting a disk will destroy previously stored data.
Since the VIC-1540 initialization function depends upon a change of ID to
detect a change of diskette, inserting a diskette with an ID identical to one
previously used may lead to a loss of data. This happens because the computer
will reference the BAM left over from the previous diskette. Since the IDs are
19

Advertisement

Table of Contents
loading

Table of Contents