Newbrain tape block format

Here is the format of a tape block:

Offset Field Size Description
0 Sync Byte 1 byte Always $00. Acts as a lead-in marker before the length.
1 Block Length 2 bytes Little Endian (Lo, Hi). Specifies the number of payload data bytes.
3 Data <Block Length> The actual payload data.
3 + Length Block Type 1 byte Bit 7: First block flag
Bit 6: Last block flag
Bits 0-5: Sequence number
4 + Length Checksum 2 bytes Sum of Block Length + Data + Block Type + $3B.
6 + Length Trailer (Zeros) 9 bytes Nine consecutive $00 bytes marking the end of the block.
OffsetFieldSizeDescription
0Sync Byte1 byteAlways $00. Acts as a lead-in marker before the length.
1Block Length2 bytesLittle Endian (Lo, Hi). Specifies the number of data bytes.
3Data<Block Length>The actual payload data.
3 + LengthBlock Type1 byteBit 7: First block flag
Bit 6: Last block flag
Bits 0-5: Sequence number
4 + LengthChecksum2 bytesSum of Block Length + Data + Block Type + $3B.
6 + LengthTrailer (Zeros)9 bytesNine consecutive $00 bytes marking the end of the block.

Leave a Reply