The 9845 Utilities Project

This project is just dedicated to all those little programs, which make the life with vintage computers (and the 9845 systems in particular) easier. There is no real plan for this project, it is just a collection of small utilites I've written in the past.

Utilities for the PC

Here's a summary of the programs which run on the PC side, in alphabetical order. See the following sections for details.

Utility Description
Add Simulates HP9845 BPC binary integer add instructions (ADA, ADB). Useful to analyze BPC arithmetics, e.g. for building checksums.
Analyzer GPIB analyzer ("sniffer"). Used to trace communication between any other devices connected to the same GPIB bus. Requires a NEC7210 based IEEE488 interface. Terminates either when being addressed over GPIB (talker or listener) or when the maximum number of 10,000 samples is reached.
Bmpconvert Converts between Windows BMP bitmap image files and 9845 bitmap image files with GSTORE format
Getfile Receives an arbitrary file from the GPIB bus.
Hp2txt Converts string based HP 9845 text files of type DATA (including BASIC files, saved with "SAVE") into DOS text files.
Ima2hpi Does the transformation from IMA disk images (esp. derived from TD0 images via Teledisk) back to hpi disk images (raw binary image format). Can be used together with Sergey Erokhin's Teledisk TDCVT unpacker and Dietmar Harlos's FDI2IMA utility in order to reproduce clean generic binary images from Teledisk archives.
Imggen Generates image file filled with 256-byte-block test pattern of arbitrary size. Quite useful for many test applications.
Invert Performs a bitwise negation on the whole file. Essential for 9845 ROM images.
Progalyze Can be used to analyze and modify files of type PROG (BASIC files in internal representation) and BPRG (binary programs), including removing line protection.
Rar Simulates HP9845 BPC binary integer rotate right instructions (RAR, RBR). Useful to analyze BPC arithmetics, e.g. for building checksums.
Romcheck Calculates validation & identification checksums for HP9845 ROM dumps. Uses the same checksum algorithm which is used by HP for establishing ROM integrity.
Rommerge Combines upper & lower ROM into one ROM block & lists ROM statistics like checksum etc. Takes inverted ROM images (as produced by a ROM dump) and outputs normal executable positive logic object code.
Sendfile Sends an arbitrary file to the GPIB bus.
Simhtool Provides functions on SIMH format magtape image files

Add

Simulates HP9845 BPC binary integer add instructions (ADA, ADB). Useful to analyze BPC arithmetics, e.g. for building checksums.

Syntax:

add <arg1> <arg2>

with <arg1> and <arg2> signed integers between -32768 and +32767. The result will be calculated including processor-internal extend and overflow flags.

Analyzer

GPIB analyzer ("sniffer"). Used to trace communication between any other devices connected to the same GPIB bus. Requires a NEC7210 based IEEE488 interface. The analyzer itself is configured to the GPIB address 20 and terminates either when being addressed over GPIB (talker or listener) or when the maximum count of 10,000 samples is reached. The current version works only under Windows 9x/ME and with a NEC µPD7210 compatible board at base address 0x2E0. The log is sent to standard output.

Syntax:

analyzer

Usage is as follows:

  1. Execute the analyzer utility with "analyzer > logfile".
  2. Start the HP-IB/GPIB activity you want to monitor.
  3. When finished, stop recording by sending a trigger to the GPIB address 20, e.g. from the 9845 with "TRIGGER 720".
  4. Examine the logfile for recorded data.

It should be mentioned here that this solution is no alternative to a professional GPIB analyzer. I call it 'poor man's GPIB analyzer' since it works with low-cost boards, too. If you need an affordable solution which works much better, try to get one of NI's GPIB+ boards offered at eBay. With some luck, an ISA based AT-GPIB+ can be acquired for less than $80, and the analyzer software is part of NI's standard NI 488.2 package which is available free of charge.

Bmpconvert

The Bmpconvert utility can be used to convert between standard windows bitmap format and the file format of the 9845B graphics. All 9845 display systems are now supported, including 9845B enhanced monochrome and 9845C color graphics. Color images can be converted between the different systems by using a BMP file as intermediate storage.

Syntax:

Usage: bmpconvert [<options>] <infile> <outfile>

with <infile> input image file and <outfile> output image file and <options> a combination of :
-bdat      produce BDAT format (default)
-data      produce DATA format
-standard  produce monochrome format for 98750A displays (default)
-enhanced  produce monochrome format for 98780A displays
-color     produce color data (needs three separate 9845C files for either input or output)
-info      output file info only (do not create or change files)

