Disk_PC_formatter

Developer(s): Howard Clase
Date: 1993
Type: Diskette
Platform(s): QL

Turns a formatted QL double-density disk in flp1_ into an empty 720K PC (MS-DOS) disk. It writes a PC boot sector to sector 1 of track 0, the first FAT bytes (249,255,255) to sectors 2 and 5, and zeros to the other FAT and directory sectors, using the disk driver’s direct sector access (flp1_*d2d). DD disks only.

The boot sector comes from 512 DATA values that the program makes for itself, so as printed it has no DATA lines. Put a formatted PC disk in flp1_ and type make_data: it writes DATA lines from line 350 to ram1_data. MERGE ram1_data, save the program, and from then on RUN converts QL disks. Howard Clase based it on a routine from Simon Goodwin.

Published in Sinc-Link November-December 1993 (Howard Clase plays with Disks).

Related Articles

Formats – Formatting IBM disks – Sector reader – Renaming – Listings included. Playing with disks.

Related Content

Source Code

100 nm$=        "Disk_PC_formatter"
110 REMark SG modified 1992.07.22 hjc
120 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Main
130 Set_up: Do_it: Finish: STOP
140 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^æ
150 DEFine PROCedure                       Set_up
155 CLS:b$="": RESTORE
160 PRINT "This program converts a QL format disk to""PC format, by inserting the boot bloc for""a PC disk to track 0, and initialising an""empty PC directory.   DD disks only!"
180 FOR i=0 TO 511: READ b%: b$=b$&CHR$(b%)
190 END DEFine
200 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^æ
210 DEFine PROCedure                        Do_it
220 PRINT"Insert a formatted QL disc & press any key": PAUSE(-1)
230 OPEN#3,"flp1_*d2d": PUT#31,b$
240 c$=CHR$(249)&CHR$(255)&CHR$(255)
250 c$=c$&FILL$(CHR$(0),509)
260 FOR s=2,5: PUT#3s,c$
270 FOR s= 3,4, 6TO 9,257TO 261
280   PUT#3s,FILL$(CHR$(0),512): END FOR s
290 END DEFine
300 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^æ
310 DEFine PROCedure                       Finish
320 CLOSE#3: PRINT"Conversion complete"
330 END DEFine
340 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^DATAæ
900 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
910 DEFine PROCedure                    make_data
920 LOCal b$,i,j: CLS
930 PRINT"Put a formatted PC disk into flp1_,""then press any key."
940 PAUSE(-1)
950 OPEN#3,'flp1_*d2d': GET#31,b$: CLOSE
960 OPEN_NEW#3,ram1_boot_bloc: PRINT#3,b$;:CLOSE
970 OPEN_IN#3,ram1_boot_bloc:OPEN_NEW#4,ram1_data
980 FOR i=0 TO 511 STEP 16
990   PRINT#4,350+i!'DATA ';
1000   FOR j=0 TO 15
1010     BGET#3,b%: PRINT#4,b%;
1020     IF j<>15: PRINT#4,',';
1030 END FOR j:PRINT#4:END FOR i
1040 CLOSE
1050 PRINT"Now enter 'MERGE ram1_data' at the ""keyboard, and resave the program."
1060 END DEFine

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.