--- title: "Disk_sector_reader" id: 77612 type: "computer_media" slug: "disk_sector_reader" url: "http://localhost/computer_media/disk_sector_reader/" markdown_url: "http://localhost/computer_media/disk_sector_reader.md" published_at: "2026-11-18T12:06:36+00:00" modified_at: "2026-11-22T09:55:56+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Shows the contents of QL (DD, HD, ED) and PC (DD, HD) disk sectors, as text or byte by byte." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Howard Clase" slug: "howard-clase" taxonomy: "indiv" url: "http://localhost/indiv/howard-clase/" genre: - name: "Disk Drive Systems" slug: "disk-drive-systems" taxonomy: "genre" url: "http://localhost/type/disk-drive-systems/" media_type: "Diskette" programmers: - name: "Howard Clase" slug: "howard-clase" taxonomy: "indiv" url: "http://localhost/indiv/howard-clase/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Disk_sector_reader%20%281993%29%28Clase%2C%20Howard%29%28Sinclair%20QL%29%28CA%29%28Program%29.zip" mediadate: "1993" article_media: - id: 23795 title: "Howard Clase plays with Disks" type: "article" url: "http://localhost/article/howard-clase-plays-with-disks/" related_content: - id: 77609 title: "Disk_PC_formatter" type: "computer_media" url: "http://localhost/computer_media/disk_pc_formatter/" media_type_tags: "Disk Drive Systems" license: false --- # Disk_sector_reader Shows the contents of disk sectors on QL disks (DD, HD and ED) and PC disks (DD and HD). Give the drive (1 or 2), the format (D, H or E) and the first and last tracks; each sector is printed in turn, and pressing D shows it byte by byte with the position, character and code. It needs Toolkit II (FLP_SEC, FOPEN, PRINT_USING) and a disk interface with direct sector access. Settings such as the columns of the detailed display are in the Set_up procedure, for you to change; the defaults suit a TV. Published in Sinc-Link November-December 1993 ([Howard Clase plays with Disks](https://timexsinclair.com/article/howard-clase-plays-with-disks/)). ## Source Code ``` 5 nm$= "Disk_sector_reader" 10 REMark PD H.J. Clase 1993.09.09 ver1.3 15 REMark Displays contents of disk sectors 20 REMark of QL (DD,HD&ED) and MSDOS (DD&HD only) 25 REMark disks. 30 REMark N.B. Requires SuperToolkit II 35 Set_up: Read_sectors: Finish 100 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 105 DEFine PROCedure Set_up 110 CLS: FLP_SEC 2 115 pd$="1,2": REMark Numbers of drives available 120 pf$="D,H,E": REMark possible formats 125 dev$=Get_flp$: fmt$=Get_fmt$ 130 Get_tracks Ftrack,Ltrack 135 REMark For "detailed" display, TV values 140 REMark for wider screens try 6 & 64 145 cols=3: batch = 32 :REMark <--- <--- <--- <--- 150 END DEFine 200 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 205 DEFine PROCedure Read_sectors 210 LOCal a$,k$,si,se,tr 215 ch%=FOPEN(dev$&fmt$) 220 FOR tr=Ftrack TO Ltrack 225 FOR si=0,1 230 FOR se = 1 TO maxsec 235 GET#ch%\(se+256*si+2^16*tr),a$ 240 PRINT"Track"!tr!"side"!si!"sector"!se\a$ 245 PRINT\\"Press D for detailed display" 250 PRINT"or any other key to continue"\\ 255 IF INKEY$(5000)=="d": Details 260 END FOR se:END FOR si: END FOR tr 265 END DEFine 300 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 305 DEFine PROCedure Finish 310 CLOSE#ch% 315 END DEFine 400 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 405 DEFine FuNction Get_flp$ 410 LOCal d$,n$,lp,p$: d$="flp1_": p$="("&pd$&")" 415 REPeat lp 420 PRINT"Which drive is the disk in? ";p$, 425 n$=INKEY$(-1): PRINT "flp";n$ 430 IF n$ INSTR(pd$) AND n$<>",": Pip: EXIT lp 435 PRINT "Drive ";n$;" not available.":Bip 440 END REPeat lp 445 d$(4)=n$: RETurn d$: END DEFine 500 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 505 DEFine FuNction Get_fmt$ 510 LOCal f,f$,p$,r$: p$="("&pf$&")" 515 REPeat lp 520 PRINT"Disk format? ";p$,,, 525 f$=INKEY$(-1):PRINT f$&"d" 530 IF f$ INSTR(pf$) AND f$<>",": Pip: EXIT lp 535 PRINT "Format ";f$;"d unknown.":Bip 540 END REPeat lp 545 f = CODE(f$): SELect ON f 550 = 68,100: r$="*D2D": maxsec=9 555 = 69,101: r$="*D4E": maxsec=18 560 = 72,104: r$="*D2H": maxsec=10 565 END SELect : RETurn r$: END DEFine 600 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 605 DEFine PROCedure Get_tracks(Ft,Lt) 610 LOCal lp 615 REPeat lp 620 INPUT"First track (0-79)",,,Ft 625 IF Ft<80 AND Ft>=0: Pip: EXIT lp 630 PRINT "0-79 only, try again!": Bip 635 END REPeat lp 640 REPeat lp 645 INPUT"Last track ("&Ft&"-79)",,,Lt 650 IF Lt<80 AND Lt>=Ft: Pip: EXIT lp 655 PRINT Ft;"-79 only, try again!": Bip 660 END REPeat lp: END DEFine 700 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 705 DEFine PROCedure Pip: BEEP 100,30: END DEFine 710 DEFine PROCedure Bip: BEEP 4000,40: END DEFine 800 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 805 DEFine PROCedure Details 810 LOCal c$,i,l$,mb,n%: l$=CHR$(10): mb=256: n%=1 815 IF maxsec=10: mb=2048 820 PRINT"Position, character, code"\\ 825 FOR i=1 TO mb 830 f$='### # ### ' 835 c$=a$(i): IF c$=l$:c$=" ": REMark LF trap 840 PRINT_USING f$,i,c$,CODE(a$(i)) 845 IF NOT n% MOD cols: PRINT 850 IF NOT n% MOD 32 855 PRINT\\"Press any key when ready." 860 PRINT\"Position, character, code"\\ 865 PAUSE(2000) 870 END IF :n%=n%+1 875 END FOR i: PRINT \\: END DEFine ```