MSX Tape I/O ------------- BIT AND BYTE ENCODING Information on tape is stored as square waves of 1200 or 2400 baud. The encoding used is FSK (frequency shifting key). The next table shows the relation between the selected recording speed, the bits and the pulses put on tape: bps bit encoding freq (Hz) _______ 1200 0 _______| | 1200 ___ ___ 1200 1 ___| |___| | 2400 ___ 2400 0 ___| | 2400 _ _ 2400 1 _| |_| | 4800 Each byte is put on tape as a sequence of 11 bits: 0 b0 b1 b2 b3 b4 b5 b6 b7 1 1 (one startbit, 2 stopbits, LSb first) Futhermore 2 kinds of headers are used: short and long, a long header being 4 times as long as a short one. They consist of a series of square wave pulses (bit value 1): bps header freq (Hz) nr of pulses 1200 short 2400 4000 (5/3 sec) 1200 long 2400 16000 (20/3 sec) 2400 short 4800 8000 2400 long 4800 32000 FILE FORMATS Files on tape are stored in two blocks. The first block is the filedescriptor, the second contains the filedata. Three types of files exist: BASIC file, memory dump and data file. BASIC File (CSAVE/CLOAD) filedescriptor: long header 10x #D3 (filetype) 6 bytes filename file data: short header tokenized BASIC 7x #00 memory dump (BSAVE/BLOAD) filedescriptor: long header 10x #D0 6 bytes filename file data: short header 2 bytes start address 2 bytes end address 2 bytes exec address memory dump data file (SAVE/LOAD/OPEN) filedescriptor: long header 10x #EA 6 bytes filename file data: short header block of 256 bytes short header block of 256 bytes .... last block contains 256x #1A (^Z/EoF)