The BMP images must have the size 560 by 455 pixel with a color depth of 1, 4, 8 or 24 bit(s) per pixel. The utility automatically checks the <input_file>. If it is a BMP file, a 9845 image file is produced with the name <output_file>. It can be controlled with the -bdat and -data switches, whether a BDAT or DATA file shall be created (BDAT is the default). If not, Bmpconvert assumes the input file to be a 9845 image and tries to produce the appropriate BMP image file. The options -standard, -enhanced and -color specify the target system, and, of course, whether monochrome or color bitmaps are produced. Use the -info option in combination with a filename to see what kind of image data the file contains.

Please note that in color mode, there are three parts needed for BDAT or DATA files. Please specify only the first part as <infile> or <outfile>, the program then looks in the current directory for the remaining parts. You should use the convention naming the first part XXXXX1, the second part XXXXX2 and the last part XXXXX3, where XXXXX stand for an arbitrary filename with 1 to 5 characters.

Example:

bmpconvert -color SAMPL1.DATA sampl.bmp

converts the 9845 image consisting of the files SAMPL1.DATA, SAMPL2.DATA and SAMPL3.DATA into a Windows bitmap named sampl.bmp.

Also note, that when converting a Windows bitmap file into a 9845 image. Bmpconvert applies color reduction, but no dithering. If you need to convert e.g. a photograph, please use a conventional image editor like Photoshop with the appropriate 8-color-palette to do the dithering before applying bmpconvert.

More information on the way the 9845 saves graphics data can be found in the Tutorial on Using Bitmaps.

The MSDEMO program can be used on the 9845 to load, modify and save images in the various 9845 graphics formats (see the 9845 Mouse Project).

Getfile

Receives an arbitrary file from the GPIB bus. Once the program is started, it waits in device mode until it is addressed for a binary file transfer. The transfer is block-oriented, i.e. file data transmission is assumed in 256-byte-blocks, so the fast handshake feature can be used at the 9845 side. This also complies to the actual physical file size on the 9845, which is always a multiple of 256, the physical sector size.

By default, the file transfer is terminated by EOI asserted by the controller. This can happen at any time during the data transfer on the last byte which shall be written into the file. If EOI is asserted on the very first byte of a data block on a single byte of value 26 (ASCII EOF), it will be considered as EOF marker only and not be written into the local file copy.

If required, end-of-file can alternatively be indicated by a special EOF multi-character string, which must be at the start of the last data block as well, and then will not be written into the local file copy, too. Therefore, the last transmitted data block can be smaller than 256 bytes, if it is properly terminated with EOI asserted.

Getfile currently works only with compatible GPIB interface cards. Future support will probably include RS232 connections.

Syntax:

getfile [<options>][<output_file>]

If <output_file> is omitted and the -host option is not used, the user will be prompted for a filename. If <output_file> does not exist, it will be created automatically. Already existing files will be overwritten without warning.

Getfile can be configured with the following options:

Option Description
-h Output a summary of the command line options.
-a <address> Use <address> as primary GPIB address (default 20).
-host Assume the first received record as filename. The record can either be terminated by CR, LF or both. Use this option if the filename shall be controlled by the remote host.
-trailer Send a checksum to host after file data has been received. Checksum is a signed 16-bit arithmetic sum over all received data words.
-loop Enable multi-file mode (loops until CTRL-C is pressed). If one file has been completed and the -host option has not been used, the user will be prompted for the next filename after each transfer.
-eof <string> Specifies use of special end-of-file marker string. <string> must be enclosed in double quotes. At the first occurrance of <string> at the beginning of a data record the transmission will be terminated.
-l <loglevel> Specify a higher detail of reporting. Normal is loglevel 2. Use 0 for quiet operation and 3 or 4 for diagnostic purposes.
-p Show transfer progress (one dot per 256 bytes, will be directed to standard error)
-v Show detailed activity reporting. At the end of a transmission, the number of received blocks and bytes, the transmission speed and the checksum will be printed.

Here is a simple 9845 program to work with the getfile program:

