[Coco] Re: Disk Basic and 512 byte block floppies.

John E. Malmberg wb8tyw at qsl.net
Sun Jan 18 22:07:20 EST 2004


Theodore (Alex) Evans wrote:
> 
> 
> I wouldn't use DSKI$ and DSKO$, I would use a call to DSKCON.  Something 
> like:

Yes, this look close.  I did not realize that the DSKCON could be used 
so easily with out using assembly.  I have been away from COCO 
programming too long.

A small change though, the sector number needs to increment by 1 on the 
disk writes for each track regardless of the number of bytes per sector.

Other than that, it looks like all I need to do is transfer this program 
to a real COCO.

> 10 DC=PEEK(&HC004)*256+PEEK(&HC005) 'DSKCON
> 20 DO=PEEK(&HC006)*256+PEEK(&HC007) 'DCOPC
> 30 CLEAR &H6800
> 40 INPUT "SOURCE DISK",SD
> 43 INPUT "SECTOR SIZE",SS
> 47 IF SS=256 THEN SS=1 ELSE IF SS=512 THEN SS=2 ELSE GOTO 43
> 50 INPUT "DESTINATION DISK",DD
> 53 INPUT "SECTOR SIZE",DS
> 57 IF SS=256 THEN DS=1 ELSE IF DS=512 THEN DS=2 ELSE GOTO 45
> 60 POKE DO+5,0 'LSB OF BUFFER POINTER
> 60 FOR T=0 TO 34
> 70 POKE DO,2 'OPERATION CODE READ
> 80 POKE DO+1,SD 'DRIVE NUMBER SD
> 90 POKE DO+2,T 'TRACK NUMBER T
   92 S1 = 0
> 93 FOR S=1 TO 18 STEP SS
   95 S1 = S1 + 1
   100 POKE DO+3,S1 'SECTOR NUMBER S
> 110 POKE DO+4,S+103 'MSB OF BUFFER POINTER
> 120 EXEC DC 'CALL DSKCON
> 130 NEXT S
> 140 POKE DO,3 'OPERATION CODE WRITE
> 150 POKE DO+1,DD 'DRIVE NUMBER DD
   155 S2 = 0
> 160 FOR S=1 TO 18 STEP DS
   165 S2 = S2 + 1
   170 POKE DO+3,S2 'SECTOR S
> 180 POKE DO+4,S+103 'MSB OF SECTOR BUFFER
> 190 EXEC DC 'CALL DSKCON
> 200 NEXT S
> 210 NEXT T
> 220 END

Then I need to modify my COCODISK program to be able to handle 512 byte 
sector floppies.

For the DOS version, I should be able to auto detect the sector size.

For the Microsoft Windows / OpenVMS version, it will require 512 byte 
sector sizes.

Thanks,
-John
wb8tyw at qsl.net
Personal Opinion Only





More information about the Coco mailing list