1980s Vintage Computers |
|||
Converting a HP-85 program to a HP-9915 EPROMThese notes describe how to convert an HP-85 Basic program from floppy disk into an EPROM, so that it can be permanently loaded. The picture above shows my 9915B running the initial 'HELLO WORLD' program from EPROM. I am thinking of modifying the HP-85 CLOCK program for the 9915, and using the operator buttons rather than the keyboard to set the time and alarm. I developed this method partly to show it could be done, and hopefully to allow others to make use of their 9915s. Please feel free to modify these programs, and please e-mail me with any success stories or problems. BackgroundThere was a suite of original HP software for the 9915 that performed this conversion, the files to look for are TAPDUP (binary program) and IMAGE (Basic program). These programs read a Basic program from tape or disk and write the content to a data file. This is then formatted for an EPROM programmer using the DIOix Basic program. If anyone has all these please post a message! A key part of the process is the checksums added to each record and the file directory. I initially tried to generate checksums on a PC, but couldn't find an algorithm that matched the checksums needed by the 9915, so ended up using the CHECKSUM function from the Program Development ROM. The method described here is broken down into six steps:
The 9915 loads files from EPROM in a similar way to a LOAD from disk, where the program is stored in a tokenized format rather than ASCII text. The EPROM contains a directory of files, but there is no means to list the directory using the 9915, so you have to keep a list. If there is a file is called Autost, it will be loaded and run on power-up. Note that the HP-9915 PROM board has jumpers for either 2716 (2K byte) or 2732 (4K bytes) EPROMs. I had to solder the links on mine as I used a 2732 EPROM. This gives a maximum storage space of 32K bytes. I have only copied a small program file that easily fitted in a single EPROM, larger programs or several small programs would require more than one EPROM. DocumentationI used the following HP-9915 manuals as guidance:
These manuals can be downloaded from the HP Computer Museum of Australia (thanks to Jon Johnson for his dedication in scanning so many very hard to find manuals). Equipment neededHere's a list of equipment needed for this method:
Step 1 - copy Basic program to blank floppyPlease see pages 4-10 onwards of the HP 9915 System Development Manual to find out how to reduce the size of the Basic program (eg use COM statement so no variables are allocated). Copy the file required to a blank floppy, this makes it easier to extract later. Note the program must run OK on an HP-85. If you tried to convert an HP-87 program, it wouldn't work as it uses different values for the Basic tokens. However it is possible to convert HP-87 programs to the HP-85 using the GET/SAVE method, and then fixing any errors with the program on the HP-85. To make the 9915 automatically run a program on start-up, it has to be called Autost. Step 2 - convert Basic program to data fileLoad the floppy disk into a PC, run LIFUTIL and select LIF Hex Dump, and select 'Dump whole disk to PC'. The format of the LIF directory is described in the MoPHC library 'HP-IL Files: Where, What, Why, How, etc.'. The LIF directory starts at location 00200 (hex), each file has a directory entry of 32 bytes. Find the file to be converted. The structure of the entry is as follows:
Bytes 1 to 10 - file name For a Basic program the file type bytes should be E0 20. Change this to E0 10, which is the file type for a data file. Make a note of the file length in records (bytes 17 to 20). This should 'be between 00 00 00 01 and 00 00 00 80 (assuming a Basic program can be up to 32768 bytes long). Copy these bytes to the file implementation bytes (bytes 29 to 32). With LIFUTIL, need to write changes to disk at this point. Look at the file start record number (bytes 13 to 16). Add 00 to the end of the start record number, this is the address of the first byte of the program file. Scroll down through the LIF file to this address, the Basic program should be found. The first four bytes of the Basic program should be the word 'MAIN'. The first three bytes need to be changed so that they
are the same as the first three bytes of a data file containing a string. For example, if the Basic file is 0A records long (10 in decimal), the file is 2560 bytes long. Bytes 2 and 3 of should be changed to FD 09. This represents 09*256 + 253 = 2557 bytes. This is the length of the string now contained in the data file, as this is three bytes shorter than the length of the original Basic file (to allow for the 'start of string' marker). Save the changes made to the LIF file, and load the disk back into the HP-85. A CAT of the disk should show a file of type DATA. The data file contains one record of type string. This can now be read in a Basic program. The string contains the Basic program minus three characters at the beginning, which are always 'MAI'. A similar approach could be used with a HP-85 binary program; I don't know what the first three characters would be but may need to be written down and re-entered by hand later. Step 3 - Read in data file on HP-85 and produce EPROM data fileHaving converted a Basic program to a data file, the next step is to put it into the format needed by the 9915. This format is described on pages 4-12 & 4-13 of the HP 9915 System Development Manual. I wrote the 85to9915.txt program to read in a HP-85 Basic program converted to a data file (as in step 2), and write it to a new data file that represents the EPROM data. The program gives the option of creating a new EPROM data file, or re-using an existing data file. To add a second Basic program just run the program again and enter the name of the data file. The program will also list the directory of the EPROM data file, note there is no way to do a CAT of a set of EPROMs once installed in the 9915. Note this program uses the CHECKSUM command, which is built into the Program Development ROM. So this should be removed from a 9915 and fitted into an HP-85 for this method. The program as-is has some limitations:
Suggested use is to keep EPROM data files backed up, and perhaps have different sets of EPROMs for different applications. Step 4 - Output EPROM data file to serial port and transfer to EPROM programmerThis step is to take the formatted data and convert it to a form suitable for an EPROM programmer. I decided to use the Intel format, as this represents binary data as ASCII (so can be captured as a text file) and has built in checksums to guard against errors and help ensure a reliable transfer to EPROM. The program 9915toPROM.txt reads in the EPROM data file from disk, and outputs the contents in Intel format to the current PRINT device. This can be redirected to the serial module by issuing the command PRINTER IS 10 before running the program (assuming the serial module is set to device code 10). The main limitation of program is that it is limited to an EPROM data file of 20K bytes. With hindsight (and having read the 9915 Tape Duplication and EPROM Programming Software manual) a better overall approach is to break the EPROM data file into smaller chunks, eg 4K bytes. If your EPROM programmer has a serial interface you can connect it directly to the HP-85. I preferred to download the output of the program (in Intel format) to the PC first, here is prom1.txt that contains the 'hello world' program as an example. Step 5 - Program EPROMs and load into HP-9915The details of this step depend on your EPROM programmer. As the above programs generate one large data file if more than one EPROM is needed, the EPROM programmer has to be able to store the data in memory, then allow the start and end addresses to be blown to the EPROM to be edited. Be sure to label the EPROMs! If your programmer doesn't allow changing start addresses, I would recommend changing the Basic programs above to split the EPROM data into smaller files. Step 6 - Load EPROMs & enjoy!Final step is to plug the EPROMs into the 9915 PROM board. This and the jumper settings are described in the 'HP 9915 Option ROM and PROM Board installation' note. Turn on the 9915, and it will try and load and run a file called Autost from EPROM. To load a different program, the command is: PLOADGO "Prog1" as described in pages 4-5 to 4-9 of the HP 9915 System Development Manual. Note it is not possible to CAT the files stored in EPROM, or to LIST the contents after the program has run.
|
|||
This page was last revised on: 08/02/06 |