[Coco] a not very important drivewire question

Robert Gault robert.gault at att.net
Wed Jul 16 22:46:18 EDT 2014


Robert Hermanek wrote:
> I just noticed today my drivewire HDBDOS will not accept command DRIVE #255,
> gives me an FC error.  0 - 254 are fine.  I guess I figured any byte value would
> work.  Any explanation why 255 not allowed?
>

That appears to be an error in the source code for HDBDOS in toolshed.

The file hdbdos.asm defines MAXDN for Drivewire as 255. That would make sense if 
the test further down in the program was based on the highest value for a drive 
rather than the maximum number of drives.
With a highest value of 255, that is a total of 256 drives.

* Select Device ID number
DNUM           jsr       <$9F                Parse over "#"
DSET05         jsr       LB70B               Evaluate argument
                cmpb      #MAXDN-1            Legal?
                bhi       FCERR               No, ?FC ERROR

Given the test, the DW MAXDN should be 265. Then you would be able to enter
DRIVE#255
without error.

Now why are several people saying that it works for them? Probably because they 
are confusing the command DRIVE#n with DRIVEn. One selects a bus number (an 
actual physical drive) the other selects a Disk Basic "disk" on a hard drive.

I strongly suggest that

                IFDEF     DW
Vi.PkSz        equ       0
V.SCF          equ       0
                use       dwdefs.d

RBLK           equ       OP_READEX           Read Block
RRBLK          equ       OP_REREADEX         ReRead Block
WBLK           equ       OP_WRITE            Write Block


Carry          equ       1
IntMasks       equ       $50
E$CRC          equ       243
E$NotRdy       equ       246
PIA1Base       equ       $FF20
DATAADDR       equ       PIA1Base
TDELAY         equ       8                   Retries in the case of DriveWire
MAXDN          equ       255                 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                ENDC

the value of MAXDN for DW be changed to 256.

Robert



More information about the Coco mailing list