100   INTEGER Buf(127)
110   ! -- Fill buffer with random pattern --
120   FOR I=0 TO 127
130     Buf(I)=RND*65536-32768
140   NEXT I
150   Blocks=50         ! File size in 256-byte-blocks (example)
160   Target=20         ! PC remote GPIB address
170   Target=Target+700 ! Add interface select code
180   Checksum=0
190   ! -- Send data with fast handshake --
200   FOR I=1 TO Blocks
210     OUTPUT Target BFHS  NOFORMAT;Buf(*)
220     Checksum=(Checksum+SUM(Buf)+32768) MOD 65536-32768
230   NEXT I
240   ! -- Terminate transfer --
250   EOI 7;26
260   PRINT "Local checksum: ";Checksum
270   END

Note that an integer array is used as I/O buffer instead of a character string in order to simplify the calculation of a checksum.

On the PC, getfile can receive data from the program above when executed as

getfile <output_file>

Start the getfile program before running the 9845 program. Use the -v option to obtain a checksum for comparison with the checksum on the 9845 side.

Note: Actually, the getfile program may be used to generally capture and sink data sent to a specific address on the HP-IB bus. Just as an example, you can choose to redirect all standard printer output on a 9845 with "PRINTER IS <select code>,<hpib-address>". If you - say - start getfile on the PC side, you can use for example "PRINTER IS 7,20" on the 9845 to direct the output of LIST, CAT, PRINT and so on across the HP-IB bus into the file specified with getfile. The only restriction is that getfile waits for buffers of size 256 bytes to get filled before writing them to the file. So, for making sure that all data is written, use "EOI 7;26" at the end of each transfer to flush the buffers.

HP2txt

Converts string based HP9845 text files (including BASIC files, saved with "SAVE") into DOS text files.

Syntax:

hp2txt <input_file> [<output_file>]

If <output_file> is omitted, the result will be sent to standard output.

Ima2hpi

Does the transformation from IMA disk images (esp. derived from TD0 images via Teledisk) back to hpi disk images (raw binary image format with ordered sectors). Can be used together with Sergey Erokhin's Teledisk TDCVT unpacker and Dietmar Harlos's FDI2IMA utility in order to reproduce clean binary images from Teledisk archives.

Syntax:

ima2hpi [<options>] <input_file> [<output_file>]

with the following options:

Option Description
-h Output a summary of the command line options.
-c <cylinders> Specifies cylinder count of the original medium (overrides autodetect)
-h <heads> Specifies head count of the original medium (overrides autodetect)
-s <sectors> Specifies sectors per track of the original medium (overrides autodetect)
-r <sector_size> Specifiies sector size of the original medium (overrides autodetect)
-j <track_junk> Specifies number of extra bytes at the end of each track (default is 0)
-i <interleave> Specifies n:1 interleave factor of the original medium (overrides autodetect)
-cs <cylinder_skew> Specifiies cylinder skew of the original medium (default is 0)
-hs <head_skew> Specifies head skew of the original medium (default is 0)
-sc <skewcount> Specifies the number of tracks to be skewed (default is all tracks)
-cskip <cylinder_skip> Specifies how many cylinders should be skipped in case the image was created from a medium which had been formatted first with high and then with low track density (default is 1 for no skip, chose 2 for double formatted media)
-hskip <head_skip> Specifies how many cylinders should be skipped in case the image was created from a medium which had been formatted first with more than one single head and then with lower head count (default is 1 for no skip, chose 2 for double formatted media with two heads)
-l <control_file> Use a TDCVT v0.11 output file as control file for the transformation. This should be the standard way to do the transformation because it is most reliable.
-m <match_list>

Use a list of known address transformations of the form

<count> <from> <to> [<from> <to> [...]]

where <count> is the total number of pairs and <from> a record number with known byte position <to> in the input file. The more pairs are specified, the more precise will be the heuristic. Actually it is more brute force than heuristic...

-v

Produce verbose output.

The recommended way to transform Teledisk images into hpi disk images is with a small command script TD2HPI.BAT which is included in the TD2HPI archive under the download section at the end of this page. If the Teledisk image is ABCDEF.TD0, just execute

TD2HPI.BAT ABCDEF

in the same directory. Please note that you have to omit the file extension .TD0, and also a couple of other programs must be present in the directory (tdunp.exe, tdcvt.exe, fdi2ima.exe, ima2hpi.exe).

See the Software Section for more information on how to use this utility.

Imggen

Generates image file filled with 256-byte-block test pattern. Quite useful for many test applications.

Syntax:

