The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Nonpareil release 0.30
Message #1 Posted by Eric Smith on 7 Apr 2004, 7:53 p.m.

The first alpha release of Nonpareil, a multi-architecture microcode-level calculator simulator and microassembler, is now available:

http://nonpareil.brouhaha.com/

Nonpareil obsoletes CASMSIM. Initially it supports the same Classic series calculators (HP-35, HP-45, HP-55 and HP-80), and one Woodstock series calculator, the HP-25.

There are known bugs; for instance, the logarithmic and exponential functions of the HP-25 are not working correctly. I expect to fix that in the next release.

Future releases will include HP-41C and Voyager series support, based on code from NSIM. And possibly Spice series support; I have to investigate how much Spice differs from Woodstock architecturally.

The display interface between the GUI and the processor simulation is still not very general; in order to add HP-41C support I'll probably have to completely replace it.

Edited: 8 Apr 2004, 3:18 p.m. after one or more responses were posted

      
Re: Nonpareil release 0.30
Message #2 Posted by Jonathan Purvis (NZ) on 7 Apr 2004, 11:44 p.m.,
in response to message #1 by Eric Smith

I get errors compiling proc_classic.c and proc_woodstock.c. GCC complains "field `ram' has incomplete type". It's refering to the line which says:

reg_t ram []; /* dynamically sized */

Did you mean "reg_t *ram" or "reg_t ram[0]"? (Possibly not, it doesn't run the HP-35 with either of those changes.)

            
Re: Nonpareil release 0.30
Message #3 Posted by Eric Smith on 8 Apr 2004, 3:04 a.m.,
in response to message #2 by Jonathan Purvis (NZ)

reg_t ram[0] should work. reg_t *ram definitely will not.

Having a struct with an element declared explicity as zero length is not allowed by the C standard, although many C compilers do accept it. Omitting the length entirely, as I have done, is officially permitted by the C99 standard.

I'm using GCC 3.3.2. I've just verified that it works for me either with or without the zero. What version of GCC are you using?

                  
Re: Nonpareil release 0.30
Message #4 Posted by Jonathan Purvis (NZ) on 9 Apr 2004, 2:23 a.m.,
in response to message #3 by Eric Smith

I always thought "int *foo" was the same as "int foo[]". You learn something new everyday. :)

I was using GCC 2.95.4 (the default on Debian stable). I tried it with 3.0.4 and it compiles.

      
Re: Nonpareil release 0.30
Message #5 Posted by Bill Wiese on 8 Apr 2004, 4:40 p.m.,
in response to message #1 by Eric Smith

So, Eric,

You don't have Woodstock (HP25) exp/log functions working yet but basic math, 1/x, sqrt(x) and trig functions do work??

Nice. What new/changed instructions have you found btwn Classic & Woodstock architectures??

Regards, Bill

            
Re: Nonpareil release 0.30
Message #6 Posted by Eric Smith on 8 Apr 2004, 6:37 p.m.,
in response to message #5 by Bill Wiese

Quote:
but basic math, 1/x, sqrt(x) and trig functions do work?

Yes. There's probably a single microinstruction I've implemented wrong that is breaking the logarithmic and exponential functions. (And might have a more subtle effect on other functions.)

Quote:
What new/changed instructions have you found btwn Classic & Woodstock architectures?

Almost all of it is described in the HP Journal article: http://www.hpmuseum.org/journals/woodb.htm

The ALU can be switched between BCD and binary. There are more flag bits. There are two 56-bit temorary registers rather than one, and a new four-bit register. There are instructions to directly read and write external registers in a single step, just like the later Nut processor.

I've just tried running the HP-32E, HP-33C, and HP-37E ROMs. The keyboard and display mapping is wrong, but it comes close enough to working to confirm that Spice uses the same processor architecture. They do use the 0520 (octal) instruction; I don't yet know the function of that although it may be circular shift left A.

On the weekend I'll capture traces for comparison.

      
HP-33C works!
Message #7 Posted by Eric Smith on 9 Apr 2004, 6:16 a.m.,
in response to message #1 by Eric Smith

I've now got the HP-33C working in Nonpareil. As I suspected, the 0520 instruction is rotate left A. I'll try to get a 0.31 release out within the next few days.

I've only done limited testing, but the 33C seems to work correctly, including the logarithmic and exponential functions that are not working on the 25.

On the other hand, the 32E and 37E have problems. On the 32E, number entry always thinks there's a decimal point after the first digit, and addition and subtraction always seem to overflow. Multiplication and division work correctly though, as do many other functions. On the 37E number entry is OK, but it has the addition and subtraction problem, and e^x doesn't work. I suspect that these problems are all due to the same bug causing problems on the 25.

I have not yet implemented a way to save the continuous memory, so for now the 33C always starts up with "Pr Error". And I haven't yet added the instruction that checksums the ROM (1460 octal), so the self-test always gets "Error 9".

I knew the Spice architecture was fairly similar to the Woodstock, but I have been pleasantly surprised at how easy it was to get the 33C going.

I can't try the 34C, 38E, and 38C yet because I haven't implemented the necessary ROM bank switching. I don't know how it works, although I suspect that fetching the opcode 1060 simply toggles the bank selection for the ROMs containing the current address.

            
Fixed digit entry on the 32E
Message #8 Posted by Eric Smith on 9 Apr 2004, 3:03 p.m.,
in response to message #7 by Eric Smith

The digit entry/decimal problem on the 32E turned out to be an easy fix. The 31E and 32E do not have the slide switch that is used for PRGM/RUN or BEGIN/END on the other Spice models.

The switch works by forcing a CPU flag bit to be set if the switch is on. If the switch is turned off, the CPU flag doesn't automatically get cleared. To read the switch setting, the microcode tries to clear the flag, then checks the result.

Since the 32E doesn't have the switch, they used that flag as the "decimal seen" flag for digit entry. After toggling the switch in the simulator, digit entry works correctly. I've removed the switch from the KML file for the 32E.

Unfortunately this doesn't fix the overflow from addition and subtraction. I'll work on that tonight.

            
Re: HP-33C works!
Message #9 Posted by Eric Smith on 10 Apr 2004, 5:02 a.m.,
in response to message #7 by Eric Smith

Just put up a new release including the HP-33C support:

http://nonpareil.brouhaha.com/


[ Return to Index | Top of Index ]

Go back to the main exhibit hall