There were a number of strange things you could do with a HP-67 calculator when they first came out and this one stuck in my memory somehow.
As you probably know, there are only 224 program steps in the programmable part of the HP-67. Well, there were some things you could do that would get you to program step 992. Here’s the details:
Firstly – this will not work on most emulators. It has to be a real world, physical device; or a very good emulator. The original technique involved upsetting power to the calculator through two basic methods.
One was a special “Black Box” device (see 65Notes V4 N5) that even made it into the wikipedia HP67 entry with one line “One of the notable contributions of the group was the development of a ‘Blackbox’ that allowed pseudo-alphanumeric displays” and a photo showing the device:
(“HP-67 with Blackbox” by John crane 59 – Own work. Licensed under CC BY-SA 3.0 via Commons – https://commons.wikimedia.org/wiki/File:HP-67_with_Blackbox.jpg#/media/File:HP-67_with_Blackbox.jpg)
I still have the original 65Notes issue describing that Blackbox and it has the circuit diagram and details of how to make one. However, I never built one because of the second technique ….
The second option was much simpler. You’d slide the power switch “half on” to where it just switched to “power on”. Then you’d press the power switch quickly. That would interrupt power briefly and achieve the same end.
How come / what’s the point? and
How on earth do I do that in an emulator?
How Come
The point was you could put the user program counter in the data registers part of the HP-67’s internal RAM. This meant you could key in program steps yet extract them as data with “RCL 9” (or similar).
Data has fairly rigid rules.
– the digits are 0-9
– the sign bit is 0 or 9
– same for the exponent sign.
Program steps are less limited.
– Each step is stored as 8-bits. That is 2 nibbles i.e. 2 of the Data “digits”.
– Program steps use the full 16 values (0-9a-f) for each digit.
Given that the HP-67 displays characters when non-standard values are present in displayed numbers, many hours were then consumed by many people coming up with many (many) combinations of words that their calculator could then display.
As the words could be written as data on magnetic cards, it was an early example of “write once use everywhere” (ok – only on HP-67/97).
One of the reasons that tables of hex codes for the HP-67 program steps exists is due to this work on making words.
The letters displayed are:
r 0x0a
C 0x0b
o 0x0c
d 0x0d
E 0x0e
_ 0x0f (blank)
These letters are a result of design choices by HP that allowed them to display “Error” and “Crd”.
How do I do that with an Emulator?
Firstly, the emulator has to emulate undocumented (by HP) features that were never anticipated and which happened to be present but which weren’t planned. That will rule out most functional emulators – though some may. It doesn’t rule out microcode emulators – mine or anyone else’s.
Secondly, you need a means of setting the calculator state to match that caused by the Blackbox or the power switch trick.
Both techniques cause a “funny” value to be in the user program counter. As you’ve seen, the program counter resides in the bottom three nibbles (digits) of ram[61]. You can edit this value directly in the HP67u (menu / Advanced / View RAM). Other HP67 microcode emulators may also allow you to do the same.
Normal values are [0-6][1-2][0-f] (eg the common “62f” for program step 001).
The secondary Data Registers are in ram bank 3 so if you replace the [1-2] bit with a “3” you are in the secondary data registers. Don’t use a register number ([0-f] bit) above “9” or you’ll be writing over the calculator’s internal status information (including the user program counter).
The primary data registers (memories 0-9, A-E and I) are in ram bank 0. This means you can key program steps directly into easily accessed memories by changing the [1-2] bit to a “0”. Remember that “000” is treated specially so avoid that combination and don’t SST or enter enough program steps to get to that value.
Crashes
The original technique produced crashes at times. The Blackbox even came with an “un-crash-me” button. You can get the same thing in a high-fidelity emulator. Certain invalid user program counter values crash the emulator just like they did with the real thing and, I think, for the same reason.
There are a lot of loops in the HP-67 microcode and these expect normal values to be present. It is likely that some of these loops run forever if the values don’t match the basis on which the loop was written (eg count up to 6 when the starting value is 7). With modern defensive programming practices we’d all try to make our loops cope with such things but those practices were little more than an inkling at the time and wasteful within the constraints of 256 instruction ROMs. No one can fault HP if something strange happens when you do something that you’re not supposed to do.
So when it crashes, what do I do?
On the real thing push the Blackbox button or switch it off and on again. On an emulator, you might be able to switch it off and on. I couldn’t with the HP67u and I think that it gets so caught up in what it’s doing that it never notices that the switch has been turned off. The fix for a HP67u crash is to refresh the browser (or exit the app and restart it if you don’t have a refresh option).
Step 992
You can get to step 992 if you use “f3f” in ram[61]. Note that this breaks the “don’t use more than 9 for r if b=3” rule. If you key in any program steps with this starting point you WILL crash any HP-67 or high-fidelity equivalent.
To my surprise, “f0f” doesn’t give the same step number. It gives one of the many combinations that show the impossible “000 84” step.
“f2f” does work. BST takes you to the real (normal) step 007 ie to “02f”. SST takes you to step 993 etc.
“639” has been the best combination I have found. Program steps go into secondary register 9 so [f] [P<>S] [RCL] [9] will bring up any words you create. (You may need to be in FIX DSP 9 to see them properly.)
Of course, with the HP67u emulator, you can just key “digits” “a”-“f” into the primary memories through the “View RAM” option to make words.
HP-97 and Words
Don’t use any of these techniques on a real HP-97. The words mess up timing loops in the printer software so that the thermal print head turns on, never turns off, and burns out.
Pretty much every article on these things after the first few came out with this warning so I’m also including it here.