The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

Transfering HP-85 programs to HP-9915 EPROMs
Message #1 Posted by John on 7 Feb 2006, 7:26 p.m.

Hi,

I have been working (mainly over the Christmas holidays) on a method to transfer HP-85 Basic programs to an EPROM for the HP-9915. PROM boards are standard on the 9915 unlike tape drives which were an option. The method involves creating a LIF-like directory and breaking down programs into 256 byte records. Also each record has a two-byte checksum value added.

The whole method is on my web page at

http://www.vintagecomputers.btinternet.co.uk/hp85/hp9915_eprom.htm

This method uses LIFUTIL on the PC and HP-85 Basic programs. There are Series 80 binary programs around (and also utilities like SYSEXT on the HP-87) that can read raw sectors, but I wanted to use a basic approach that was easy for me to understand. I hope one day the original HP software pack for the 9915 surfaces, as there must be an easier way!

I would also welcome some help in understanding the CHECKSUM function, it does not seem to match IBM SDLC checksums as claimed in the manual.

BTW I would not be surprised if a similar method could be applied loading programs into EPROMs on the IPC (Integral PC).

Regards,
John

      
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #2 Posted by Vassilis Prevelakis on 7 Feb 2006, 8:31 p.m.,
in response to message #1 by John

Excellent work!

I wonder if anybody can help with that checksum algorithm, the manual says that it uses "the IBM SDLC Frame Check Sequence."

This is supposed to bea 16-bit CCITT polynomial, but no polynomial I have tried gives the same results as the CHECKSUM$ function on the 9915 Development ROM.

Here is a sample of some values calculated with the built-in function:

**vp

            
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #3 Posted by John on 8 Feb 2006, 4:38 a.m.,
in response to message #2 by Vassilis Prevelakis

Thanks vp,

Can you clarify about your CHECKSUM exmaple, eg when you input the string "0001", surely in hex this is 30 30 30 31?

Also as a postscript I should have mentioned I developed the Basic programs on a PC using the HP-87 emulator, then transfered them to a real HP-85.

Regards, John

                  
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #4 Posted by Olivier De Smet on 8 Feb 2006, 1:00 p.m.,
in response to message #3 by John

Hi John,

I hope to finish an alpha version of an HP85 emulator very soon (based on my HP87 emulator). The tape and printer are not working actually and when booting the emulator say 'ERROR 23' :)

But an HP-IB interface and floppy-disc are working :) (electronic disk don't work so it's not an HP85B emulator)

Just for completness, with the service rom, CPU and DISPLAY are ok, only RAM 1 and 6 are OK (don't know why RAM 0,2,3,4,5,7,8 are bad..) and of course, tape, printer, and timers don't pass the tests.

Bye,

Olivier

BTW did someone have an image of the Service rom for HP86/87 ?

I have some manuals about servicing the HP85 and 86, but the diagnosis about the differents errors of the service rom are not enough to implement the missing functionalities.

Is there somewhere a commented listing of thoses roms ?

                        
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #5 Posted by john on 8 Feb 2006, 5:41 p.m.,
in response to message #4 by Olivier De Smet

Olivier,

Good to hear you are still working on the HP-85 emulator. I must admit I was a bit rusty on using the HP-87 emulator when I came to use it, so I wrote myself some notes on using disks etc as it was't obvious how to do this, I'll post them to the forum.

If you need any help with debugging your HP-85 emulator, do you want to start a new thread on this forum with any questions? For example, I have an HP-85, Assembler ROM and System Monitor module so (in theory) I can set breakpoints and single step through to see what a real HP-85 operates.

Also, how about an HP-83 emulator, as this doesn't have a tape drive or printer? I'm sure someone here will be able to dump the system ROM if needed.

Regards
John

                              
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #6 Posted by Olivier De Smet on 13 Feb 2006, 4:20 a.m.,
in response to message #5 by john

John,

The new release is ready. I send you a mail about it. I can send it by mail (1,2Mo zip archive).

I still have some problems, perhaps from the roms. There are at least 2 release for the HP85(A) system roms and one for the HP85B. I don't know which release I use...

Olivier

            
CRC-16-X25
Message #7 Posted by Juergen Keller on 8 Feb 2006, 4:38 a.m.,
in response to message #2 by Vassilis Prevelakis

Seems to be CRC-16-X25. Please refer to
Crypto - Codes

I've checked it with the
online CRC calculator

I've entered 16 / 1021 / FFFF / FFFF / reverse data bytes. Hope this helps!

Best regards, Juergen Keller

                  
Re: CRC-16-X25
Message #8 Posted by John on 8 Feb 2006, 5:48 p.m.,
in response to message #7 by Juergen Keller

Thanks Juegen,

Having found the right parameters it should now be easy for someone to write a PC / Linux program to generate 9915 EPROM files straight from the extracted HP-85 Basic program.

Regards,
John

            
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #9 Posted by Eric Smith on 8 Feb 2006, 3:49 p.m.,
in response to message #2 by Vassilis Prevelakis

I wrote a "brute force CRC finder" program when I was trying to identify the ROM check algorithm used by the HP Spice series calculators, as described in this blog entry.

The actual C code is in the Nonpareil Subversion repository; I can email you a copy if it's of any use to you, but it looks like Juergen Keller has already identified the polynomial.

The general things to try when a CRC polynomial doesn't seem to work right are:

  1. reverse byte ordering of data input
  2. reverse bit ordering within input bytes
  3. initialization value - usually all zeros or all ones
  4. bit order or byte order of result
                  
Re: Transfering HP-85 programs to HP-9915 EPROMs
Message #10 Posted by Vassilis Prevelakis on 8 Feb 2006, 8:07 p.m.,
in response to message #9 by Eric Smith

many thanks everybody -- this was great

**vp

for completeness here is the C function that calculates the CRC of the supplied string:

typedef unsigned char   uchar;

// 'POLYNOM' is the CRC polynom without leading '1' bit #define POLYNOM 0x1021 // 'crcinit' is the initial CRC value belonging to that algorithm #define CRCINIT 0xffff // 'CRCXOR' is the final XOR value #define CRCXOR 0xffff // 'CRCHIGHBIT' short with most significant bit set to 1 #define CRCHIGHBIT 0x8000

ushort hp85crc(uchar* p, ulong len) {

int i, j; uchar c; ushort bit; ushort crc = CRCINIT;

for (i=0; i<len; i++) {

c = *p++;

for (j = 1; j <= 0x80; j<<=1) {

bit = crc & CRCHIGHBIT; crc<<= 1; if (c & j) bit^= CRCHIGHBIT; if (bit) crc^= POLYNOM; } }

crc^= CRCXOR;

return(crc); }

and it is called like this:

        uchar string[] = "1234567890";

printf("crc(%s) = 0x%x\n", string, hp85crc(string, strlen(string)));

Edited: 9 Feb 2006, 1:47 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall