Aw: Re: CBM DOS bug?

From: André Fachat <>
Date: Fri, 1 Aug 2014 12:06:57 +0200
Message-ID: <trinity-7df510b2-107a-46a3-897f-93c8ca3b9c23-1406887617080@3capp-gmx-bs44>
Hi Greg,

thanks for point that out 

> Reread this old message:

> Your new symptom is an opposite of the old one; but, they probably are
> related. I suspect that getting the directory throws away the BAM
> that's in drive RAM. Therefore, the test program's changes might be
> lost every time it does a "directory".

> The fix might be to open "#", "b-a" or "b-f", then close the file before
> doing "directory".

Because of the discussion in the other post I switched from using the 2031 emulation to the 4040 emulation as "master".

But I have also written another test program that does exactly this - open a "#" file, do the B-A and B-F, close the "#" file and only then do the
directory. The directory in the PET in fact shows 661 blocks free as expected!
However, when looking at the disk image later with c1541 (or a hex dump), it shows 664 blocks free!

So either the drive does not write the updated BAM back to disk - or VICE does not flush the changes back to the file. But I doubt the latter, the very same
program runs fine in VICE with a 1001 emulation instead of the 4040 - and allocates the blocks on the d82 disk imafe. But I guess the real test will be the real machine. 
Is someone willing to do this test with a real 4040? (I currently only have a DOS 1 3040 drive out of storage...)


  100 d=8
 1000 open1,d,15,"i0"
 1010 gosub 9000
 1020 open2,d,2,"#"
 2000 t=1:s=1
 2020 print#1,"b-a: 0";t;s
 2050 gosub9000
 2060 if a=65 then t=c:s=d:goto 2020
 2100 t=1:s=1
 2120 print#1,"b-a: 0";t;s
 2150 gosub9000
 2160 if a=65 then t=c:s=d:goto 2120
 2180 tt=t:ss=s
 2200 t=1:s=1
 2220 print#1,"b-a: 0";t;s
 2250 gosub9000
 2260 if a=65 then t=c:s=d:goto 2220
 3000 print#1,"b-f: 0";tt;ss
 3010 gosub9000
 3100 t=1:s=1
 3120 print#1,"b-a: 0";t;s
 3150 gosub9000
 3160 if a=65 then t=c:s=d:goto 3120
 3200 close2
 3210 close1
 3230 directory
 8900 get a$:if a$="" then 8900
 8910 poke 2,2:sys2:rem jam
 8999 end
 9000 input#1,a,b$,c,d
 9010 printa","b$","c","d
 9020 return

       Message was sent through the cbm-hackers mailing list
Received on 2014-08-01 11:00:03

Archive generated by hypermail 2.2.0.