--- title: "LKDOS Disk Utility Double to Quad" type: "article" slug: "lkdos-disk-utility-double-to-quad" url: "http://localhost/article/lkdos-disk-utility-double-to-quad/" markdown_url: "http://localhost/article/lkdos-disk-utility-double-to-quad.md" published_at: "2020-10-27T17:16:59+00:00" modified_at: "2026-11-15T09:45:50+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Here is a little LKDOS utility for those who have 5.25\" quad density (QD) drives but not the standard 5.25\" double density (DD) drives, which most software is distributed on. D2Q will convert a DD disk using your QD drive. I started out with a pair of AMDEK 3\" single sided (SS) DD drives then…" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "LARKEN Electronics" slug: "larken-electronics" taxonomy: "post_tag" url: "http://localhost/tag/larken-electronics/" - name: "LKDOS" slug: "lkdos" taxonomy: "post_tag" url: "http://localhost/tag/lkdos/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Richard Hurd" slug: "richard-hurd" taxonomy: "indiv" url: "http://localhost/indiv/richard-hurd/" publication: "Sinc-Link" publication_r: id: 10240 title: "Sinc-Link" type: "periodical" url: "http://localhost/periodical/sinc-link/" authors: "Richard Hurd" volume: "7" issue: "5" issues_articles: - id: 26581 title: "Sinc-Link v7 n5" type: "issue" url: "http://localhost/issue/sinc-link-v7-n5/" pages: "11" pubdate: "September/October 1989" archive_link: false volumeissue: "v7n5" companies_articles: - id: 11042 title: "LARKEN Electronics" type: "company" url: "http://localhost/company/larken-electronics/" article_media: - id: 72958 title: "LKDOS Utilities v2.1 (Larken Edition)" type: "computer_media" url: "http://localhost/computer_media/lkdos-utilities-v2-1-larken-edition/" --- # LKDOS Disk Utility Double to Quad Here is a little LKDOS utility for those who have 5.25″ quad density (QD) drives but not the standard 5.25″ double density (DD) drives, which most software is distributed on. D2Q will convert a DD disk using your QD drive. I started out with a pair of AMDEK 3″ single sided (SS) DD drives then got around to adding a Tandon 5.25″ double sided (DS) QD drive (TM 101-4A). Which worked great for converting 5.25″ SS DD disks. And now that I have the problem of converting DD disks taken care of, I have added a 3.5″ DS QD drive (NEC FD1035). Which makes the conversion a snap. ### PROGRAM INSTRUCTIONS The utility is easy to use. Upon loading, the 118 bytes of code are placed in upper memory. Then you are prompted for which drives to use for source and destination. Two drives are highly recommended but the program will allow you to use one QD drive as the source and destination drive and prompt you when to swap disks. To convert DS disks you will need a DS QD drive(s). The destination disk should be pre-formated for the destination drive. As D2Q is presented it is set up to convert all 80 tracks of a DD DS or SS disk. The value 79 in line 590 handles this. If you were to know which is the last used track on the DD disk, you could change the 79 to what the last used track is. This is recommended no matter what setup you use. It will put less wear and tear on the drives, and if you are using one QD drive, less hassel. In order to find which is the last used track you could use [George Chambers](http://localhost/indiv/george-chambers/)‘ [DISK DOCTOR](http://localhost/computer_media/larken-system-utility-programs-larken-edition/) or [Larry Kenny](http://localhost/indiv/larry-kenny/)‘s [LARKEN DISK EDITOR](http://localhost/product/larken-disk-editor/) and select the tracks used option. I may get around to working this into a revision of the program. ### PROGRAM LOGIC D2Q uses the LKDOS TRACK routine (trk) to set the drives head to a particular track which does put a strain on the drives. D2Q uses trk to double step the QD drives head to the appropriate track of the DD disk. The variable g handles this. Note that the value of g is doubled for side 0 but incremented by 1 for side 1. Ex. g=8 the QD drives head is moved to track 4 of the DD disk. G=9 the QD drives head is moved to track 5 of the DD disk. The variable ct is sent to the drive via Treg. After calling the trk routine and before calling ldbuf. This is like a track counter. It is 0 for track 0, 0 for track 1, then incremented for track 2 and 3 to 1. For tracks 78 and 79 ct would be 39. This is all on the DD disk. I have also been able to move tracks from a QD disk to a pre-formatted DD disk. I haven’t worked out how to format a DD disk using a QD drive. Q2D can be found on my [LKDOS utlities disk](http://localhost/computer_media/lkdos-utilities-v2-1-larken-edition/) version 2 in the groups LARKEN DISK LIBRARY. ### PROGRAM LISTING ``` 10 REM LKDOS DISK UTILITY DOUBLE TO QUAD DISK CONVERSION by R.H. 20 LET trk=40001 30 LET ldbf=40108 40 LET trak=40000 50 LET Treg=18 60 LET write=40015 70 LET tomem=40050 80 LET mem=40119 90 DIM x$(23): CLS 100 PRINT ''''" Double To Quad Disk Conversion" 110 INPUT "Source Drive? (0-3)";org: IF org<0 OR org>3 THEN GO TO 110 120 INPUT "Destination Drive? (0-3)";dest: IF dest<0 OR dest>3 THEN GO TO 120 130 PRINT ''TAB 5;"Press ENTER To Convert" 140 IF INKEY$<>"" THEN GO TO 140 150 IF INKEY$="" THEN GO TO 150 160 REM move directory 165 GO SUB 610 170 RANDOMIZE USR 100: GO TO org 180 POKE trak,0: RANDOMIZE USR trk 190 RANDOMIZE USR ldbf 200 RANDOMIZE USR tomem 205 LET sid=PEEK (mem+20) 210 IF dest=org THEN GO SUB 620 220 RANDOMIZE USR 100: GO TO dest 230 POKE trak,0 240 RANDOMIZE USR write 250 IF sid=1 THEN GO TO 350 260 IF dest=org THEN GO SUB 610 270 RANDOMIZE USR 100: GO TO org 280 POKE trak,1: RANDOMIZE USR trk 290 RANDOMIZE USR ldbf 300 RANDOMIZE USR tomem 310 IF dest=org THEN GO SUB 620 320 RANDOMIZE USR 100: GO TO dest 330 POKE trak,1: RANDOMIZE USR write 340 REM move tracks 350 LET ct=1: LET g=2 360 IF dest=org THEN GO SUB 610 370 RANDOMIZE USR 100: GO TO org 380 POKE trak,2*g: RANDOMIZE USR trk 390 OUT Treg,ct 400 RANDOMIZE USR ldbf 410 RANDOMIZE USR tomem 420 IF dest=org THEN GO SUB 620 430 PRINT AT 0,0;" ";AT 0,0;g;" ok!" 440 RANDOMIZE USR 100: GO TO dest 450 POKE trak,g 460 RANDOMIZE USR write 470 IF sid=1 THEN LET ct=ct+1: GO TO 590 480 IF dest=org THEN GO SUB 610 490 RANDOMIZE USR 100: GO TO org 500 POKE trak,((2*g)+1): RANDOMIZE USR trk 510 OUT Treg,ct: LET ct=ct+1 520 RANDOMIZE USR ldbf 530 RANDOMIZE USR tomem 540 PRINT AT 0,0;" ";AT 0,0;g+1;" ok!" 550 IF dest=org THEN GO SUB 620 560 RANDOMIZE USR 100: GO TO dest 570 POKE trak,(g+1) 580 RANDOMIZE USR write 590 LET g=g+2: IF g>=79 THEN STOP 600 GO TO 360 610 PRINT AT 12,6;"Insert Source Disk"''TAB 4;"Press ENTER To Continue": PAUSE 0: PRINT AT 12,4;x$;AT 14,4;x$: RETURN 620 PRINT AT 12,4;"Insert Destination Disk"''TAB 4;"Press ENTER To Continue": PAUSE 0: PRINT AT 12,4;x$;AT 14,4;x$: RETURN 900 REM code loader 910 CLEAR 39999 920 FOR f=40000 TO 40117 930 READ c: POKE f,c 940 NEXT f 950 RUN 960 DATA 0,205,99,156,58,64 970 DATA 156,50,29,32,205,126 980 DATA 0,24,30,205,99,156 990 DATA 58,64,156,50,29,32 1000 DATA 205,126,0,205,150,156 1010 DATA 205,120,0,24,10,243 1020 DATA 205,98,0,62,11,50 1030 DATA 2,32,201,58,100,0 1040 DATA 251,201,205,99,156,33 1050 DATA 112,32,17,183,156,1 1060 DATA 0,20,237,176,205,109 1070 DATA 156,201,205,99,156,33 1080 DATA 183,156,17,112,32,1 1090 DATA 0,20,237,176,205,109 1100 DATA 156,201,33,183,156,17 1110 DATA 112,32,1,0,20,237 1120 DATA 176,201,205,99,156,205 1130 DATA 129,0,205,109,156,201 1140 DATA 205,99,156,205,123,0 1150 DATA 205,109,156,201 9999 RANDOMIZE USR 100: SAVE "d2q.B2" LINE 900 ``` ## Source Code: LKDOS Utilities v2.1 (Larken Edition) ``` 5 REM THE COPY MACHINE 10 RANDOMIZE USR 100: POKE 23730,39999: RANDOMIZE USR 100: LOAD "batch.C1"CODE 20 RANDOMIZE USR 60000 30 PRINT a$ 40 IF INKEY$<>"" THEN GO TO 40 50 IF INKEY$="" THEN GO TO 50 60 RANDOMIZE USR 60651 100 PAPER 1: INK 9: BORDER 1 110 POKE 23658,8: CLS : PRINT AT 0,0; INVERSE 1;" "'" LKDOS "'" COPY "'" MACHINE "'" "''' INVERSE 0;"Catalog A Disk?" 120 IF INKEY$="" THEN GO TO 120 130 IF INKEY$<>"Y" THEN GO TO 170 140 INPUT "Drive 0 1 2 3 or 4 ";a: IF a>4 THEN GO TO 140 150 CLS : RANDOMIZE USR 100: GO TO a: RANDOMIZE USR 100: CAT "",: INPUT "Another Catalog? "; LINE b$: IF b$="Y" THEN GO TO 140 160 CLS 190 FOR f=0 TO 7: POKE USR "a"+f,0: NEXT f: POKE USR "a"+3,255 200 RANDOMIZE USR 60000 210 PRINT INK 0 220 BRIGHT 1 230 PRINT FLASH 0 280 RANDOMIZE USR 52837 290 IF PEEK 56872=2 THEN GO TO 310 300 IF PEEK 56872=1 THEN RANDOMIZE USR 100: GO TO PEEK 56880: RANDOMIZE USR 53225 310 BEEP .1,10 320 RANDOMIZE USR 60651: CLEAR 31999: PRINT AT 0,0; INVERSE 1;" "'" LKDOS "'" COPY "'" MACHINE "'" " 330 PRINT 340 IF PEEK 56864=1 THEN PRINT TAB 10;"MODE> BATCH COPY" 350 IF PEEK 56864=2 THEN PRINT TAB 10;"MODE> COPY ALL" 360 IF PEEK 56864=3 THEN PRINT TAB 10;"MODE> BATCH ERASE" 370 GO TO 390 380 STOP : REM gotta start over 390 DELETE 0,220: IF PEEK 56876=0 THEN GO TO 500 400 DIM n$(PEEK 56876,9) 410 RANDOMIZE USR 40063: RANDOMIZE USR 46195 420 LET u=PEEK 56876 430 LET Odrv=PEEK 56860: LET Ddrv=PEEK 56862 440 IF PEEK 56864=3 THEN GO TO 460 450 GO TO 1000 460 REM batch erase 470 FOR n=1 TO u 480 RANDOMIZE USR 100: ERASE n$(n), 490 NEXT n 500 GO TO 8000 999 REM batch copy 1000 FOR n=1 TO PEEK 56876 1005 PRINT AT 16,6;" ": GO SUB 7000 1010 FOR f=1 TO 9: POKE Onam,CODE n$(n,f): LET Onam=Onam+1: NEXT f 1130 FOR a=1 TO 9: POKE Dnam,CODE n$(n,a): LET Dnam=Dnam+1: NEXT a 1140 PRINT AT 10,0;"Copying ";n$(n);AT 10,18;" on Drive ";Odrv 1150 PRINT AT 12,14;"TO" 1160 PRINT AT 14,8;n$(n);" on Drive ";Ddrv 1170 IF n>1 AND Odrv=Ddrv THEN GO SUB 7320 1200 RANDOMIZE USR 100: GO TO Odrv: LET rt=USR indir: IF rt<>0 THEN GO TO rt 2000: LET rt=USR Ld1: IF rt<>0 THEN GO TO rt 2010 LET Tlen=PEEK 34002: LET pass=1: IF Tlen>(PEEK Nbcs)-1 THEN LET Pass=2 2100 GO SUB DesDrv 2200 LET rt=USR Svnam: IF rt<>0 THEN GO TO rt 2300 LET rt=USR Svdata: IF rt<>0 THEN GO TO rt 2400 IF pass=1 THEN GO TO 5000 2500 GO SUB OrgDrv: LET rt=USR Ld2: IF rt<>0 THEN GO TO rt 2700 GO SUB DesDrv: LET rt=USR Svdata: IF rt<>0 THEN GO TO rt 5000 LET rt=USR Svend: IF rt<>0 THEN GO TO rt 5050 PRINT AT 16,6;"File Copied": BEEP .1,10: BEEP .1,10 5060 NEXT n 5070 GO TO 8000 5990 REM -- Error Msgs -- 6000 PRINT FLASH 1;"File Not Found": GO TO 6500 6010 PRINT FLASH 1;"Disk Full": GO TO 6500 6020 PRINT FLASH 1;"Data Error": GO TO 6500 6030 PRINT FLASH 1;"Rename Error": GO TO 6500 6500 BEEP .5,5: BEEP .5,1: PAUSE 100: GO TO 1005 7000 LET Mem=34800: LET Owka=34700: LET Dwka=34750: LET Onam=34600: LET Dnam=34650 7100 LET indir=32000: LET Ld1=32003: LET Ld2=32006: LET Svnam=32009: LET Svdata=32012: LET Svend=32015: LET Renam=32018 7150 LET OrgDrv=7300: LET DesDrv=7400: LET Nbcs=34003: LET Bsize=34004 7160 REM DDen Bsize=5120 Nbcs=7 SDen Bsize=2050 Nbcs=14 7170 POKE Nbcs,7: RANDOMIZE USR 100: POKE Bsize,5120 7200 RETURN 7300 IF Odrv<>Ddrv THEN RANDOMIZE USR 100: GO TO Odrv: RETURN 7320 INPUT "Insert Source Disk"; LINE a$: RETURN 7400 IF Odrv<>Ddrv THEN RANDOMIZE USR 100: GO TO Ddrv: RETURN 7420 INPUT "Insert Destination Disk"; LINE a$: RETURN 8000 REM end routine 8010 CLS : PRINT AT 0,0; INVERSE 1;" "'" LKDOS "'" COPY "'" MACHINE "'" " 8030 PRINT ''"1) RESTART COPY MACHINE" 8040 PRINT '"2) RESTART AN AUTOSTART PROGRAM" 8050 PRINT '"3) RESET COMPUTER" 8060 PRINT ''" PRESS 1 - 3" 8070 IF INKEY$<>"" THEN GO TO 8070 8080 IF INKEY$="" THEN GO TO 8080 8090 IF INKEY$="3" THEN PRINT USR 0 8100 CLS : PRINT "WHICH DRIVE 0-4?" 8110 IF INKEY$<>"" THEN GO TO 8110 8120 IF INKEY$="" THEN GO TO 8120 8130 LET d=CODE INKEY$-48: IF d<0 OR d>4 THEN BEEP .1,0: GO TO 8130 8140 RANDOMIZE USR 100: GO TO d 8150 RANDOMIZE USR 100: NEW 9998 STOP 9999 RANDOMIZE USR 100: SAVE "cpmach.B1" LINE 10 ```