Lists the directory of a Larken disk to the screen, the TS2040 printer or a large printer, using 179 bytes of machine code POKEd at 24800, just below the system variables. Channel #2 is pointed at the chosen printer, with normal or compressed print and a left or right column for disk labels; the printer codes are set up for an SCM Fastext 80 and a printer-ready value of 108 from IN 127. The article explains how to keep the code in an AUTOSTART or OMNIBUS menu program and call it with PRINT USR 24800.
Listing only: the code calls the LKDOS routines to read the disk directory, and the program opens the Larken disk channel and selects drives with RANDOMIZE USR 100.
Published in Sinc-Link July-August 1990 (File Header Reader Larken TS2068).
Source Code
110 BORDER 1: PAPER 1: CLS
120 PRINT AT 2,2; INK 2; PAPER 7;" LARKEN DISK UTILITY v3.0 ";AT 4,7; PAPER 2; INK 7;"File Header Reader";AT 6,3; PAPER 2; INK 7;" 1990 George Chambers "
130 INK 7: PLOT 0,108: DRAW 0,62: DRAW 255,0: DRAW 0,-62: DRAW -255,0
140 INK 7: PLOT 8,114: DRAW 0,50: DRAW 238,0: DRAW 0,-50: DRAW -238,0
150 RESTORE 160: FOR n=24800 TO 24978: READ a: POKE n,a: NEXT n
160 DATA 205,134,97,175,50,29,32,205,126,0,205,123,0,33,136,32,17,112,52,213
170 DATA 175,18,35,126,254,250,40,14,254,253,32,246,35,126,254,249,40,240,18,19
180 DATA 24,234,209,26,167,202,186,0,33,29,32,190,56,9,40,11,245,205,129,0
190 DATA 241,24,241,119,205,126,0,19,213,205,123,0,33,114,32,6,6,126,254,46
200 DATA 40,6,35,215,16,247,24,5,62,32,215,16,251,6,3,126,35,215,16,251
210 DATA 33,124,32,205,94,97,195,82,97,24,187,1,1,0,33,134,32,205,94,97
220 DATA 62,13,215,195,10,97,62,32,215,78,35,70,33,9,0,205,138,97,33,99
230 DATA 0,205,138,97,33,231,3,205,138,97,33,15,39,205,138,97,58,100,0,251
240 DATA 205,233,48,205,161,49,243,195,98,0,167,237,66,216,62,32,215,201,0,0
250 RANDOMIZE USR 100: OPEN #4,"dd"
260 LET drv=0: PRINT #4: GO TO drv
270 POKE 23658,8: INPUT "Select 2)Screen 3)2040 5)Large ";ptr
280 IF ptr=5 THEN PRINT #4: POKE 16094,8: INPUT "Choose Column: L)eft R)ight ";b$
290 IF ptr=5 THEN INPUT "N)ormal or C)ompressed ";c$: GO SUB 460: IF c$="C" THEN GO SUB 440
300 IF ptr=5 THEN IF b$="R" THEN PRINT #4: POKE 16094,(68 AND c$="C")+(36 AND c$="N")
310 PRINT AT 20,0;"Drive Now>";drv: INPUT "Select Drive ";drv
320 IF drv<0 OR drv>4 THEN GO TO 310
325 PRINT #4: GO TO drv
330 IF ptr=3 THEN OPEN #2,"p"
340 IF ptr=5 THEN PRINT #4: OPEN #2,"lp"
350 CLS : PRINT : POKE 23658,0: INPUT "DISK TITLE ";C$: PRINT "Disk Name: "; C$
360 PRINT AT 2,0: RANDOMIZE USR 24800
370 PRINT #4: CLOSE #2
380 IF ptr<>2 THEN PRINT AT 16,5
390 POKE 23658,8: PRINT ''TAB 10;"End of file"'" Press a key to continue": INPUT "another? Y/N ";b$
400 IF b$<>"Y" AND b$<>"N" THEN GO TO 380
410 IF b$="Y" THEN CLS : GO TO 270
420 PRINT '"Going to RAMdisk in 10 seconds": PAUSE 500: PRINT #4: GO TO 130: PRINT #4: NEW
430 GO TO 380
440 GO SUB 470: OUT 127,15: GO SUB 470: OUT 127,27: GO SUB 470: OUT 127,48: GO SUB 470: RETURN
450 STOP
460 GO SUB 470: OUT 127,18: GO SUB 470: OUT 127,27: GO SUB 470: OUT 127,50: GO SUB 470: RETURN
470 IF IN 127<>108 THEN GO TO 470
480 RETURN
490 PRINT
8000 INK 0: PAPER 7: BORDER 7: CLS : LIST
8010 STOP
9000 PRINT USR 100:SAVE "header.B2"LINE 100Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.