Re: Cursory analyses of CBM readdir bug (was: [cc65] Re: readdir bug)

From: Greg King <greg.king51verizon.net>
Date: 2013-01-11 06:33:13
From: silverdr; on Thursday, January 10, 2013; at 9:20 PM -0500
>
> On 2013-01-10, at 21:42, Spiro Trikaliotis wrote:
>>
>> The "problem" is how the C64 opens the file:
>> [....]
>>
>> Thus, the only way to find out if the OPEN was successfull is to read
>> the error channel; or (much easier): read the first data byte. If the
>> OPEN
>> was not successfull, READST will return 0x42 (0x40 = EOF,
>> 0x02 = reading timeout).
>
> Is this reliable? I mean -- is the bit 1 (reading timeout) set also on
> 33, 62 (ENOENT), 63 (EEXIST), 64, 70, etc.? Or, only on "device not
> present"?

A missing device sets bit 7 in the STATUS variable.  Bit 0 (writing
timeout) or bit 1 (reading timeout) is set when the DOS doesn't acknowledge
an attempt to push data into a file, or an attempt to pull data from a
file.  The drive unit is "silent" when there is _any_ error on that file. 
The
Kernal can't know what that error is -- which is why the CBM library must
use a status file.  The library must learn what number to put into 
_oserror.

P.S., The Kernal's LOAD function checks the reading-timeout bit in order to
know when a file is not found.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Jan 11 08:01:51 2013

This archive was generated by hypermail 2.1.8 : 2013-01-11 08:01:55 CET