STORING EXECUTABLES IN AMOS

As I mentioned earlier, there have been some Amos written slideshows that appeared to support AGA and/or non-Amiga file formats like GIF, BMP, PCX etc. We now know how they do that, but if you look on the slideshow's disk you may be very surprised to see no displayer program on it! How do they do that? They store the picture displayer INSIDE Amos in a memory bank.

Simplified, the steps you need to take are:

Store the executable program in an Amos bank. When your Amos program runs, you must save the executable out of the bank and into the Ram disk. It is then a simple matter of calling the program from Ram: using "Exec" and deleting it when you have finished.

Here is how to store the program in a bank.

* Press escape to go into direct mode.

* Reserve a bank to the EXACT size of the program you wish to be stored. for example,


Reserve As Data 10,19200
This would reserve 19200 bytes in bank 10. The 19200 bytes would be the size of the program you want to store.

* Use "Bload" to load the program in, like this:


Bload "PPMore",10
The above line would load PPMore into bank 10. (You could then link PPmore with a text file and use that as a text displayer! Saving a lot of coding time.) Then in your Amos listing, you will need a line like this:
BSave "ram:PPMore",Start(10) to Start(10)+Length(10)
This copies the whole of bank 10 as a binary file, i.e. Without changing any of the data, to the Ram disk.

Now you can use "Exec" to execute the program from Ram: and use "Kill" to delete it from memory when you are finished with it.

Example listing 1.

You will need to already have stored "PPShow" in bank 10 first and a picture file called "Car.Gif" on a disk in "Df0:" for this listing to work. Alternatively you could change the path and file names to suit your needs.


'Listing 1.
Bsave "Ram:PPShow",Start(10) to Start(10)+Length(10)
Amos To Back
Exec "Ram:PPShow Df0:Car.Gif"
Amos To Front
Kill "Ram:PPShow"

Example listing 2.

You will need to already have stored "PPMore" in bank 9 first and a text file called "ReadMe.Doc" on a disk in "Df0:" for this listing to work, or, as above, make changes to the path and filenames. You could have many different programs stored in different banks to do all manner of tasks.


'Listing 2
Bsave "Ram:PPMore",Start(9) to Start(9)+Length(9)
Amos To Back
Exec "Ram:PPMore Df0:Readme.Doc"
Amos To Front
Kill "Ram:PPMore"

Of course you can use any free bank you want and virtually any Cli based program you want, so have fun, experiment, and get Amos to do all those tasks it isn't supposed to be possible to do.

*Important*

You may need to gain the authors permission before including a program inside one of your own. So check first with the author for permission if you intend to release your program.


F1 AMOS PAGE | F1 HOME PAGE