FORMATTING DISKS
by Bob Cockroft
by Bob Cockroft
If you are one who formats as many disks as I do, you are no doubt tired of the DOS method. After all, formatting through the DOS requires many key strokes. Although it may not sound like a lot of work for one disk, any reduction in time will be significant when one is doing many.
The following program is designed to shorten the formatting sequence. Once the user has indicated which drive to use, formatting is done with one key stroke. With the START button as the only command, many disks can be done in a fraction of the time. If your disk is not successfully formatted in the first attempt, the computer will repeat the formatting process. In this rare situation the disk often becomes formatted on the second or third trial. On the few occasions when the disk is rejected, the RESET button must be pressed in order to end the program.
The formatting routine is started by using the general input/output statement(XIO).
XIO
254,#1,0,0,"D1:"
The XIO command has many different functions besides formatting. An entirely new and faster DOS can be created using this function. In fact, this has already been done in a previous issue.(refer to Quick DOS in ROM issue 4) All that is needed is the number that represents the command to be performed. Below is a table of some of the more important XIO commands and their corresponding numbers.
CommandNumberexplanation
OPEN |
3 |
makes devise accessible |
CLOSE | 12 |
closes an open file |
STATUS | 13 |
call status routine from a devise |
DRAW | 17 |
same as DRAWTO |
FILL | 18 |
drawing routine |
RENAME | 32 |
X
I O |
32,#1,0,0,"D:THISTO. THAT" | ||
DELETE | 33 |
erases file |
LOCK |
35 |
locks file |
UNLOCK | 36 |
unlocks file |
POINT | 37 |
specifies
where the next byte will be read or written |
NOTE | 38 |
stores disk position |
FORMAT | 254 |
reread article |
120 GRAPHICS 0
140 DIM WA$(5)
160 SETCOLOR 2,16,1
180 POKE 752,1
200 ?
220 POSITION 4,2
230 REM ** DETERMINE WHICH DRIVE **
240 ? "FORMAT which drive(Dl,D2,D3,D4)"
250 INPUT WA$
270 IF WA$="Dl" OR WA$="D2" OR WA$="D3" OR WA$="D4" THEN 300
272 POSITION 3,3
275 ? "D1,D2,D3 OR D4"
278 FOR X=1 TO 750:NEXT X
280 POSITION 3,3
285 ? " "
290 GOTO 220
300 POSITION 0,6
320 ? "Press START to FORMAT on drive ";WA$
325 POSITION 10,20
330 ? "Press OPTION to end"
335 IF PEEK(53279)=3 THEN END
340 IF PEEK(53279)<>6 THEN 335
344 POSITION 14,10
345 ? " "
347 POSITION 10,15
348 ? " "
350 POSITION 12,10
352 ? " FORMATTING! "
355 REM ** START FORMATTING
360 XIO 254,#1,0,0,WA$
378 POSITION 12,10
380 ? "DISK FORMATTED"
400 ?
420 POKE 77,0
480 ?
490 POSITION 10,15
530 POSITION 4,2
540 ? " "
550 POSITION 2,3
560 ? " "
570 POSITION 34,6
580 ? "again"
700 GOTO 300