Re: [cc65] fwrite disk full detection

From: <>
Date: 2012-04-22 21:54:21
On 2012-04-22, at 20:19, Ullrich von Bassewitz wrote:

> On Sun, Apr 22, 2012 at 12:52:51AM +0200, Johan Kotlinski wrote:
>> I was a bit surprised now that fwrite does not detect disk full. I.e.,
>> FILE* f = fopen("test", "w");
>> while(1 == fwrite(0xc000, 100, 1, f));
>> ...will create an infinite loop. Is that a bug, or supposed to work
>> like that due to hardware limitations?
> It is probably a bug.
> Does anybody know how the disks on the serial bus flag a "disk full"
> condition? Or other errors? fwrite uses write which in turn uses BSOUT. Errors
> are checked by looking at the carry flag on return from BSOUT. This might be
> wrong

Out of my head - I recall that I needed to verify ST value on disk IO using CHROUT. I can't tell exactly why it was necessary (I don't remember anymore) but odds are good that exactly because otherwise errors like disk full could go unnoticed / unhandled.

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Apr 22 21:54:36 2012

This archive was generated by hypermail 2.1.8 : 2012-04-22 21:54:39 CEST