AMOS:Memory Bank formats

From Amiga Coding
Jump to: navigation, search

An AMOS Memory bank is simply a named block of data. AMOS allows for 15 such banks in an AMOS program, and they can also be loaded and saved at runtime using the "Load" and "Save" commands. Each bank has a standard 20 byte header, although the "length" field in this header does not count the "name" field of this header as part of the header. Each bank can be located in "chip" memory, which is accessible to the Amiga's custom graphics and sound processors, or it can be located in "fast" memory, which is only accessible to the CPU. The header format is as follows:

  • 4 bytes: the ASCII identifier "AmBk"
  • 2 bytes: the bank number (1-15)
  • 2 bytes: 0 for chip memory bank, 1 for fast memory bank
  • 4 bytes: bank length, but only bits 27 to 0. Bits 28 and 29 are undefined, not part of the length field. Bit 30 means "try chip memory", bit 31 means "try fast memory" if set.
  • 8 bytes: the bank name. It is always an unterminated ASCII string which is padded with spaces.

The header is followed by the bank data, which is {bank length - 8} bytes long.