On Wed, Apr 16, 2025 at 8:01 PM Peter Ekstrom via cctalk <
cctalk(a)classiccmp.org> wrote:
I have also seen the simh tape tools but there
doesn't seem to be a tool to
convert a simh file back to what would be on a real tape.
Anyone have any information or pointers to get this to work?
SIMH tape format inserts 4 bytes before and after each tape record. The 4
bytes
hold a 32-bit record length, and that length is placed both before and
after the
record to allow a tape to be read backwards. If the record is an odd
number of
bytes it is padded to be an even number by adding a zero byte. The length
should
indicate the 'true' (odd) record length in such cases. File marks on the
tape are
indicated with a single 4-byte marker of all zero bytes. The practice of
indicating end of tape with 2 consecutive file marks would be represented
by having 8 zero bytes.
Because a tape can contain arbitrary-sized records, there is no simple way
to convert a SIMH tape file to a 'real' tape image short of writing it to a
real
tape. That is, a 'tape image' would need to have some way to encode the
record lengths and presence of file marks.
But if you happen to know that your tape contains all the same-size records
or that the program reading the tape won't care what the record size is, and
you don't need to preserve file marks, you can strip out all those markers.
There are tools out there to 'enblock' and 'deblock' tape images, for
example
the TUHS archive has one but it's buried here:
https://www.tuhs.org/Archive/Distributions/Research/Bug_Fixes/V6enb/
That folder contains mostly stuff for working with Unix 6th Edition; you can
safely ignore everything besides the enblock/deblock utilities.
-ken