Heath8080A — Product Design : Tape I/O
Page last updated
On this page
The Tape I/O processes were built early in the project. Some of the ideas of how to efficiently handle character pacing to and from high-performance devices were developed here and improved later in the project. Logically, this should be part of the Serial I/O package, but it was already written when Serial I/O was conceived so I let it be.
All H8 I/O must flow through the I/O package, which maintains minimal 8251 USART emulation. These routines provide the "glue" between the I/O package and the Macintosh disk system; this is all Macintosh code with nothing of the H8 system emulated here.
Tape File Format
Tape files contain all characters output by PAM/8 when it dumps a tape, with no other formatting or compression. The file format is binary. The contents, as written by PAM/8, are as follows:
The checksum was repeated as a convenient way to "flush" the 8251's output buffer before stopping the tape, thus making sure that the checksum had been recorded before stopping the tape. (In most other applications, a "pad" character — 377q — is used for this purpose, but rewriting the checksum took less PAM/8 code space.)
The emulator maps PAM/8 tapes to Macintosh disk files, using a creator of 'h8h8' and a type of 'h8tp'. The user must open an input or output file for the emulator before using the PAM/8 load (8) or dump (9) keys. The user must close an open file before opening another one.
Output tape files can be appended to until they are closed (it's possible, though probably silly, to have multiple dumps contained in a single disk file). All tape files are closed when the emulator is quit.
Any tape file opened using the Finder will be opened for input. If there was a file already open for input, that file is closed and the new file opened.
After successfully opening a Tape file, the Tape I/O package notifies the I/O package so that it can return the appropriate status bit(s) when PAM/8 reads the 8251 status register. When a Load file is open, the I/O package will return the receiver ready (RXR) status bit (0x02) on any IN to the tape control port, address 371q. When a Dump file is open, the I/O package will return the transmitter ready (TXR) status bit (0x01) on any IN to the port. These bits can be held high constantly while the file is open; since reading from / writing to buffer memory is nearly instantaneous, there was nothing to be gained by emulating the 8251 chip any more closely than that.
When an input file is open, any IN to the tape data port (370q) will return the next sequential byte from the open file. Once all bytes have been transferred, or if there is no file open, 000q is returned.
When an Output file is open, any OUTput to the tape data port will put the output byte in the next sequential position of the output buffer. If no file is open, the byte is ignored. The buffer is flushed when full and when the file is closed.
Dump — To dump memory to "tape," follow these steps:
Load — To load a dumped "tape," follow these steps:
This is the "neatest" way to dump and load. However, PAM will wait patiently for ready status from port 371q for either operation, so it is possible to open the dump or load file after pressing the dump or load key and the results will be the same.