Menu
Kenn Garroch's utility for the BBC micro displays your disk catalogue in a neat four column array. You can then choose a file and execute it.
To begin with the file at the top left of the display is highlighted in red and you can move this highlight around like a cursor using the cursor keys. When you have positioned the cursor on the file you want to work with, press RETURN to execute it. If it is a text file, it will try and load the ROM word processor (Wordwise to be exact), if you have one, if not then a syntax error will be generated.
If it is a Basic file, it is automatically CHAINed, i.e. LOADed and RUN.
Machine code files are loaded to their specified load addresses and then run from their execute addresses.
The program contains a number of useful utilities that may be extracted and used elsewhere; in fact, they were written with this in mind as the procedures and functions nearly all use Local variables.
Once the program is typed in and running, it can be made to auto boot with the following:
*BUILD !BOOT
1 CHAIN"MENU"
2 <ESCAPE>
*OPT 4,3
Pressing SHIFT and BREAK will now automatically run the Menu program.
Program Notes
10 | Screen mode 7 for serial attributes |
20-30 | DIM two arrays to hold the catalogue information |
40-50 | Set aside a block memory |
60 | Read catalogue from disk |
70 | Format the catalogue information |
80 | Print catalogue on the screen |
90 | Execute selected file |
100 | Repeat |
110 | Start definition of PROCKAT |
120 | Set up local variables |
130 | Read disk, track 0, sector 0 |
140-180 | Read filenames into array |
190 | Read disk, track 0, sector 1 |
200-220 | Read file information into Kat array |
240-400 | Standard track sector read write routine using OSWORD &7F |
410 | Define procedure to print catalogue |
440-445 | List title in double lines |
450 | Move cursor |
460-480 | Prints formatted filenames on the screen |
490 | Print last three files |
510 | Define a function to select a file |
520 | Define editing keys as ordinary keys |
530 | Set up pointers |
540 | Highlight first filename in read (could change first attribute to flash etc) |
550 | Gets a key |
560 | Turn off highlight |
570-600 | Test for cursor keys and updates H and V accordingly |
610 | Check for carriage return |
630-650 | Makes the cursor wrap around |
660 | Renew highlight |
680 | Repeat |
690 | Return keys to editing mode |
700 | The result of the function is the file number |
710-770 | Format Kat$ with directory name |
780 | Get file number |
810 | If a text file then executes word processor |
820 | If Basic file then CHAIN it. N.B. If 1982 BASIC then 8023 should be 801F |
830-840 | Set x and y registers to point to Para |
850 | POKE filename into Para |
860 | Execute OSCLI on machine code file |
880-1050 | Execute word processor. NB. This is set up for Wordwide and will need modification for others |