369 Cassette tape format The format of each block of data stored on cassette is given here for those whowish to produce tapes on other machines that may be read into the BBC Microcomputer. – Five seconds of 2400Hz tone. – One synchronisation byte (&2A). – File name (one to ten characters). – One end of file name marker byte (&00). – Load address of file, four bytes, low byte first. – Execution address of file, four bytes, low byte first. – Block number, two bytes, low byte first. – Data block length, two bytes, low byte first. – Block flag, one byte. – Spare, four bytes, currently &00. – CRC on header, two bytes. – Data, 0 to 256 bytes. – CRC on data, two bytes. Notes: 1.
Each data block has its own header as shown above. 2. Load and execution addresses should have the top two bytes set to &FF in 8 bit machines. 3. Bit 7 of the block flag is set on the last block of a file. 4. CRC stands for cyclic redundancy check. The header CRC acts on all bytes from the file name to the spare bytes inclusive. The data CRC acts on the data only. CRCs are stored high byte first and are calculated as follows. In the following C represents the character and H and L represent the high and low bytes of the CRC. H=C EOR H FOR X=1 TO 8 T=0 IF (bit 7 of H=1) THEN HL=HL EOR &0810:T=1 HL=(HL*2+T) AND &FFFF NEXT X The above algorithm is not a BASIC program!