[Simh] PDP7 DECtapes
Bob Supnik
bob at supnik.org
Sat Jun 6 22:47:30 EDT 2015
Yeah, PDP-7 (and earlier) DECtapes are different. They use different
checksum algorithms, for one thing, and some early PDP-4 and -7 DECtape
controllers used four-word headers instead of five. The checksum is
probably key; only five "four word header" DECtape controllers escaped
the factory.
/* Checksum routine */
int32 dt_csum (UNIT *uptr, int32 blk)
{
int32 *fbuf = (int32 *) uptr->filebuf;
int32 ba = blk * DTU_BSIZE (uptr);
int32 i, csum, wrd;
#if defined (TC02) /* TC02/TC15 */
csum = 077; /* init csum */
for (i = 0; i < DTU_BSIZE (uptr); i++) { /* loop thru buf */
wrd = fbuf[ba + i] ^ DMASK; /* get ~word */
csum = csum ^ (wrd >> 12) ^ (wrd >> 6) ^ wrd;
}
return (csum & 077);
#else /* Type 550 */
csum = 0777777;
for (i = 0; i < DTU_BSIZE (uptr); i++) { /* loop thru buf */
wrd = fbuf[ba + i]; /* get word */
csum = csum + wrd; /* 1's comp add */
if (csum > DMASK)
csum = (csum + 1) & DMASK;
}
return (csum ^ DMASK); /* 1's comp res */
#endif
}
This is documented in the 18b PDP DECtape controller, based on sources I
have for PDP-7 DECtape code from the late 60s; but for some reason, I
never published a paper on it.
This is one reason why recovering DECsys required reading the DECtape on
the last working PDP-7 in the world.
/Bob
More information about the Simh
mailing list