EGBAS.DOC v1.0 02/03/85 Eric Gans French Department UCLA Los Angeles, CA 90024 This library includes a miscellaneous collection of MBasic files written over the last year or so. Some (FINDEX, NUMREP, DCODE, HEXLOAD) are of interest mainly to Basic programmers; others (LINK, BINARY) are "sample programs" that illustrate a principle--linked lists, binary trees--that can be used in other programs or in teaching situations. There is also a number-conversion program as well as a(nother) CALendar program... FOR MBASIC PROGRAMMERS: 1. BITMAP.BAS allows the programmer to create characters using Kaypro graphics and to store them in a file called CHAR.DAT. The included version of CHAR.DAT has a complete U.C. alphabet, numbers, chess pieces and a few other characters. You can use these or delete them and start over. Or you can patch the program to put your new characters in a different file. 1a. CHAR.DAT is the associated data file. 2. DCODE.BAS was written for those who are curious about how MBasic "squeezes" the ASCII you enter from the keyboard. It takes a file saved in the (normal) compressed format and outputs something like your original. It requires BCODE.DAT on disk for its data. This file doesn't really do anything that Basic itself doesn't do better, but it is fun and somewhat instructive to use. 2a. BCODE.DAT is the associated data file. 3. FINDEX.BAS is a very useful tool for MBasic programmers. It provides an alphabetical list of all variables/reserved words used in your program with the line numbers where they are found (line numbers are good for something!) You can send this list to the printer; for faster operation, you can eliminate the reserved-word list. Since this is an MBasic program it isn't exactly speedy, but you can make yourself a cup of coffee while it's running. It requires RESWD.DAT on disk. 3a. RESWD.DAT is the associated data file. 4. HEXLOAD.BAS is the only unoriginal file in this collection; it was copied from Soul of CP/M by Waite & Lafore (Sams / Waite Group, 1983). It loads a HEX file into memory to run as an assembly-language subroutine with a Basic program. 5. NUMREP.BAS, like DCODE, doesn't do anything that Basic doesn't do faster, but it shows how it's done. This program demonstrates Basic's integer and floating-point number representation (single- and double-precision). You input a number and see what Basic does with it in binary; it also gives you an idea of its accuracy. FOR EVERYBODY 6. CAL.BAS is a calendar program that will print out yearly or (larger) monthly calendars and that will find the date for any day. It makes use of a couple of Okidata commands which you can change if necessary, as well as Kaypro graphics. 7. CONV.BAS is a general number-conversion utility that accepts bases up to 30. If you've always wanted to know what 13ddg base 29 is in hexadecimal, then this is for you. DEMONSTRATION PROGRAMS 8. BINARY.BAS creates a B(inary)-Tree that alphabetizes a list of words. It even outputs a little picture of the tree (if it isn't too big). Based on this principle, you can sort lists of arbitrary length (just translate the program into assembly language). The relative transparency of the procedure makes this program a potential teaching tool. 9. LINK.BAS is similar to the preceding program except that it does its sorting with a (doubly) linked list that allows going backwards as well as forwards. Here again, the principle illustrated can be used in various applications. These last two files were written to show that you don't need Pascal to deal with pointers! If I weren't so lazy I'd put in more comments; these are left as an exercise for the user.