Amos Professional Manual  Contents  Index

Memory Banks


"filename.Abk" to indicate a single AMOS Professional memory bank
"filename.Abs" for a file containing a group of several memory banks.

These identifiers can be very useful when employed with certain instructions, as follows:

E> Rem Load an Object bank from current disc
   Load Fsel$("*.Abk"," ","Load an Object bank")
   List Bank : Rem List bank details on screen

As can be seen, the LOAD command will load the selected memory bank directly from the appropriate disc file. An optional destination bank number can be added after the filename to be loaded, but if it is omitted, or given the number zero, data will be re-loaded into the same bank numbers from which it was originally saved. Any current information in these existing banks will be completely lost!

Object and Icon files are treated slightly differently. If the bank number is greater than zero, any additional images will be added to the end of the existing bank of images.

Saving and loading memory blocks

BSAVE
instruction: save an unformatted memory block
Bsave file$,start To end

A block of memory between a specified start and end location can be saved into a specified file on disc. For example:

Bsave "Test",Start(5) To Start(5)+Length(5) : Rem Save memory bank 5

The above example would save the data in memory bank number 5 to a suitable disc. The difference between this file and a file saved as a normal memory bank is that while SAVE causes a special bank header to be written, containing information about the bank, this header is not written for a file when BSAVE is used. This means that LOAD cannot be used for this type of file. It is also not suitable for Object banks.

BLOAD
instruction: load block of binary data into bank or address
Bload file$,bank number
Bload file$, address

The BLOAD instruction loads a file of binary data into memory. It does not alter the data in any way. To load this data into a memory bank, the bank must first be reserved, otherwise an error will be generated. Also note that files to be loaded must not be any larger than the reserved bank, or other areas of memory will be corrupted.

The file of data can also be loaded from disc into a specified address, using BLOAD.

Back    Next
05.09.05