imggen <size> <image_file>

where <size> is the image size in bytes (must be a multiple of 256) and <image_file> is the filename of the newly created image.

Invert

Performs a bitwise negation on the whole file. Essential for 9845 ROM images.

Syntax:

invert <input_file> <output_file>

where <input_file> is the original file and <output_file> is the filename of the newly created bit-inverted file.

Progalyze

Can be used to analyze and modify files of type PROG (BASIC files in internal representation) and BPRG (binary programs), including removing BASIC line protection. A simple but powerful tool when handling program or binary program files.

Syntax:

progalyze [<options>] <input_file> [<output_file>]

where <input_file> is the file of type PROG or BPRG to be analyzed and <output_file> is the filename of the processed file. <output_file> is required when using the -unsecure option.

Without options, progalyze prints an overview of the binaries, keywords and program modules included in the input file. Use the -v option to obtain a complete analysis.

Progalyze can be configured with the following options:

Option Description
-h Output a summary of the command line options.
-binary tell progalyze that the file to be analyzed is a binary program file of type BPRG. Only the binary part of the header is read, so if there are normal BASIC program modules included, this option will produce junk output. In case of doubt, omit this option. This option is the default for files of type BPRG.
-program tell progalyze that the file to be analyzed is a program file of type PROG, which may or may not contain binary programs. This is the default for all files except those with file name extension .BPRG.
-rom tell progalyze that the file to be analyzed is a ROM image (rather than a disk of tape binary program file). No file header is read. Not really a ROM analysis feature, because ROMs are using a more complex keyword linking, however in combination with -offset better than nothing.
-offset starts analysis at a certain word offset in the file. Note that each word corresponds to two bytes, so a byte offset has to be divided by two.
-unsecure converts all secured lines (if they exist) into unsecured lines and so makes protected BASIC listings readable. Producing an unsecured file requires the use of <output_file> as additional parameter.
-extract extract all binaries and/or program modules as separate files. Binary programs are - if possible - named after their ID string with file name extension .BPRG. Program modules are saved into a combined file with file name extension .PROG. If desired, progalyze can be run after separately on the produced files. If no <output_file> is specified, the PROG part of the input file will be saved to a new file with "-out" added to the original filename.
-v output detailed analysis (instead of printing just an module/keywords overview). Can be used to get all address data, secured/unsecured linenumbers, and even the labels and statements used in program files.

Rar

Simulates HP9845 BPC binary integer rotate right instructions (RAR, RBR). Useful to analyze BPC arithmetics, e.g. for building checksums.

Syntax:

rar <arg1>

where <arg1> is a signed integer between -32768 and +32767.

Romcheck

Calculates validation & identification checksums for HP 9835/9845 ROM dumps. Applies the same checksum algorithms which are used by HP for establishing 9845A and 9835 or 9845B/C ROM integrity. The check is performed blockwise and does two checks in parallel, one for validation of ROM integrity and one for calculating an individual ROM checksum for ROM identification.

Standard blocksize is 4096 bytes (9835 and 9845B/C ROMs) with validation by enhanced checksum algorithm. For 9845A a blocksize of 1024 bytes and plain checksum algorithm has to be selected ('romcheck -plain -blocksize 1024').

Syntax:

romcheck [-plain][-blocksize <blocksize>] <input_file>

where <input_file> is the ROM image which is to check.

Options:

Option Description
-h Output a summary of the command line options.
-plain use simple integer arithmetic checksum algorithm for ROM validation instead of enhanced checksum (enhanced checksum algorithm is default)
-blocksize <blocksize> apply checksum to blocks of size <blocksize> (default is 8192 bytes)

Rommerge

Combines upper & lower ROM into one ROM block & lists ROM statistics like checksum etc. Takes inverted ROM images (as produced by a ROM dump) and outputs normal executable positive logic ROM code.

Syntax:

rommerge <high_rom> <low_rom> <output_file>

where <high_rom> is the dump of the ROM with the upper byte and <low_rom> is the dump of the lower byte. The result will be merged into <output_file>.

 

Sendfile

Sends an arbitrary file to the GPIB bus. Once the program is started, it waits in device mode until it is addressed for a binary file transfer. Ahead of the file data transfer, the program can be configured to send one record with the filename and file size in bytes. By default, the file transfer is terminated either by reaching the end of the file or by being UNTALKed at the GPIB. After the file data transfer has been completed, the program can optionally send another record with an end-of-file marker string and/or a checksum to the host. File data transmission is done in 256-byte-blocks, so the fast handshake feature can be used at the 9845 side. This complies also to the actual physical file size at the 9845, where the space occupied by a file is always a multiple of 256 (the physical sector size). If the local file size is not a full multiple of 256, the remaining bytes are padded with zero. If an UNTALK happens in the middle of a block transfer, the transfer is immediately aborted (no further data is sent).

There is one speciality with the 98034A/B HP-IB interfaces: Once a record has been received with an ENTER statement, the remote device keeps being addressed to talk, and data sent from the device is taken from the bus by the 9845 HP-IB interface. If the next ENTER command is not issued immediately after the previous ENTER, bytes will be dropped at the 9845 side. Since a PC is much faster than a 9845, this generally is a problem. A simple workaround is to hold off the PC until the 9845 program is ready to take over the data, which can be indicated e.g. by a trigger event on the GPIB bus. With the -trigger option, the sendfile program waits for a trigger event from the 9845 before sending any record.

Important note: In case you are communicating with a 98034 interface at the host side, use of the -trigger option is mandatory. Otherwise the transfer will not work.

Sendfile currently works only with compatible GPIB interface cards. Future support will probably include RS232 connections and other GPIB chips.

Syntax:

sendfile [<options>][<input_file>]

If <input_file> is omitted, all file data will be grepped from standard input.

Getfile can be configured with the following options:

Option Description
-h Output a summary of the command line options.
-a <address> Use <address> as primary GPIB address (default 20).
-host Assume the first received record as filename. The record can either be terminated by CR, LF or both. Use this option if the filename shall be controlled by the remote host.
-header Send a trailing record with filename and file size before any file data ist sent. Can be used by the host to create a file of the proper size where the data can be routed.
-trailer Send a checksum to host after file data has been received. Checksum is a signed 16-bit arithmetic sum over all received data words.
-trigger Wait for a GPIB trigger before sending each data record. Simplifies sending data to the 9845.
-loop Enable multi-file mode (loops until CTRL-C is pressed). If one file has been completed and the -host option has not been used, the user will be prompted for the next filename.
-eof <string> Specifies use of special end-of-file marker string. <string> must be enclosed in double quotes. The string will be sent immediately after the last file data and can be used by the host to identify the end of the transmission.
-l <loglevel> Specify a higher detail of reporting. Normal is loglevel 2. Use 0 for quiet operation and 3 or 4 for diagnostic purposes.
-p Show transfer progress (one dot per 256 bytes, will be directed to standard error)
-v Show detailed activity reporting. At the end of a transmission, the number of received blocks and bytes, the transmission speed and the checksum will be printed.

Here is a simple 9845 program to work with the sendfile program:

100   INTEGER Buf(127)
110   Target=20         ! PC remote GPIB address
120   Target=Target+700 ! Add interface select code
130   Checksum=0
140   ! -- Receive header with filename & file size --
150   TRIGGER Target
160   ENTER Target;Filename$,Filesize$
170   Size=VAL(Filesize$)
180   Blocks=INT((Size+255)/256)
190   ! -- Recive data with fast handshake --
200   FOR I=1 TO Blocks
210     TRIGGER Target
220     ENTER Target BFHS 256 NOFORMAT;Buf(*)
230     Checksum=(Checksum+SUM(Buf)+32768) MOD 65536-32768
240   NEXT I
250   ! -- Transfer finished --
260   PRINT "Local checksum: ";Checksum
270   END

Note that an integer array is used as I/O buffer instead of a character string in order to simplify the calculation of a checksum.

On the PC, sendfile can send data to the program above when executed as

sendfile -header -trigger <output_file>

Start the sendfile program before running the 9845 program. Use the -v option to obtain a checksum for comparison with the checksum on the 9845 side.

 

SIMHtool

The SIMH magtape format as defined for the SIMH Computer History Simulation system (see simh.trailing-edge.com) is not suitable for CS/80 tape drive emulation without some special restrictions (see the HPDrive Project Section for more information on the SIMH magtape format for CS/80 emulation).

SIMHtool is a program which provides a couple of useful functions for creating, checking, inspecting, formatting and converting to and from other image formats. It in general works on both standard SIMH magtape images (as specified here) and on SIMH magtape images suitable for CS/80 emulation (as described in the HPDrive Project Section). It also can be used to convert SIMH magtape images to and from standard binary images (such as hpi images).

Syntax:

simhtool [<command>][<options>][<image>[<target>]]

where <image> is the image file to work on and <target> is the image file to be produced with the -convert command.

SIMHtool can be run with the following commands:

Command Description
-convert

Convert between different image formats (default command).

The target format should be specified using the -format option (see options below). SIMHtool automatically determines the source format, however it is good practice to use the correct file name extensions (.hpi for binary images, .simh for SIMH magtape images) for both the source and the target image.

Note that conversion from standard SIMH magtape images to SIMH magtape images intended for CS/80 may be performed either with or without preserving the original record structure (see -p option below for details).

In case binary images (such as hpi images) are to be converted to SIMH magtape images, a fixed record size of 1024 bytes is assumed unless specified differently with the -b option as described below. Note that when converting SIMH magtape images to binary image files all additional information contained in the SIMH magtape image such as record structure, tape/file marks, end of medium markers or erase gaps will get lost.

-info Show some information on the image.
-initialize <count>

Create SIMH magtape image with <count> empty records. Use -format option as described below to specifiy whether the image should comply to the CS/80 emulation rules.

The created image file will be unformatted, i.e. there will be no data or tape/file marks contained in the newly created images.

For standard SIMH magtape format images no record structure will be created (actually, an empty image will be created), however SIMH magtape image files intended for CS/80 emulation will be created with the appropriate record structure. In the latter case a CS/80 defined record size of 1024 bytes will be assumed (unless specified differently with the -b option as described below).

-extract <record> Extract record content within image derived from record number <record>. The first record in an image has record number 0. Use 'all' instead of a record number to extract all records into subsequently numbered files (may result in creating many individual files!).
-dump <record> Output singe record content as hex listing. The first record in an image has record number 0. Use 'all' instead of a record number to output the content of all records.
-getfile <fileno> Extracts file content within image derived from <fileno>. The first file has number 0. Use 'all' instead of a file number to extract all files into subsequently numbered files.
-add <filename> append one single record with data from <filename> at the end of the tape.
-check Perform an integrity test on the image only. Can be used in combination with -l 2 to output the internal record structure of the image (including markers).
-erase <pos> <size> Erase <size> number of bytes starting at <pos>. The first record in an image has record number 0. Erase is done by overwriting the specified range with erase gap markers. <pos> has to be an even number.
-tm <pos> Write tape mark (used as file mark within CS/80 emulation) at file byte position <pos>. The first record in an image has record number 0. <pos> has to be an even number.
-eom <pos> Write EOM marker at file byte position <pos>. The first record in an image has record number 0. <pos> has to be an even number.

SIMHtool can be configured with the following options:

Option Description
-<format>

Use <format> as target format for -initialize/-convert.

<format> can be one of

'hpi': initialize/convert to hpi binary (raw/pure payload data) image file
'simh': initialize/convert to SIMH standard magtape image file
'fixed': initialize/convert to SIMH fixed block size image suitable for CS/80 emulation

-p

Use block packing (optimize space usage) for fixed blocks when converting a standard SIMH magtape image into an SIMH magtape image suitable for CS/80 emulation.

Conversion from a standard SIMH magtape image to a SIMH magtape image suitable for CS/80 emulation can in be done in two ways:

  1. All records included in the SIMH magtape image are transferred into fixed size data blocks retaining the original record size. Records exceeding the CS/80 defined record length will be distributed among more than one data block. Advantage of this method is that the original record length information will be preserved, at least as long as the CS/80 defined record size is not exceeded. However, in case the original image contains many small records, much space will be wasted by padding to the CS/80 defined record size.
  2. The payload data of the SIMH magtape image is flattened and all data is distributed equally among the data blocks, which results in most efficient data packing but losing the record structure of the original image.

Which method should be applied depends on the nature of the data. In general, in case the original record structure is of importance, the first method should be used, and the second method otherwise. The first method is applied as default bus may produce rather large files. In order to use the second method, use this option.

-b <size> Assume/use <size> for defined CS/80 record size in bytes (default 1024) for operations on SIMH magtape format images with fixed block size suitable for CS/80 emulation.
-f Pre-format image file with zeros (fixed block size only).
-l Specify a higher detail of reporting. Normal is loglevel 2. Use 0 for quiet operation and 3 or 4 for diagnostic purposes.
-lf <logfile> Use <logfile> instead of standard output for logs.
-license Show license info.
-h Output a summary of the command line options.
-v Show detailed activity reporting. At the end of a transmission, the number of received blocks and bytes, the transmission speed and the checksum will be printed.

