AMOS Compiler - A review By Michael D. Cox COMPILER v1.1 Compiler Extension v1.34 --------------------------------------------------------------------------- First, I'd like to say that this is my first written review so please keep your rude remarks to yourself until the end of this article. Then, you can EMail me at my address below and let me know what you think about the price of tea in China! THE BOX Well, the box looks real nice. Looks like you're going into warp speed. Just hope the compiler does the same for the programs! THE MANUAL Hey, it looks just like the box! It's only 61 pages long. You also get a separate pamphlet that describes what is new in AMOS v1.3. Bit thinner than the AMOS EXTRAS manual that comes with the original AMOS package. THE DISKS You get two disks. Well, at least I did. One is the COMPILER DISC and the other is the UPDATER DISC. They are your usual disks with the usual AMOS labels on them, except much glossier. WHAT TO DO FIRST Well, first thing I did was read the Foreword by the AMOS god himself, Francois Lionet. Then, I quickly skimmed through to page 5 to where it says how to update to AMOS v1.3. Heck, just boot the UPDATER disc and click on UPDATE. Simple enough. So, I did it. Then, after I stuck my original AMOS disk into the drive as it asks to, I read a bit more thoroughly. As I saw the screen telling me that it was making room on my disk, I read "Do NOT use your original disk!" So, after I recovered from fainting, I quickly made sure I had my backup. Shooooo! The updating process is painless. Well, for most people it should be. You just boot off the UPDATER disk, click on UPDATE, insert your BACKUP of the original AMOS disk and away you go! When the process is completed, your backup now contains all you need for AMOS v1.3. It could be v1.31 or v1.32, depending on when/where you got the compiler. Now, if you have a floppy system (hahahahahahaha - ahem), you are all set. If you have a hard drive, simply copy AMOS1.3 to your C or BIN directory and place everything that is in the AMOS_SYSTEM directory on the floppy in the AMOS_SYSTEM directory on your hard drive. If you place AMOS_SYSTEM inside another directory, make sure you update your .ENV files to reflect the change. Also, you may want to put AMOS1.3 in the directory above AMOS_SYSTEM as the Compiler Install asks you where AMOS1.3 is and looks for AMOS_SYSTEM in the same directory. You can also run the INSTALL.AMOS program to install onto your hard drive. It is just like the one that came with the original AMOS package. COMPILER INSTALLATION This is just as simple. If you have a floppy system, boot from the COMPILER disc. For hard drive users (yeah!!!) boot from your hard drive and insert the COMPILER disc in DF0:, If you use workbench, open up the COMPILER DISC and double click on WELCOME. From CLI, just change to DF0: and enter WELCOME at the prompt. You are once again presented with the same menu as before. Just click on INSTALL. You will be presented with a list of configuration options for the compiler. Select whichever is best suited for you. Or, you could make a floppy for each kind of different programming requirements, as the manual points out. But, I think it is kinda useless, so I just made it install to my hard drive. You just follow the prompts and everything will be fine. Now, if you did put AMOS_SYSTEM in another directory, you may have to update the ENV files after the installation, as I am not sure whether or not this is done automatically. Okay, after it is finished, you either have a floppy disk with AMOS and the compiler installed, or a hard drive with AMOS and the compiler installed (and a lot of room to work with, too). COMPILING PROGRAMS Compiling a program is just as easy. You have two ways of doing it. Either through the COMPILER.AMOS program or via the CLI using ACMP which is installed in the AMOS_SYSTEM directory. Before you begin compiling, the program that you wish to compile must have been TESTED (F2) first. If you ever get an error message saying that the program has not been tested, just load it into AMOS and press F2. Then, save it again. I doubt this will be a problem with most programs, but no need to worry! First, we'll cover the COMPILER.AMOS program. It is the easiest way to do compiling. As usual, you are presented with a nice interface that shows the current compiler configuration. The top row of three ICONS determine the compiler's memory conservation features. As a default, it is set for loading the entire source into memory (first ICON is a chip), do all the compiling on disk (second icon is a disk), and make the program standalone and runnable via workbench (the third icon is WB). You can change these features by clicking on the icon. Each icon will rotate to the next one. For source and destination, you have the option of either compiling to/from disk or to/from ram or both. For the final product you either have CLI, WB, or AMOS. CLI and WB are standalone while AMOS requires either AMOS or RAMOS to work. I have mine set for RAM --> RAM : CLI. The COMPILE icon starts the process of compiling. You will be asked for the program to compile and then the name and destination of the compiled program. The compiler is very quick, so don't walk away thinking you can grab a bite to eat at the local pub. The EXIT icon....you figure it out! The ? icon gives the credits. The Spanner icon (looks like a wrench) lets you configure the compiler and the way the compiled program is made. You are presented with a menu. The first set of options deals with the way your program is compiled. The second set deals with the configuration of the compiler itself. Personally, I have the first options all set to NO and the second all set to YES. Set your configuration then click on SAVE to make it permanent. See how simple that is?! Compiling from the CLI is just as simple, but you have to type everything out. However, if you have saved your compiler configuration using the COMPILER.AMOS program, all of your settings are the same. So, if you like your settings, you just enter: acmp program.AMOS -Oprogram ACMP is the CLI compiler. The -O switch will save the result as 'program.' However, if you need to try a different setting, you have to use one of the switches for ACMP: -Dxx = Sets the memory conservation method -Tx = Sets the type(AMOS, CLI, WB) of the final product -Sx = Default screen upon running program -Wx = Prevent your program from appearing until you tell it to -L = Use JMP instead of BRA for large programs -Cfile = Use a different config file -Fpath = Location of AMOS_SYSTEM -Ex = Include error messages or not -Q = No compiler messages except errors COMPILER EXTENSION As the compiler is an extension to AMOS, it also adds new commands. Some only work from direct mode, like COMPILE, while others are definitely made for standalone CLI programs. The ones of importance are COMPTEST [On/Off], =COMMAND LINE$=, =SQUASH, and =UNSQUASH. COMPTEST lets you turn off the testing done by AMOS. This can increase the speed of your program. It also disables the CONTROL-C break, so make sure you save your work first. =COMMAND LINE$= lets you read CLI arguments. Such as: program no yes maybe COMMAND LINE$ would be equal to "no yes maybe". This is a great benefit to some programs. You can also set COMMAND LINE$ equal to something for the benefit of running a program from within another program. The new program could then read the COMMAND LINE$ and take appropriate action. =SQUASH and =UNSQUASH let you compact and uncompact an area of memory, including banks, except for sprites and icons. They return the length of the squashed or unsquashed data. You can also flash colors while squashing, just like some of the filecrunchers do. PROS and CONS Well, I've gone over how to install, update, and compile. Now, the big question is: Is it worth the price? Well, the benefits of the compiler are: - Standalone programs - Much faster - Can't be modified by others Disadvantages: - Program is much larger So, I would say that the compiler is definitely worth it. I have compiled various programs and have found them to be much quicker. The speed helps non-AMAL functions run faster. For instance, I wrote a little program that scans 1k of memory and determines whether or not a byte is part of a program. Now, whether or not it actually works is not the point. Uncompiled, it took several minutes. While compiled, it took under 30 seconds. BUGS Well, I don't know of any bugs. There are some quirks like setting a needless floating point variable to 0.0 (i.e. A#=0.0) in the very beginning of a program so that the compiler can prepare itself for floating points. Read the README file on the Compiler Updater disc for more info on quirks and bug fixes. ------------------------------------------------------------------------- Well, I hope someone enjoys this and finds it helpful. If you want to review any AMOS products, just EMail your text to me. Later, folks! And, keep programming. Next disk, look for my article on HOW TO INTERFACE WITH LIBRARIES AND ASSEMBLER. Michael D. Cox aj639@Cleveland.Freenet.EDU