The HP-25 ROM dilemma

Current thinking has the HP-25 and HP-25C having the same ROMs. After all, they do the same things. It makes a lot of sense.

This suggests that you can take an emulator that supports continuous memory and add in a standard HP-25 / HP-25C ROM. Whilst that does sound like a valid recipe for a HP-25C, it isn’t. There are some issues that may not have been mentioned before.

The combination doesn’t work for a very simple reason. It doesn’t work because the first thing the ROM does is to clear the memory! No, it doesn’t sound very continuous to me either.

Clearing memory makes sense on a HP-29C, if it detects a memory lost error. But, as far as I recall, fancy checks like that didn’t come until after the HP-25C. Besides, there doesn’t seem to be any checking beforehand in the HP-25 ROM. It just clears memory regardless. The checks in the HP-29C are pretty obvious. There is nothing like that in the HP-25/C startup code.

Now I might be missing something here but, for now, my hypothesis is:

Despite current thinking, the ROM got upgraded between the models.

It wouldn’t need to be much of a change; but it can’t be continuous memory if the first thing you do is forget.

There is some support for this idea in the chips present in the calculators. It’s not conclusive in what I have to hand but, whilst the listing says certain ROMs were present in both the HP-25 and the HP-25C, it does say that ROM / anode driver 1818-0153 was only used in the HP-25. There are plenty of other examples where a chip has “25/25C” written against it so it is interesting that this one only says “25”. There is also a later chip – the 1818-0168 – that replaces the HP-25 ROM / anode driver with a “25/25C” version.

The available startup code said to be for a HP-25 / HP-25C looks like this:

HP25 Logging started.
; S= ...3.5..........
00000 if n/c goto 00236
00236 c -> addr
00237 clear data registers
...


It is pretty short so there are few opportunities to not clear the registers.

This is power up code so both the carry flag and the C register are normally zero. If that is the case, then data registers 0-15 are going to get zeroed.

Your options for avoiding that fate are:

Option 1. Set carry at “power up” on a HP-25C so the original goto never happens. This might be possible, if the carry flag is available on a CPU chip pin. However, the code that gets run if the goto doesn’t happen (not n/c), the code from 0001 onward; doesn’t seem to have any relationship to power up code. There is also a “goto 0001” (at 00153) which suggests that the program counter gets to 0001 from there rather than by carry being set at power up. I should note that both the HP-25 and HP-25C are said to use the same CPU chip so it can’t be that the CPU chip behaves differently when placed near continuous memory RAM. It’d have to be a pin and different wiring.

Option 2. Put some value other than 0 in c at power up if it is a HP-25C. That’d be possible, but again you’d need a CPU pin to make it boot up differently when installed in a HP-25C.

Short of extreme measures that would be difficult to build into the CPU (having a “clear data registers” opcode only work when the program counter isn’t 00237, or perhaps until after four other instructions have executed); the above are your only two options.

An extra pin is possible. They would have needed to know beforehand: that “continuous memory” was going to come along, that they were going to upgrade the HP-25, that they would need to change the behaviour of the existing microcode; and that they would do it by forcing carry high or by forcing a value into c.

The Dilemma

How can the same ROM with the same CPU and the same power up conditions produce different outcomes?

If the output is determinable from the inputs and the inputs are the same and the processes are the same then the outputs should be the same.

Solutions

Solution 1. The most likely explanation is the ROM / anode driver got upgraded between the HP-25 and the HP-25C and the ROMs weren’t the same. The new ROM doesn’t clear the data registers on power up. The calculator will start with zeros in the volatile RAM in a HP-25; or with existing values in the “continuous memory” RAM in a HP-25C. The easiest fix would be to replace the “clear data registers” at 00237 with a “nop”. Perhaps that was the change between the two ROM / anode driver chips.

Solution 2. Add an extra input that is different between the two calculators. This is the extra pin solution.

HP-25 / HP-25C Emulator

I believe:

  • the problem only occurred when they went to develop the HP-25C,
  • they issued an updated ROM / anode driver to not “clear data registers” for a HP-25C,
  • the most likely change was to “nop”-out that instruction,
  • the new ROM is common to the HP-25C and newer HP-25 calculators, and
  • the available ROM uses microcode from the original, HP-25 only, 1818-0153 chip.

I have modified the ROM code I use with my HP-25 / HP-25C emulator to “nop”-out the “clear …”, as discussed above.

The modified ROM results in the emulator working properly in both HP-25 and HP-25C modes.

As always, I’m happy to be corrected if any of my logic or assumptions are wrong.

It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUponDigg thisPin on PinterestEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *