Simple DFS Formatter

From BeebWiki
Revision as of 15:22, 12 May 2008 by Jgharston (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

DFS v0.xx and v1.xx do not have a format command built in. They are supplied with a format command on disk. A problem arises when you have no formatted disks to start with. This program is short enough to type in directly with no errors and will format a DFS disk.

 REM Quick DFS Formatter
 DIM X% 31,data% 511
 Y%=X%DIV256
 *FX180,64
 INPUT"Drive: "drive%
 INPUT"Tracks: "num%
 FOR track%=0 TO num%-1
   PRINTCHR$13;"Track ";track%;
   FOR sector%=0 TO 9
     data%!(sector%*4)=track%
     data%?(sector%*4+2)=(sector%+track%*7)MOD10
     data%?(sector%*4+3)=1
   NEXT sector%
   X%?0=drive%
   X%!1=data%
   X%!5=&6305
   X%?7=track%
   X%!8=&10002A10
   A%=127:CALL&FFF1
   IFX%?10:PRINT" error &";~X%?10
 NEXT track%:PRINT
 FOR A%=0 TO 511 STEP 4:data%!A%=0:NEXT A%
 data%?&107=num%*10
 data%?&106=num%/25.6
 X%?0=drive%
 X%!1=data%
 X%!5=&4B03
 X%!9=&22
 A%=127:CALL&FFF1
 IFX%?10:PRINT"write error &";~X%?10
 OSCLI"FX180,"+STR$(PAGE/256)

See Also

BBC FAQ

Jgharston 14:46, 4 January 2008 (UTC)