HP67 Unused Program Codes

There are six instructions you can’t enter into a HP-67 calculator.

As you probably know, each user program step is stored internally as an 8-bit code and an 8-bit code has 256 possible values. However, if you look at all of the program steps you can enter, there are only 250 mentioned in the manual.

Well, “that’s fine” you and I might say. We’ll just enter those 250. But people can be curious types and a few wondered about the other six.

Those people did some pretty amazing things. They’d write HP-65 programs onto magnetic cards and feed those into a HP-67 instead. The two are different calculators. They have different card formats. The HP-65 even uses 6-bit program steps instead of 8-bit ones. Despite the odds being very much against them, and with no information available at the time on the inner workings of the calculator, they successfully got the six missing values into a HP-67. Once there, the floodgates opened because you can write program steps onto mag cards and hand them to your friends. Everyone now had access to them.

What are they?

The missing instructions are:

code keycode meaning
0x1f 24 (i)
0x2f 32 24 g RND
0x4f 35 73 h PI (but isn’t h PI)
0x6e 35 61 04 h CF 4
0x8e 35 51 04 h SF 4
0xff 31 25 24 f LBL (i)

Eric Smith’s HP-67/97 Hex Table shows all of the 256 values including the missing six. Interestingly he also lists a way of creating the six without needing someone else’s mag card or a HP-65 and a lot of luck.

How do I enter them?

If you have a physical calculator:
– switch to W/PRGM to enter a program
– press [GTO] then [.] (which doesn’t normally become a program step)
– (for 0x1f, 2f, 4f, 6e or 8e) press [1], [2], [4], [6] or [8]
– (to end with 0xf) press both the [A] and [D] buttons at the same time; or
– (to end with 0xe) press both the [A] and [C] buttons at the same time.

As a list:

code press get
0x1f [GTO] [.] [1] [A,D] 24
0x2f [GTO] [.] [2] [A,D] 32 24
0x4f [GTO] [.] [4] [A,D] 35 73
0x6e [GTO] [.] [6] [A,C] 35 61 04
0x8e [GTO] [.] [8] [A,C] 35 51 04
0xff [GTO] [.] [A,D] 31 25 24

Why does that work?

The [A] to [E] keys produce scan codes 0xa4 to 0xa0. This is row 0xa (10) and columns 4 to 0 internally.

Holding down the [A] and [D] keys causes the keyboard scanning chip to see both 0xa4 and 0xa1. It thinks a key on row 10 and column 4+1 (column 5) has been pressed. That’s a non-existent key to the left of [A].

Holding down the [A] and [C] keys causes the keyboard scanning chip to see both 0xa4 and 0xa2. It thinks a key on row 10 and column 4+2 (column 6) has been pressed. This is yet another non-existent key to the left of the other one.

The calculator was not made to deal with keys that didn’t exist and which should never exist. However, it turns out that these keys link into useful parts of the microcode. [A,D] (scancode 0xa5) goes to address 01467 and [A,C] (scancode 0xa6) goes to address 01470. Both of these create an 8-bit code to store in the calculator’s program memory.

[GTO] [.] sets up internal register M1 with an “f” in an exponent digit.
Pressing a number replaces that “f” with the number.

When the [A,D] or [A,C] key is pressed it builds an 8-bit code based on what is in the M1 register and the current key. This is why you get 0xff stored if M1[1]=f and you press [A,D] or 0x8e if M1[1]=8 and you press [A,C].

Whilst a harder process, you could also key in any of the 8-bit codes starting with 0-9 and ending with 0xe or 0xf the same way. And of course other combinations of [A][B][C] and [D] are possible. The [E] key gives scancode 0xa0 so holding it down adds nothing (0) to the column number.

More detail is available in the microcode for [GTO] [.] [8] [A,C]

How do I do that in an emulator?

If it is based on the actual microcode and if it supports holding down / clicking / touching two buttons at once, there is a chance that you can just follow the instructions above. But it is unlikely because most computer languages for emulators will provide key press information rather than scan codes with row and column information.

There are other options though. With the hp67u you can just key the desired 8-bit code directly into program memory. If you remember that program step one is in nibbles 0 & 1 (the rhs of) ram[47], it is pretty easy to key any code you want into steps 001 – 007. You can also choose menu / Program and enter or change program steps in the listing there. The following extra keycodes can be used:

8-bit in decimal keycode
0x1f 31 99 00 31
0x2f 47 99 00 47
0x4f 79 99 00 79
0x6e 110 99 01 10
0x8e 142 99 01 42
0xff 255 99 02 55
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 *