The .bsc file format

BASin

The .bsc file format

A .bsc (BASin code) file contains the contents of a block of memory, along with a descriptive header block. To save a code block, use the SAVE . . . CODE syntax.

Note: The filename extension determines the format in which a code file is saved. If the extension is .bsc, BASin saves a .bsc file. If the extension is anything else (or missing altogether), BASin saves a raw binary file with no header.

The LOAD . . . CODE syntax allows you to specify a start address in memory and an optional length (in bytes). If the file is too short, BASin will load as much code as is available. If it is too long, BASin will stop loading after the specified length or when the top of memory is reached.

The .bsc format begins with a simple 17-byte header, identical to the header saved by a real Spectrum. The header takes the form:

Byte offset

Contents

0

Data type indicator: 3 for a code file.

1-10

Filename, padded with trailing spaces.

11-12

Total length of data block (little-endian).

13-14

Start address in memory (little-endian).

15-16

Reserved.

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

BASin can save memory dumps as either .bsc, which includes the header described above, or as raw bytes if the .bsc extension is absent from the filename - e.g. SAVE "c:\BASin\Screen.scr" CODE 16384,6912 would save a raw .scr dump of the current display memory, with no header. This can be loaded into any emulator which supports the loading of Binary files.