Amos Professional Manual  Contents  Index

Memory Banks


A value of zero is returned for any bank that has not been defined. For example:

E> Load Fsel$("*.Abk"," ","Load an Object bank") : Rem Bank 1
   Print "There are ";Length(1);" images available."

START
function: return the address of a memory bank
address=Start(bank number)

Use the START function to reveal the address of the memory area allocated to a bank, whose number is specified in brackets. The address will usually remain fixed for the duration of a program, but it can be changed by a BANK SWAP command.

If the specified bank number does not exist, AMOS Professional will give a "Bank not reserved" error report. This can be avoided by checking the status of a bank with the LENGTH function, like this:

E> If Length(N)>0: Rem give N a suitable bank number
    Print "Address of the bank is ";Start(N)
   Else
    Print "This bank does not exist!"
   End If

The FAST FREE and CHIP FREE functions that are used to find the amount of relevant free memory have already been explained. These should not be confused with the FREE function, which reports the amount of free memory in the variable area.

Grabbing accessory program memory banks
Any memory banks that are used by an accessory are independent from the main program. Existing AMOS users will find that the system for grabbing memory banks has been greatly enhanced for AMOS Professional programmers.

The PRG UNDER command is used to check whether a program is accessible "under" the current program, and if all is well, its memory banks can be grabbed for the current program. As many different programs as memory allows can be run using the PRUN command, and full details of these commands as well as communication between programs is explained in Chapter 11.4. Here are the available bank-grabbing instructions and functions:

BLENGTH
function: return the length of a memory bank from a previous program
length=Blength(bank number)

This function is used to get the length of the specified bank number from a previous AMOS Professional program, if this is possible. A value of zero will be returned if the specified bank has not been defined in the previous program, or if there is no previous program accessible at all (PRG UNDER= 0).

Back    Next
05.09.09