Examples:

simhtool -info mytape.simh show some information on the tape image
simhtool -analyze mytape.simh output a detailed analysis of the tape image in XML style notation
simhtool -fixed tape1.simh tape2.simh convert standard to fixed block size suitable for CS/80 emulation
simhtool mytape.simh mytape.hpi convert SIMH magtape image to binary (raw) data format
simhtool -test -l 2 mytape.simh output tape file structure
simhtool -dump 7 mytape.simh output content of 8th record (record #7)
simhtool -getfile all mytape.simh extract all individual files contained in the tape image
simhtool -erase 0 512 mytape.simh write 512 bytes erase gap at tape start

 

Utilities for the 9845

Here's a summary of the programs which run on the HP 9845 side, in alphabetical order.

Utility Description
Memtool/45 Can be used to view arbitrary memory areas including firmware as hex dump. Supports printing hex dumps on the internal printer and saving memory areas (including the complete firmware) either to mass storage or via HP-IB connection to the PC. Memtool now is available in two flavours, one version which uses assembler routines and can be run from both 9835A/B and 9845B if the required assembler ROM is available, or another version running on a 9845B only which uses the FTBIN binary program to access system memory, so no assembly ROM is required any more.
Tapetool/45 Can be used to perform multiple operations on tape cartridges, including tape positioning, tape verify, tape erase, and sector-by-sector duplication of tape content. Supports saving and restoring tape content 1:1 on mass storage or via HP-IB connection to the PC. Gives some help on handling even partly defective tapes. See the Saving Tapes tutorial on how to preserve tape contents with the Tapetool/45 program.

Memtool/45

This utility is meant for examining and saving portions or whole memory blocks (both read/write memory and ROM). Primary reason to write this tool was to provide means to preserve ROM data, however it can also be used simply to get a look into the 9845's overall memory map.

Accessing memory is not implemented into the HP BASIC language. Actually, everything which goes towards direct access of system resources had been avoided by HP intentionally. So, for example, neither PEEK nor POKE are available as part of the HP BASIC language command set. Main reason probably was to avoid everything which might lead to instability of the system, however also the internals of the HP BASIC OS could be hidden for the too curious hacker. Several security features like 'secured' (hidden) source lines rely on this opacity of the system.

Anyway, since we want to get a look into memory, this is the utility which can be used. System functionality not available within BASIC is added either via binary programs, or, alternatively, via an assembly language module. If you own an Assembly Execution & Development ROM (or at least an Assembly Execution ROM), you can use the assembly routines on both the 9835A/B and the 9845B system. If you do not own such option ROM, simply use the version with some special binary programs as supplied for the 9845B only. It doesn't matter whether to use the assembler or the binary program version, both programs offer exactly the same functionality:

MDUMP Screenshot

MTOOL Screenshot

The files included in the distribution image are:

MTOOL.PROG Memtool/45 BASIC program for the HP 9845B including all needed binary programs
MTOOL_.DATA Memtool/45 BASIC source of the above program, in DATA format without (required) binary programs
MTOOLA.DATA Memtool/45 BASIC plus assembly language source of the Memtool/45 program. Can be used both on the HP 9835A/B and the HP 9845B with Assembly Execution & Development ROM, or, with changes in a single line of code, with the Assembly Execution ROM
MCPY35.ASMB Precompiled assembly program for use with MTOOLA.DATA and Assembly Execution ROM on the HP 9835A/B
MCPY45.ASMB Precompiled assembly program for use with MTOOLA.DATA and Assembly Execution ROM on the HP 9845B
   

To use this program, simply start HPDrive with the image, chose which version is suitable for your needs, and use LOAD (for MTOOL) or GET (for MTOOLA) on the selected file.

If you own an Assembly Execution & Development ROM, simply RUN the MTOOLA program without changes. If using the version for Assembly Execution ROM, comment out line 1100 of MTOOLA and remove the comment from either line 1110 or 1120 depending on whether you are using an HP 9835A/B or an 9845B system. Then the precompiled assembler module should be loaded after running the program as appropriate. Don't forget to use MASS STORAGE IS accordingly.

Usage of this program is mostly self-explanatory. Remember that depending on whether you are using byte or word mode, the same memory location will be identified by different address values. Block and address values are either input in decimal mode (for the view function) or in octal mode (for the save function). Output is always in hexadecimal notation.

If transferring memory contents to a remote host via HP-IB, a proper 98034A/B HP-IB interface is required. The data on the PC side can be captured with the Getfile utility from the above PC software section.

Tapetool/45

This utility provides comprehensive functionality to deal with DC100 tapes. Main purpose again is to preserve data from old tape cartridges before it gets lost due to aging. But Tapetool/45 can do much more, it can be used to position the tape to a certain record number (including spooling and rewinding tapes), to dump or restore files, selected ranges of records or complete tracks, to view tape directories, to verify tapes for data integrity and to produce identical tape duplicates (which mostly can't be done with normal BASIC commands).

The program provides useful logging about all steps either to screen or to printer for later documentation. Alle errors which are registered during the selected operations are being logged and can be listed after the operation is completed either to screen or to printer.

Data save and restrore can be done either from images stored on mass storage or by transferring data to or from a remote host via HP-IB. For using the HP-IB connection, both a 98034A/B HP-IB interface and a proper GPIB board on the host's side is required.

Much effort has been spent to make the Tapetool/45 also useful for saving partly damaged DC100 tapes, which, unfortunately, is more the rule than the exception. Special care has been taken not to stress the fragile tapes too much during preservation. An important point had been to tune the read process as fluent and smooth as possible by using large scale buffering and nearly gap-less capture processes. However, some experience is required to use Tapetool/45 for such kind of reconstruction work, see the Saving Tapes Tutorial for more information how to deal with the variety of tape medium and tape drive defects.

 

Screenshot TDUMP

TDUMP Screenshot

The files included in the distribution image are:

TTOOL.PROG Tapetool/45 BASIC program for the HP 9845B including all needed binary programs
TTOOL_.DATA Tapetool/45 BASIC source of the above program, in DATA format without required binary programs
   

To use this program, simply start HPDrive with the image, chose which version is suitable for your needs, and use LOAD on the TTOOL program file.

All functions are menue based, so simply select the desired operation and follow the step-by-step instructions. If transferring tape contents to or from a remote host via HP-IB, a proper 98034A/B HP-IB interface is required. The data on the PC side can be captured with the Getfile utility or sent with the Sendfile utility (with -trigger option), both described from the above PC software section.

Tapetool/45 is one of the larger 9845 program I have written, it covers roughly 1,000 lines of code, although the program makes heavy use of binary programs for doing low-level system tasks. Actually, there is also a version of even higher complexity which uses self-written assembly routines for the same low-level tasks requiring one of the Assembly ROMs for operation.

Downloads

Click here for downloading the 9845 utilities:

9845 Utilities for PC 1.03 beta Windows 9x/ME executables: 9845utilities-PC-103beta-bin-win9x.zip
9845 Utilities for PC 1.03 beta Windows NT/2000/XP/Vista executables (needs DlPortIO driver for Analyze): 9845utilities-PC-103beta-bin.zip
9845 Utilities for PC 1.03 beta source code package: 9845utilities-PC-103beta-src.zip
Getfile and Sendfile 2.0 beta 3 Windows 9x/ME/NT/2000/XP/Vista/7/8/10 executables: filetransfer-20beta3-bin.zip
Simhtool 1.06 beta executable: simhtool-106beta.zip
9845 Utilities 4.0 for 9845 disk image (hpi file): 9845utilities-9845-40-hpi.zip
9845 Utilities 4.0 for 9845 BASIC listings: 9845utilities-9845-40-listings.zip
TD2HPI utility to convert Teledisk images into hpi images (won't work on 64 bit Windows): Teledisk-to-hpi-utility.zip

The beta versions may still have a couple of bugs. Please use the contact feature to let me know if something doesn't work as expected.

Some utilities make use of the GPIB. For ISA GPIB boards under Windows NT/2000/XP/Vista/Win7/Win8/Win10 the necessary Portio driver is included in my driver package. Alternatively, the DlPortIO driver package can be downloaded here.

Please note that the utilities which are intended for execution on the 9845 side generally include binary programs which are not covered by the BASIC source code listings. So please execute the programs from the disk image and do not load the BASIC listings for execution.