GS WorldView: July MM updated February MMIV The Einstein Compiler Copyright 1983, The Enistein Corporation program by Dennis Goodrow and Shmuel Einstein Version: 5.2 Status: Freeware Distribution: May be distributed as non-commercial in the Apple II ShrinkIt disk archive file format for Apple II computers and disk image format for use with Apple II emulators. by Charles T. 'Dr. Tom' Turley GS WorldView Editor EinsteinCompiler.zip contains ... EinsteinCmp.sdk EinsteinCmp.nib EinsteinDoc.txt (a copy of this file) The .sdk file is a ShrinkIt disk archive. Use ShrinkIt v3.4 to unshrink it to a 5.25 Apple II 140k disk. The .nib file is a disk image file of The Einstein Compiler for use with Apple II disk emulators. I will gladly furnish telephone contact information for Dennis Goodrow to anybody who sends an email requesting varification of the program freeware status and authorization allowing it's online distribution by me from this folder. Cheers & Enjoy! Tom Email: cturley@grin.net ___________________________________ Thanks to Sean McNamara for reporting that the .dsk image did not work and to Chris (hgrt225@inbox.net) for pointing out that the Volume Number must be 232. (on comp.sys.apple2.programmer) Since .dsk images do not preserve Volume Number, the disk has been moved to a .nib image which has the correct Volume Number. A check running on AppleWin indicates the .nib image works fine. The .sdk file included in EinsteinCompiler.zip was transferred to IIgs and the diskette created by 8-bit ShrinkIt was checked. It worked correctly. (Note: The Einstein program is not very forgiving about diskette r/w errors-- i.e. it doesn't seem to try very hard to get a correct write-and-verify during compilation. If you intend to use the compiler on a machine different from the one on which the diskette was created, make a whole-disk copy of the diskette on the new machine and use the copy.) Rubywand February 6, 2004 ___________________________________ Einstein Applesoft BASIC Compiler Mini-Manual by Rubywand About Einstein Copyright 1983, The Enistein Corporation program by Dennis Goodrow and Shmuel Einstein Compiling an Applesoft BASIC program creates a much faster running program. The Einstein compiler is an easy to use, yet flexible, way to compile Applesoft BASIC programs intended to run under DOS 3.3. The Einstein compiler requires an Apple II with at least 48k RAM and Applesoft in ROM (or available via a RAM card or ROM card). The DOS used should be standard DOS 3.3. (Prontodos or EsDOS are faster and probably okay; but, I do not know for certain.) Einstein does permit creation of global variables for use by several program modules. At present, this doc does not supply details for use of global variables. Disk Contents EINSTEIN- the compiler REMARK REMOVER- utility which removes REMs from your source program REMAKE COMPILER DISK- utility for restoring compiler disk if should power fail or the user make a destructive error during compilation The Einstein disk does not include DOS 3.3 and is not bootable. Getting Started First, boot DOS 3.3 and start a whole-disk copier such as Disk Muncher or Copy II Plus. Make a copy of your Einstein disk and place a write protect tab on the copy. Since Einstein uses its disk for information storage during compilation, your 'working copy' of Einstein should not be write protected. Compilining a Program o- Boot DOS 3.3 o- If you do not have a Save Disk for your compiled programs, INIT a diskette and label it "COMPILED". (You can save a compiled program on any DOS 3.3 disk; mainly, you want to be sure to have a disk ready with enough space.) o- LOAD the program (called a "source program") you want to compile. Suppose the source program is named "NARFGAME". o- If you have two drives, insert the Einstein disk into Drive 2 and enter BRUN EINSTEIN, D2. If you have one drive, swap the Einstein disk into Drive 1 and enter BRUN EINSTEIN. o- After about 10 seconds the compiler asks if you want to use the Standard Parameters. Often, you will enter "Y" for Yes. o- When the compile is done you should be at the usual Applesoft prompt. Insert (or swap in) your "COMPILED" save disk and enter SAVE NARFGAME.COMP (or whatever name you like). Usually. it is a good idea to settle on some naming convention that lets you tell that a file is a compiled program. Notes Stopping a compile: If for some reason you want to stop and exit the compilation process, press CONTROL-C. Warning: Do not turn off power or press Reset or open the disk drive door in order to interrupt a compilation. Doing so could corrupt your working copy of the compiler disk. (An I/O ERROR during compilation could indicate a corrupted compiler disk.) To fix a corrupted compiler disk, you can recopy it from your backup or boot DOS 3.3, insert the corrupted compiler disk, and BRUN the REMAKE COMPILER DISK utility. If you get a PROGRAM TOO LARGE error during compilation, you may be able to significantly reduce program size by removing REM messages in your source by BRUNing the REMARK REMOVER utility. The REMs will remain but the messages following each REM will be removed. SAVE the reduced size program. (To to avoid overwriting your REMed original, SAVE under a new name.) In a source program DATA statement, avoid mixing strings in quotes with strings not in quotes. If you include an HGR and/or HGR2 statement in your source program, space will be reserved for loading in hires pics at $2000 ... and/or $4000 ... respectively. Einstein does not accept a few Applesoft commands (see below). During compilation the usual indication will be a TOKEN m IGNORED in n error message, where m= decimal value of the BASIC token and n= Line number in the source program. Commands Einstein will ignore or process differently than Applesoft In the listing below, the BASIC command token value in decimal is shown in parenthesis. CONT(187)- Use a CALL to begin execution of code for a compiled Line. The address for the desired line can be found from the listing displayed and/or printed out during compilation. DEL(133) and LIST(188)- neither of these is supported. LOMEM:(164) and HIMEM:(163)- Use parameter changes to set these. STORE(168) and RECALL(167)- These cassette tape commands are not supported. &(175)- Einstein interprets this as a JMP to $3F5. If variable names follow the & they will not be found by the machine language routine. Memory Map when Using Standard Compiler Parameters $0000- $07FF is the same as usual for Applesoft with DOS 3.3: Zero page, Stack, Input buffer, User area, Text display area. $0800- $12FF holds Einstein Runtime Library routines. $1300- $95FF (DOS 3.3 default) holds the program, String Pool, and Local Variables. $9600- $FFFF is the same as usual for Applesoft with DOS 3.3: DOS 3.3 and buffers, I/O, Applesoft, and Monitor. Example: $FFFF ______________________________ Apple II Monitor Routines $F800 ______________________________ Applesoft $D000 ______________________________ I/O Area $C000 ______________________________ DOS and buffers (default*) $9600* ______________________________ Local Variables Address Program: Local Variables (saved downward starting at $95FF*) ------------------------------ Program: String Pool (Top is set just below Local Variables. Strings are saved downward. Base starts just after end of program or after the last reserved area, whichever is higher.) String ______________________________ Pool Base Address Program area (continued) end ------------------------------ A reserved area (e.g. $2000- $3FFF for hires page 1 as via an HGR command) start ------------------------------ Program area $1300 ______________________________ Program Address Einstein Runtime Library routines $0800 ______________________________ Library Address System routines and Text display area $03D0 ______________________________ Available for user routines $0300 ______________________________ Reserved for System $0000 ______________________________ Some Commonly Changed Compiler Parameters To modify the setting for one or more parameters, enter "N" ("No") near the start of compilation in respose to the question asking if you want to use the Standard Parameters. PRINTER SLOT NUMBER (default: 0) May change to the Slot number used by your printer interface (usually 1) in order to obtain a printout of information displayed during compilation. LOCAL VARIABLES (default is $9600) May change to reduce memory allocated for DOS buffers have more space for your program as follows: $9853 (and include a MAXFILES = 2 command near start of source program) $9AA6 (and include a MAXFILES = 1 command near start of source program) May change to effect an implicit or implied HIMEM: command. May change to leave an area of memory open for BLOADing machine code routines just below DOS 3.3 area. STRING POOL BASE (normally set above end of program and any reserved areas). This parm is meaningful only if dynamic strings are used. (Almost always they are.) Since String Pool is linked to Local Variables area, the base address must change if Local Variables address is changed to some place below the end of the program. May change in order to leave an area of memory open for BLOADing machine code routines just above the end of program (or highest reserved area if higher than end of program). ENABLE LINE TRACE (default is YES) The normal YES setting enables use of TRACE and NOTRACE commands and lets CONTROL-C interrupt program execution. It also enables error reporting and lets the RESUME command work. May change to NO after program is completely debugged to save 7 bytes per line and slightly speed program execution. RESERVE MEMORY (default is NO) May change to YES in order to specify one or more areas of memory which are to be kept clear of code generated by the compiler. (Reserved areas are held free by the compiler only with respect to the compiled program and String Pool.) There is no need to specifically reserve memory for hi-res screen areas if the corresponding HGR and/or HGR2 commands are present in the source. STRUCTURED FOR LOOPS (default is NO) May change to YES if all of your FOR-NEXT loops are properly structured. The gain is more compact faster executing code. A properly structured FOR-NEXT has just one NEXT and the NEXT is located in the source after the FOR. DISPLAY ADDRESS (default: YES) Changing to NO is usually a good idea if compilation information is being printed out. A NO setting avoids having individual Line information printed out. Rubywand, July 2000