Before using the NEW command to format the diskette and initialize the disk
drive, enter the command:
PRINT#15,"commandstring"
where 15 is the logical file number of a file which has been opened to the disk
command channel (primary address 8, secondary address 15).
The format for NEW is:
"NEWdr:fn,xx"
or
"Ndr:fn,xx"
Where: dr = the drive number, 0
fn = the file name you wish to assign to the disk. It may be up to 16
characters long.
xx = a unique two-character, alphanumeric identifier supplied by the
user.
The NEW command (with ID specified) is used on an unformatted diskette or
one which the user wishes to reformat. NEW creates the block headers, writing
the sync characters, disk ID, and track and sector numbers at the beginning of
each block. The directory header and the BAM are created and the diskette is
made ready to accept data. The command may be used on an already formatted
diskette (with no ID specified) to clear the disk directory and reinitialize the
BAM, deallocating all blocks on the diskette. The time involved in reformatting
without an ID is much less than formatting with an ID.
Example 1: OPEN15,8,15
PRINT#15;"N0:TEST DISK,88"
These commands will open the command and error channel to the disk drive and
format a disk, giving it a disk identifier of 88.
Here's an example of reformatting a diskette using the NEW command and no
disk ID.
Example 2: OPEN1,8,15
PRINT#1,"N0:NEWNAME"
The diskette will be assigned the name "NEWNAME" and the directory and
BAM will be cleared. This procedure will work only if the diskette has been
formatted.
The NEW disk command SHOULD NOT be confused with the NEW command
in BASIC. The latter will delete the program currently in memory and clear all
variables before entering a new program.
19