BANK SWAP is commonly used in conjunction with Objects, Icons and music banks. For example, it can be used to instantly flick between the images in an Icon bank and an Object bank, like this:
X> Load "Objects.Abk" : Rem Please use your own filename Load "Icons.Abk" : Rem Select appropriate filename Bank Swap 1,2 : Rem Banks 1 and 2 normally used for Sprites and Icons
Another possibility is to store several different music banks in memory, and swap them as required.
Listing banks on the screen
LIST BANK
instruction: list all current banks in memory
List Bank
The LIST BANK instruction is used to provide a complete list of all the banks that are available from the current program. Information about the banks is listed in the following order:
LIST BANK will result in the following sort of report appearing on the screen:
1-C- SpritesS:C61298 L:0000005 3-C- Music S:C60E80 L:0001000 6-F- Work S:100000 L:0010000
Memory bank functions
AMOS Professional provides a full range of memory bank functions, which are used to provide
information about the status of available banks.
LENGTH
function: return the length of a memory bank
length=Length(bank number)
The LENGTH function is used to find the size of the bank whose number is specified in brackets. Normally, this is measured in bytes, but if the bank contains Objects or Icon data, the number of images in that bank will be given.