Most problems that occur with the Compiler can be easily sorted by knowing more about the way it works. So read this chapter to familiarise yourself with the Compiler's few idiosyncrasies.
You receive an error when you try to load compiled ".AMOS" programs into AMOS Basic.
Compiled ".AMOS" programs can only be loaded into the latest AMOS Professional editor. You can't use them with either Easy AMOS or AMOS Basic.
You receive a "Not an AMOS program error" when compiling an ASCII file. The AMOS Pro Compiler automatically detects if your source file is in text format and adjusts itself accordingly. But it's only able to handle raw ASCII, so if you try to compile documents directly from a word processor you'll have real problems.
You'll need to check out the "SAVE ASCII" or "TEXT EXPORT" options from your word processor, and resave your file in the correct format.
You are unable to use the Help system.
In order to use the help system, you'll need at least 150K of free RAM. Although you're unlikely to have problems if you're running the Shell from the Workbench, AMOS Pro users can occasionally encounter memory problems from the Editor. If you run out of memory, save your current program and try loading the Compiler Shell directly into the editor window. This may make all the difference.
The Compiler Shell gives an “Out of Memory” error
If you are using the Shell program from within AMOS Pro, you can occasionally run out of memory. There are several strategies you can adopt:
Remove the Shell from memory and compile your program from Direct mode using a line such as:
Compile "Source.AMOS"
This will save around 100k of space for compiling work.
If the Shell has copied the Compiler libraries into a ram disk, call the setup dialogue and turn this feature off. Then select the “Save Config” button from the Main setup box and reboot your Amiga with the new settings. The Compiler may run noticeably slower but you'll have masses of extra memory.
Run the stand alone Compiler Shell from the Workbench.
Note: The Compiler Shell will also cut down it's memory use automatically when things get a bit tight. If any animation or music is loaded they'll be the first items to be deleted. If the Shell needs more memory it will erase the animated buttons if they're selected. The final things it can delete are the libraries from the Ram disk.
You get an “Out of memory error” from Direct mode or the CLI.
The AMOS Pro Compiler automatically makes the most out of any available memory. So you should be able to compile some sizeable programs on even the smallest Amiga.
If the Compiler runs short of space, it will normally read your program into memory a chunk at a time, as long as it is a tested program. But this is only possible if the program has been saved from AMOS. In order to test and interpret an ASCII program, the Compiler has to load the entire file into memory, and there's no guarantee it will fit.
You get an “Out of memory error” when you try to use a “.AMOS” compiled program from AMOS Professional.
One simple way of minimising the memory consumption is to remove all the memory banks used to hold your sprite, music or screen data from the main program. These banks can then be loaded separately from the disk at the start of your routine. Once the routine's finished with the bank it can then erase it. This will then reduce the final size of the compiled program.
If you still run out of space you may need to run your program outside of AMOS Pro. Do this by compiling your program to CLI or Workbench format, you'll then be able to use the maximum available memory on your machine.
The AMOS RUN command fails from within a compiled program
The AMOS RUN command can be used to link together your compiled programs. However, it only works with CLI or Workbench programs. You can't run a “.AMOS” program in this way.
On small machines you may find it hard to run a second program due to memory restrictions. If so. you can optimise the memory in two ways:
Close all screens, erase all memory banks and clear all AMAL command strings before running the program.
Place the "-Mem" option in COMMAND LINE$. This forces RUN to free as much memory as possible on start-up. Example:
Command Line$="-Mem" : Run "Myprog"
Program structure too long, compile with LONG option
This error occurs when an IF...ELSE...ENDIF or a WHILE...WEND needs to jump more than 32k in the compiled program. So the Compiler will need to replace the Branch Instructions in the program with the equivalent Jump commands.
Don't worry if all this seems like total gobbledygook. All you have to do is set the LONG option from the setup menu and recompile. The final program may be a little longer and run marginally slower but otherwise all will be well.
The AMOS Pro Compiler relies on information held in two configuration files. If these files are accidentally corrupted the system may break down.
If both the Compiler and AMOS Pro fail to work. You may get one of the following messages:
"Bad Interpreter configuration file"
"Cannot load Interpreter configuration"
The solution:
Copy the following files from your AMOS Pro masters onto your start-up disk: S:AMOSPro_Interpreter_Config S:AMOSPro_Cornpiler_Config
Check that you don't have a second AMOSPro_Interpreter_Config file In the same directory as "AMOSPro". If so delete the erroneous file.
Check that the "AMOS.Library" is inside the LIBS: directory of your current start-up disk.
If AMOS Pro works but the Compiler fails, you may get a message such as:
"Bad Compiler configuration file"
"Cannot load Compiler configuration"
In this case your Compiler settings may have been corrupted. So you'll need to replace the imaged "S:AMOSPro_Compiler_Config" file with the original version on the master disks.
Also, check that you don't have a second AMOSPro_Interpreter_Config or AMOSPro_Compiler_Config file in the same directory as the file "AMOSPro". If so delete It.
A program which normally works in AMOS Pro reports an "Extension not Loaded" error while compiling.
This error will be very rare. You've probably got a second configuration file which is being loaded by mistake. Either:
Delete the "AMOSPro_Interpreter_Config" file from the APSystem folder.
Edit the con Figuration so that it uses the same extension list as the Compiler version.
Change the path name of the "Interpreter_Config" to point to the alternative configuration file.
You get a "Cannot find APSystem folder" error
There's a mistake In the "S:Interpreter_Config" file. You may need to copy the default configuration from your AMOS Pro masters.
You can receive an "Error in the Compiler configuration's command line"
Load the Compiler Shell and use the setup option to check the default command line. You may have inadvertently changed a couple of options to silly values.