Amos Professional Manual  Contents  Index

Memory Banks


ERASE TEMP
instruction: clear temporary memory banks
Erase Temp

This instruction is used to erase all of the temporary work banks from the current program. Any permanent data banks used for holding Sprites, music or samples will be completely unaffected. For example:

E> Reserve As Data 5,1000: Rem Reserve 1000 bytes of permanent data
   Reserve As Work 6,1000: Rem Reserve 1000 bytes of temporary workspace
   Reserve As Chip Work 7,2000: Rem Reserve 2000 bytes of chip memory
   Erase Temp
   List Bank

BANK SHRINK
instruction: reduce the size of a bank to new length
Bank Shrink bank number To length

This instruction does not erase a bank at all, but shrinks it! BANK SHRINK will not work with Object or Icon banks, but it is used to reduce the length of a previously reserved memory bank to the specified smaller length. The excess memory will be returned for use by the main program without complications.

This feature is very useful if you create a bank by poking it into memory, and wish to save it with a more suitable size. For example:

E> Reserve As Data 10,1000000: Rem Very large bank
   Poke$ Start(10)-8,"My Bank" : Rem Rename bank 8 bytes
   Poke$ Start(10),"This is a small bank!" : Rem Poke some data
   Bank Shrink 10 To 100: Rem Shrink bank to 100 bytes
   Save "My_Bank.Abk",10

Swapping banks

BANK SWAP
instruction: swap over two memory banks
Bank Swap first bank number, second bank number

The BANK SWAP command switches over the memory pointers assigned to a pair of selected banks, so that the first bank is assigned to the second bank's memory block and the second bank grabs the locations used by the first.

Note that the items held in these banks are completely unaffected by this operation, and the only thing that changes is the number and type of the memory bank to which the items are assigned.

Back    Next
05.09.07