9

I successfully digitized a vintage (1976) cassette tape of Altair 8k BASIC V3.2 to a .wav file. Using an audio editor the waveforms look very clean, and minimodem seems to have successfully decoded it to bytes.

I know in the tape format there is leader, followed by the checksum loader (bytes in reverse order) followed by carrier, followed by packets for BASIC. I can see these in the byte stream and manually decoded the first few instructions of the checksum loader -- it looks good, but I'd like to know if anyone has a reference or knows the format for the BASIC packets.

I recall each packet starts with a start byte indicating the packet type, and for data packets there is a checksum, a length, and an address to load to... but I don't recall the details. I could reverse engineer the checksum loader, but there is a risk that the copy wasn't good and I'd get lead astray with bad data.

5
  • 1
    i analysed the checksum loader on the tape. i found theres only two simple packet types. one for code and one for a start address. once ive completed my task ill write a good answer to this question
    – scm
    Commented Apr 14 at 0:10
  • I'm assuming you already know this, but the Altair 8800 Clone web site has BASIC cassette loader files available if you need to verify the integrity of your cassette. Commented Apr 14 at 13:16
  • 1
    @NoelWhitemore yes, I've been there... I'm pretty sure their version for 8k basic is 4.0, mine is 3.2.. but I have verified that the .wav file I made passes checksum tests on all the packets... I'm writing code right now to patch in my IO port addresses (can't use basic's existing code for port configuration)... and so the big test will be to just run it and see if it works.
    – scm
    Commented Apr 14 at 18:44
  • They do have the 3.2 version as that's where I got a copy from for testing. Good luck! Commented Apr 14 at 19:07
  • 1
    i finished what I needed to do, I got Altair basic running on my Z80 board... I've posted an answer to the question in case anyone else wants to decode a vintage tape
    – scm
    Commented Apr 25 at 20:55

1 Answer 1

7

I'll answer my question. There are some basic things you'd need to know in order to pull bytes in from an original Altair 8K BASIC cassette tape.

In my case I wanted to decode the tape to a file and end up with a binary file... so I used minimodem to decode the tape to a file of binary bytes (minimodem is a nice software FSK modem program, follow the link to github, or it may be available on your systems package manager). If you're using a cassette tape interface, all of the following still applies in order to decode the byte stream.

This tape starts with a leader of 0xae bytes. That happens to be the length in bytes of the checksum loader which is found at the beginning of the tape.

After the last 0xae, there follows 0xae bytes of the checksum loader, and importantly, the loader is stored on the tape in reverse byte order. They were ever concerned with code compactness and so in order to minimize the number of bytes for the first level bootstrap loader that the user had to toggle in, they stored the checksum loader in reverse byte order, so they could use a simple decrement and test for zero to know when to stop.

Following the checksum loader is a number of null bytes (0x00).

After the nulls are the packets that make up BASIC. The first byte of a packet denotes the packet type. There are only 2 types of packets on the remainder of the tape: 0x3c packets, which contain BASIC code to be loaded, and a single 0x78 packet that indicates the end of the basic load and provides a start address.

The 0x3c packets have the following format:

0x3c -- the packet tag
0x?? -- the number of bytes (n) in the payload of the packet
0x?? -- the low byte of the address into which to load the data
0x?? -- the high byte of the address into which to load the data
0x??... n data bytes to be loaded
0x?? -- An 8 bit checksum of the packet, not including the tag and length.

the 0x78 packet has the following format:

0x78 -- the packet tag
0x?? -- the low byte of the start address
0x?? -- the high byte of the start address

You should note that the data packets generally load in increasing memory address order, but the last packet loads back at page zero.

2
  • Could you explain what "minimodem" is?
    – cjs
    Commented Apr 25 at 22:31
  • 1
    @cjs I added a link to the minimodem github page, and explained that it is a software fsk modem.
    – scm
    Commented Apr 25 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .