KeyDOS Documentation Copyright 1990 by Randy Winchester If you use KeyDOS or utilities, please agree to the following: KeyDOS isn't Shareware, Freeware, Demoware, Crippleware, Vaporware or any other kind of ware. I'm not looking for donations, contributions, or handouts. Please don't send money. Please make copies of KeyDOS for your friends and user groups, and upload to bulletin boards. Make sure all documentation files are included. Do not sell KeyDOS or utilites. Permission is not granted to offer them for sale on "public domain" disks. User groups may charge a fee for disk duplication, but that fee should not exceed $5. Distribution for profit is strictly prohibited. All I ask in return is if you use KeyDOS, let me know. Write me a short letter or drop a postcard in the mail to me. Send me suggestions, criticisms, or bug reports. Better yet, send me a disk with your favorite C128 (non-commercial) programs. If you've written something you consider useful, please send me a copy. **** Special Offer! **** KeyDOS Function ROM **** The KeyDOS Function ROM plugs into that empty ROM socket inside your 128 and puts all the KeyDOS utilities and function keys just a key press away. KeyDOS keys and utilities are available as soon as you switch on your C128 and load almost instantly. Once you've tried KeyDOS, consider having it as a permanant part of your computer. Write for more details. Randy Winchester P.O. Box 1074 Cambridge, MA 02142 KeyDOS is a new DOS interface for the Commodore 128. It was designed for ease of use and maximum compatibility with all C128 software. KeyDOS reprograms the function keys to provide a quick and simple method to access all disk drives on a system. The inspiration for KeyDOS came from using the C128's CP/M mode. I got used to logging onto a drive, then have all following commands work on that drive as well. Most CP/M applications make good use of multiple disk drives. That's not the case with C128 mode. To get a directory listing of a disk in drive 8, type CATALOG. To get a directory of a disk in any other drive, the command is different. For drive 9 it is CATALOG ON U9. This seems like a lot of extra typing. What I found even less appealing is that the power-up function key definitions are only minimumally useful on a multi-drive system. The string 'DIRECTORY' is assigned to the F3 key. The only thing that key is good for is listing the directory on drive 8. One of the C128's nicest features is it's screen editor. It makes it possible to the cursor over a command on any line of the screen, hit return, and send the command to Basic. It seems like a bit of poor planning that DOS commands such as DLOAD, RUN, and SCRATCH won't work on the listing generated by the CATALOG command. KeyDOS provides a simple to solution to many of these problems. Now you can easily log onto any drive, scratch files, load and save programs, and more, all with the function keys. The same commands work the same way with all drives in a system. Additionally, KeyDOS commands work with the standard CATALOG command for fast selection of filenames with a minimum of typing. A set of KeyDOS utilities is provided. These short programs are extensions of the KeyDOS function keys. They allow multiple files selected from directory listings to be copied from any drive to any other drive, or select multiple files to print, rename, or scratch. KeyDOS was developed for systems with multiple drives, but will be useful on systems with only one drive. KeyDOS is fully Commdore RAMDOS and 1581 compatible. KeyDOS is the perfect addition to the Quick Brown Box battery backed RAM cartridge. Included is a version of KeyDOS with special QBB functions. Warning: Practice using this program with some disks you don't care about. Get familiar with this program before using it regularly. Like many things in the computer world, you should read the documentation and practice. I will not be held responsible for any damage this program might cause. Running KeyDOS KeyDOS is started by the RUN command. Example: RUN "KEYDOS" (runs KeyDOS from drive 8) It's probably more convenient to put KeyDOS on an autoboot disk. It will then start up automatically if the disk is in drive 8 when the computer's power is turned on. KeyDOS will also auto-boot from the Quick Brown Box during power-up or following a reset. KeyDOS Commands at a Glance Key Function ---- -------- F1 DLOAD a Basic program from a directory listing F2 RUN a Basic program from a directory listing F3 CATALOG listing from the active drive F4 RUN a C64 Basic program from a directory listing F5 Type a sequential text file from a directory listing F6 SCRATCH a file from a directory listing F7 Select a new disk drive F8 SCRATCH then DSAVE a program from a directory listing RUN BOOT disk in the active drive / file from a directory listing HELP PRINT the string "ON U (active drive) " Using KeyDOS After running KeyDOS, press the F3 function key. Normally, this key prints the command "DIRECTORY," and give a directory listing of the disk in drive 8. You'll notice that KeyDOS's F3 key prints "cAu(peE(186))" and also produces the exact same directory listing. Big deal . . . Here's where the fun begins. If you have more than one disk drive, make sure it is turned on and has a disk in it. Now press F7 and enter the number of the drive you wish to work from and press RETURN. Press F3 again. The directory listing is now from the newly selected drive. Press F3 again. All KeyDOS commands will continue to use the last drive selected or used. Once you use a drive, KeyDOS will use that drive until you select or use a new drive. Place a disk containing a SEQ text file in one of your disk drives. Press F3 to get a directory listing of the disk. Now use the CRSR up key to move the cursor to the screen line listing the text file. Press the F5 key, and the text file will be printed to the screen. Use the Commodore key to slow the listing or the NO SCROLL key to pause the listing. In this example, the text file could be on any disk drive in your system. The F5 key prints a text file from a directory listing of the last used or the selected drive. Other KeyDOS commands function in a similar way. Make some extra copies of this disk, and practice using the other KeyDOS function keys. Use F1 to DLOAD a Basic program. Again, move the cursor key to the line in a directory listing (F3) containing the name of the file to load and press F1. Use F2 to RUN a Basic program. Use F6 to SCRATCH files you no longer want. The computer will print the prompt "Are you sure?" Press "y" and RETURN to scratch the file. The F8 key simulates the SAVE@ or SAVE with REPLACE command. To test it, first DLOAD a Basic program with the F1 key. If you make changes to the program and wish to save it with the same file name, move the cursor to the line in a directory listing containing the name and press F8. KeyDOS will first scratch the original file, then save the new file with the same name. Be very careful with this key. It's possible to press it over the wrong file name and unintentionally replace a file with a different one from memory. If this idea frightens you, please disable this key by substituting something else for it, or remove the F8 key definition from the KeyDOS program listing. 1581 users might want to substitute the key from SUBDIR KEY in this archive. The F4 key is used to run a C64 Basic program from a directory listing. It does this by first loading and running a modified version the public domain RUN64. By default, KeyDOS expects to find RUN64 as "64" on drive 8. If you prefer to use another drive or file name, list KeyDOS and alter the definition for the F4 key. The amount of time it takes to load and run RUN64 is minimal compared with the amount of time you'll save loading C64 programs with a 1571 or 1581 disk drive in C128 mode. KeyDOS also reprograms the RUN and HELP keys. The RUN key, selected by pressing SHIFT-RUN/STOP, is a dual purpose key. If pressed on a blank screen line, it will BOOT a disk containing an autoboot sector. The other function of the RUN key is to BLOAD and execute binary programs. Just press RUN while the cursor is on a line with a filename from a directory listing. The HELP key is now truly helpful! KeyDOS places the most frequently used DOS commands on the function keys and RUN key, but there are just as many DOS commands that couldn't be included. For example, suppose you are working on a new program and would like to save a copy on drive 9. You've used KeyDOS and have just viewed the directory of drive 9 with the F3 key. Just type DSAVE "program name" and press the HELP key. HELP adds the KeyDOS extension "ON U(PEEK(186))"+CHR$(13), which translates to the active drive number and RETURN. Follow commands such as DSAVE, DVERIFY, COLLECT and RENAME with the HELP key in order to make them access the active drive and to save yourself as much typing as possible. KeyDOS RAMDOS Compatibility KeyDOS is completely compatible with Commodore RAMDOS. If you use KeyDOS with RAMDOS, load RAMDOS first. The RAMDOS.BAS program redefines the F4 key to give a directory listing of the RAM disk. Running KeyDOS after RAMDOS will replace this useless key definition with one to load and run C64 files. KeyDOS treats the RAM disk the same as any other drive in the system. Simply use F7 and enter the number of the RAM disk to make it the active drive. If you install RAMDOS, it is recommended that you place RUN64 ("64") on it and change the F4 key device number for loading RUN64 to the number used for RAMDOS. KeyDOS and the Quick Brown Box KeyDOS is a perfect autostart program for the Quick Brown Box. A version of KeyDOS is included which looks for RUN64 on the QBB. Overview of KeyDOS Utilities KeyDOS Utilities are very short, simple, no-nonsense programs that carry the KeyDOS concept even further. The KeyDOS Utilities available are: KeyDOS Utility V2 - Copy, print, type, scratch, and rename multiple files. It features optional ASCII / CBM ASCII translation for file copying and can type ASCII or CBM ASCII files. The printing function offers a quick preview mode for selecting ASCII translations and will work with both ASCII and CBM printers. All routines are completely compatible with RAMDOS and 1581 subdirectories. The big difference between KeyDOS keys and the KeyDOS Utility is that the utility can select multiple files for operations. It can save a lot of time for repetitive operations, such as selecting a set of files to print at one time. Imagine setting up your printer once, giving it a disk full of files to print, then doing your grocery shopping! Visual Partitioner - the easiest way to create 1581 partitions and subdirectories. Visual Partitioner displays available tracks on a 1581 disk and will not allow partitions to overwrite tracks which are in use. KeyDOS Compiler - a quick way to change function key definitions. Select from a library of KeyDOS key definitions. Key definitions can be assigned to any key and optionally saved as a file. KeyBOOT V2 - by Geoff Sullivan. KeyBOOT reads the current function key definitions and installs them on an autoboot disk. KeyBOOT uses a little known feature of Commodore DOS to place autobooting key definitions on disks which already have autoboot sectors without affecting the existing autoboot sector. If the disk doesn't have an autoboot sector, KeyBOOT will create one. Seperate documentation files are provided for each KeyDOS Utiltiy. Quirks, etc.: It's possible to generate error messages while using KeyDOS keys. Usually these won't cause any problems and will be obvious errors. For example, press F3 while on a screen line that contains 20 or more characters. Usually this will generate a SYNTAX ERROR, which is the same thing that would happen if you tried this stunt with the normal F3 DIRECTORY key. Pressing F1, F2, F4, F5, F6 or F8 while not on a directory listing line with a file name will usually produce a FILE NOT FOUND error. This is no big deal if you consider most normal DOS commands won't even work with a directory listing without a lot of preperation. It's also possible to select files that aren't on the current drive. This could happen if you changed the currently active (last used) drive after listing the directory selected from. If you had a catalog listing on the screen from drive 9, then scratched a file from drive 8, KeyDOS would look for all selected files on drive 8. This is another easy way to generate FILE NOT FOUND errors. Another possible error is DEVICE NOT PRESENT. This could be caused by a number of conditions, but is usually not a problem. Any access to printers, modems or file I/O with the screen or keyboard will change the device number used by KeyDOS to a value illegal for DOS commands. It's also possible to press F7 and enter an outrageous value, say 170. Again, KeyDOS won't function properly, but this won't cause any real problems either. The solution is to press F7 and enter a valid drive number before proceeding. Again, I highly recommend some practice on a scratch disk before using KeyDOS on a routine basis. Randy Winchester P.O. Box 1074 Cambridge, MA 02142 1581 Subdir Key a KeyDOS 128 Key Copyright 1989 by Randy Winchester Here's a single key definition that makes it easy to select 1581 subdirectories. Many 1581 owners have been reluctant to use subdirectories due to the inconvenient commands needed to manipulate them. Now, for the first time, opening subdirectories is as easy as moving the cursor to the line in a directory listing with the name of a subdirectory and pressing F8. Installation: The 1581 Subdir key was developed after the first release version of KeyDOS 128 was readied for distribution. As it now stands, all KeyDOS keys can be used on a C128 with any disk drives. The 1581 Subdir key will only be of interest to 1581 users. To try out 1581 Subdir, simply run the program SUBDIR KEY. It will replace the F8 key with the new definition. To make a permanant version of KeyDOS 128 with the 1581 Subdir key installed, follow these simple steps: 1) DLOAD the program SUBDIR KEY. 2) Clear the screen with the CLR key. 3) LIST the program. 4) Immediately after listing the program, press the ESC key followed by the letter "t." This sets the top of a window below the listing to keep it from scrolling off the screen. 5) DLOAD the version of KeyDOS you'll be using with your system. 6) Press the HOME key twice. The cursor will move to the top of the screen. 7) Move the cursor over the first line of the 1581 Subdir key listing. Press the RETURN key twice to enter both lines of the listing, merging it with the main KeyDOS program. 8) Save the combined program under a new name. Use DSAVE "new keydos name" Using the 1581 Subdir Key The 1581 Subdir Key works similarly to other KeyDOS keys. It gets it's input from a directory listing, and always references the active or last used drive. Press F7 and enter the device number of a 1581 disk drive in your system. Insert a disk that contains one or more subdirectories. Press F3 to get a directory listing. Subdirectories appear in the directory listing as files with a file type of CBM. Move the cursor to the line containing a subdirectory name, and press F8. The subdirectory will be opened. Pressing F3 for a directory listing should confirm that you're now in a subdirectory. To get out of a subdirectory, simply move the cursor to a blank line on the screen and press F8. Press F3, and you'll see from the directory listing that you're now in the root (top level) directory. Batch File Exec Key a KeyDOS 128 Key Copyright 1989 by Randy Winchester CP/M and MS-DOS operating systems provide a feature called batch execution which can run commands from a text file. This feature has been mostly missing from the C128, that is until now. KeyDOS 128 now includes a batch execute command with all the convenience of the point and click KeyDOS user interface. What are Batch Files? Batch files are SEQuential text files containing BASIC direct mode commands. They can be created with any text editor that can create PETASCII SEQ files. You can use the SEQ file write feature of RUN Script to make these files. Another method is to edit the batch file as if it were a BASIC program, with line numbers at the beginning of each line. To save the file to disk as a SEQ file without line numbers, use the command: OPEN 1,(drive number),2,"filename,S,W":CMD 1:POKE 24,37:LIST PRINT#1:CLOSE 1:POKE 24,27 Batch files can contain most BASIC commands that can be used in direct mode, that is, outside of a program. Several batch files are included in this archive, and demonstrate some programming methods and techniques. Since so little has been done with batch files in the past, there's still a lot of territory to explore, so experiment. Interested hackers might want to read the article "SYS 65478: Taking a New Look at an Old Dog" by Miklos Garamszeghy, published in Volume 8, Issue 2 of The Transactor, which was the inspiration for this KeyDOS key. Batch File Hints and Tips Since batch files are not memory resident, they don't alter programs in memory unless you want them to. To test this, simply load a program, then use the Batch File Exec key to execute a batch file. When the batch file has finished executing, you'll find the program has been left intact. Batch files execute as they are read from disk. To speed things up, include the FAST command in the first line of your batch files. After each line of a batch file executes, the operating system responds with the usual READY prompt and a carriage return. To keep the screen from getting cluttered, define: UP$=CHR$(145)+CHR$(145)+CHR$(145) and print it at the beginning of each line. Batch files can be made to wait for user input. Placing the commands WAIT 208,1:POKE 208,0 at the end of a line will make execution wait until any key has been pressed. The ASCII value of the key pressed can be recovered with PEEK(842). Batch Exec can also tokenize a BASIC program that has been saved as a SEQuential text file. This feature also can be used to merge a program in memory with a program saved as a text file. As each line is read in, it is entered as if it were typed in. To save a program as a text file, use: OPEN 1,(drive number),2,"filename,S,W":CMD 1:LIST:PRINT#1:CLOSE 1 To make sure batch files finish in an orderly manner, end them with the line: SLOW:POKE 153,0:DCLOSE ON U(PEEK(186)). Installation: The Batch File Exec key was developed after the first release of KeyDOS 128 was readied for distribution. It can either be incorporated into the main KeyDOS program, or used as a stand-alone program. To try out Batch File Exec, simply run the program BATCH EXEC.KEY. It will replace the F8 key definition with the new Batch File Exec definition. To make a permanant version of KeyDOS 128 with the Batch File Exec key installed, follow these simple steps: 1)DLOAD the program BATCH EXEC.KEY. 2)Clear the screen with the CLR key. 3)LIST the program. 4)Immediately after listing the program, press the ESC key followed by the letter "t." This sets the top of a window below the listing to keep it from scrolling off the screen. 5)DLOAD the version of KeyDOS you'll be using with your system. 6)Press the HOME key twice. The cursor will move to the top of the screen. 7)Move the cursor over the first line of the 1581 Subdir key listing. Press the RETURN key twice to enter both lines of the listing, merging it with the main KeyDOS program. 8)Save the combined program under a new name. Use DSAVE "new keydos name" Using the Batch File Exec Key The Batch File Exec Key works similarly to other KeyDOS keys. It gets it's input from a directory listing, and always references the active or last used drive. Press F7 and enter the device number of drive on your system that contains batch files. Press F3 to get a directory listing. Move the cursor to the line containing a batch file name, and press F8. The batch file will be opened and executed one line at a time. Randy Winchester P.O. Box 1074 Cambridge, MA 02142