The .bsd file format

BASin

The .bsd file format

A .bsd (BASin data) file contains the name and contents of a BASIC array variable. To save variable data, use the SAVE . . . DATA syntax.

Note: It is only possible to save array variables with single-letter names, such as a$. This was a limitation of Spectrum BASIC and is preserved in BASin for compatibility.

The .bsd format resembles the .bsc format in that it comprises a standard Spectrum header followed by the raw binary data for the variable. For a discussion of how variables are represented in memory, see Chapter 24 of the manual.

The header takes the form:

Byte offset

Contents

0

Data type indicator: 1 for a numeric array, 2 for a string array.

1-10

Filename, padded with trailing spaces.

11-12

Total length of data block (little-endian).

13

Variable name (a single letter A to Z).

14-16

Reserved.

Bytes 17 onwards are the raw binary data that was saved.