Hi Bill,
Below is a small standard C program for Unix or Linux which will read your
tape and convert it into a TAP format tape. Under FreeBSD I use
"/dev/nrst0" which is the non-rewinding version of the tape device 0. Your
particular system may require a different device name. The program is bare
bones but will do the job. If an error is encountered it simply stops. You
are welcome to add error handling and reporting etc.
TAP format tape records look like this:
---
4 byte record length (little endian)
n bytes tape record
4 bytes record length (little endian)
---
A typical tape images contains many records as shown above.
The trailing record length allows emulators to read a tape image backwards.
A Tape-Mark looks like this:
---
4 bytes of zero
---
An End-Of-Tape looks like this:
---
4 bytes of zeroes
4 bytes of zeroes
---
The C program is below. It requires only the standard C library.
---
#include <stdio.h>
static unsigned char buf[100000];
int main(int argc, char **argv)
{
FILE *of;
int mt;
int ic;
int zero = 0;
if (argc != 2)
{
fprintf(stderr, "Usage: mag2tap <TAP image file>\n");
exit(1);
}
if ((mt = open("/dev/nrst0", 0)) < 0)
{
perror("open");
exit(1);
}
if ((of = fopen(argv[1], "w")) == NULL)
{
perror("open");
exit(1);
}
while ((ic = read(mt, buf, sizeof(buf))) >= 0)
{
fprintf(stdout, " %d", ic);
fflush(stdout);
if (ic == 0)
{
zero += 1;
if (zero >= 2)
{
break;
}
}
else
{
zero = 0;
}
if (fwrite(&ic, sizeof(ic), 1, of) != 1)
{
perror("fwrite1");
exit(1);
}
if (ic > 0)
{
if (fwrite(&buf, 1, ic, of) != ic)
{
perror("fwrite2");
exit(1);
}
if (fwrite(&ic, sizeof(ic), 1, of) != 1)
{
perror("fwrite3");
exit(1);
}
}
}
fclose(of);
close(mt);
}
---
Please email me directly if you have any trouble understanding, compiling
or running this.
Tom
On Thu, Jul 2, 2026 at 1:17 AM Bill Degnan via cctalk <cctalk(a)classiccmp.org>
wrote:
I wanted to share some results I got when attempting
to read 800 bli NRZI
9-track tapes:
I have not been able to read any of the 800 NRZi Tapes. I tried a number
of things using four computers. My analysis is detailed below.
...