Duplicate; Reading The Error Channel - Commodore 1541 User Manual

Disk drive
Hide thumbs Also See for 1541:
Table of Contents

Advertisement

There is a danger in using this command. When using random files (see chapter 6),
blocks allocated will be de-allocated by this command. Therefore, this command
should never be used with a diskette that uses random files.
FORMAT FOR VALIDATE COMMAND:
PRINT#15, "VALIDATE"
or abbreviated as
PRINT# 15, "V"
DUPLICATE
This command is a hangover from the operating systems that were contained on
the dual drives like the 4040. It was used to copy entire diskettes from one drive to
another, but has no function on a single disk drive.
READING THE ERROR CHANNEL
Without the DOS Support Program, there is no way to read the disk error channel
without a program, since you need to use the INPUT# command which won't work
outside a program. Here is a simple BASIC routine to read the error channel:
10 OPEN 15, 8, 15
20 INPUT# 15, AS, B$, C$, D$
30 PRINT A$, B$, C$, D$
Whenever you perform an INPUT# operation from the command channel, you
read up to 4 variables that describe the error condition. The first, third, and fourth
variables come in as numbers, and can be INPUT into numeric variables if you like.
The first variable describes the error#$, where 0 is no error. The second variable is the
error description. The third variable is the track number on which the error occurred,
and the fourth and final is the block number inside that track. (A block is also known
as a sector)
Errors on track 18 have to do with the BAM and directory. For example, a READ
ERROR on track 18 block 0 may indicate that the disk was never formatted.
18

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents