IBM PC data cassette

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Added structure of BASIC header)
m
Line 24: Line 24:
 
|0x09 || Byte || Flags. When listing files, BASIC displays 'P' if bit 5 is set, 'B' if bit 7 is set, 'A' if bit 6 is set, 'M' if bit 0 is set, 'D' otherwise.
 
|0x09 || Byte || Flags. When listing files, BASIC displays 'P' if bit 5 is set, 'B' if bit 7 is set, 'A' if bit 6 is set, 'M' if bit 0 is set, 'D' otherwise.
 
|-
 
|-
|0x0A || Word || Number of bytes in the following data part (little-endian word)
+
|0x0A || Word || Number of bytes in the following data record (little-endian word)
 
|-
 
|-
 
|0x0C || Word || Segment of load address (little-endian word)
 
|0x0C || Word || Segment of load address (little-endian word)

Revision as of 10:08, 15 August 2014

File Format
Name IBM PC data cassette
Ontology
Released 1981

Yes, the IBM PC did have a cassette port at one point. Actually, only the original IBM Personal Computer model 5150, and the later PCjr (intended as a low-end home computer), had this; other PCs did away with this feature which was rarely used on this platform given that just about everybody got their PC with at least one disk drive. Apparently, though, IBM felt that when they made their entry into the PC field (after years of regarding small computers as "toys" unworthy of their attention) they needed to be sure their machine duplicated all the features present in other brands of personal computers around at the time, and most of them had cassette interfaces then because disk drives had been so expensive in recent history (and those computers were aimed at home/hobby markets with limited budgets). By the time of the IBM PC, disk drives had come down in price, while IBM's computers were aimed at a more upscale business/professional market, so cassettes saw little use there.

The format consists of 1-millisecond-long pulses for each 1 bit, and 0.5-millisecond pulses for each 0 bit. A tape record starts with a leader of 256 bytes of all 1 bits (hex FF), followed by a single synchronization bit (0), and then a synchronization byte (hex 16, the ASCII character from the C0 controls designated as SYN). This is followed by one or more 256-byte data blocks. Each data block is followed by a 2-byte CRC, with the most significant byte first. After the last block, a 4-byte trailer is written of all 1 bits (hex FF).

Files saved by IBM Cassette BASIC consist of two records: the first one is a header (always 256 bytes, of which the first 16 are significant), and the second one contains the data.

The header layout is:

Offset Size Description
0x00 Byte Always 0xA5
0x01 8 bytes Filename, ASCII
0x09 Byte Flags. When listing files, BASIC displays 'P' if bit 5 is set, 'B' if bit 7 is set, 'A' if bit 6 is set, 'M' if bit 0 is set, 'D' otherwise.
0x0A Word Number of bytes in the following data record (little-endian word)
0x0C Word Segment of load address (little-endian word)
0x0E Word Offset of load address (little-endian word)

References

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox