Classic Computer Magazine Archive COMPUTE! ISSUE 41 / OCTOBER 1983 / PAGE 229

Invisible Disk Directory For VIC And 64

Kevin E. Gough

If you have a VIC or 64 and a 1540 or 1541 disk drive, this utility program can be very helpful. Once loaded, a simple SYS 828 will let you display your disk directory yet retain a program in memory.

The "Invisible Disk Directory Loader" is not really invisible. It only seems to be. A BASIC program POKEs the loader into the cassette buffer as machine language. Beginning at 828 ($033C) and ending at 971 ($03CB), the loader uses 144 bytes. A knowledge of BASIC is all you need to enter and use this program.

Using The "Invisible" Loader

If it were not for Jim Butterfield's article, "The Confusing Catalog" (COMPUTE!, March 1983), I probably would not have written the loader. I saw how easily he could load the disk directory from a program, as a file. Just OPEN 1, 8, 0, "$0", input the bytes, do some manipulation, and there you have it. With the Invisible Directory Loader, you can display the directory and have any program in memory at the same time. You will no longer have to LOAD "$", 8 as a program. Just type SYS 828 and press RETURN. The directory of your disk scrolls onto the screen. Use the CTRL key to slow the scroll when listing programs, or press the space bar to stop the listing.

This program will also give you the number of blocks each file uses and the number of blocks free on your disk. The directory cannot be listed on your printer.

You can also load and save cassette programs and not destroy the loader in the cassette buffer. This is because the loader also changes the start of the cassette buffer pointer at 178 ($B2) for you. Where it used to be 60 ($3C), it is now 204 ($CC), thus the buffer now starts at 972 ($03CC).

Loading Hints

After loading a program from cassette, you will get a load error. This can be remedied with POKE 45, PEEK(174): POKE 46, PEEK(175). This indicates to the VIC or 64 the end of your program or the start of variables. Data files will not load properly with the Invisible Loader in place.

If you SYS 828 and your disk drive is not on, then nothing will happen. Turn the drive on and an error message appears on the screen. You must restore the VIC or 64 by pressing the STOP and RESTORE keys. Insert a disk, type SYS 828, RETURN, and there it is. If you do not have a disk in the drive, then the red light will flash. The screen will also scroll up with nothing on it. STOP/RESTORE, insert a disk, and type SYS 828. Before running it, be sure to save a copy to your disk or cassette. Call it "DIR".

I use this disk utility more than any other. Rarely do I LOAD "$", 8. I just load "DIR", 8 and run it and forget about it. It really seems invisible.

Invisible Disk Directory

10 I = 828
20 READ A : IF A = 256 THEN 40
30 POKE I, A : I = I + 1 : GOTO 20
40 IF PEEK (65440) = 135 THEN POKE 924, 189 : REM 924 HOLDS 221 ON VIC, 189 ON 64
828 DATA 169, 1, 32, 195, 255, 169, 36
835 DATA 141, 240, 3, 169, 48, 141, 241
842 DATA 3, 169, 1, 162, 8, 160, 0
849 DATA 32, 186, 255, 169, 2, 162, 240
856 DATA 160, 3, 32, 189, 255, 32, 192
863 DATA 255, 169, 64, 32, 144, 255, 162
870 DATA 1, 32, 198, 255, 32, 144, 255
877 DATA 32, 207, 255, 32, 207, 255, 32
884 DATA 207, 255, 32, 207, 255, 201, 0
891 DATA 240, 58, 32, 204, 255, 32, 228
898 DATA 255, 201, 32, 208, 3, 32, 196
905 DATA 3, 162, 1, 32, 198, 255, 32
912 DATA 207, 255, 168, 32, 207, 255, 72
919 DATA 152, 170, 104, 32, 205, 221, 169
926 DATA 32, 32, 210, 255, 32, 207, 255
933 DATA 201, 0, 208, 8, 169, 13, 32
940 DATA 210, 255, 76, 115, 3, 32, 210
947 DATA 255, 76, 162, 3, 169, 1, 32
954 DATA 195, 255, 32, 204, 255, 169, 204
961 DATA 133, 178, 96, 32, 228, 255, 201
968 DATA 32, 208, 249, 96, 256