Woodstock Microcode

Woodstock was the name HP gave to its newer model processor for its newer model calculators at the time of the HP-67, HP-21, HP-25/C and HP-29. Here’s what was in it:

This is just notes for now. I’ll tidy them up when there are enough for some order to appear.

0011 0100 00 (0320) display reset twf

This is (guess) probably something that enables the display to show hex digits (0x0a – 0x0f) as text (twf = “text word flag”?). It has no impact on the functioning of the HP67 calculator.

In their emulator, Eric Smith / David Hicks / Jacques Laporte, set a variable “display_14_digit” that is false at startup and set when this microinstruction is run. It is never tested or used anywhere else. The variable name chosen may be related to 15 digits in the display or 14 plus a decimal point, or 14 bcd digits in a data memory and internal register. It may also be display digits “0-9” plus “CrdEo ” but that is 15 digits after deducting the space.

nnnn1110 00 (0070) data register -> c N

00001110 00 (0070) data register -> c 0
00001110 00 (0070) data -> c

There is a twist with this instruction. It really should be “data register -> c N” for N greater than 0 (1..15).

“data register -> c N” has a side effect of resetting the base address for the ram memory bank, at least in the emulators. If you use “c -> addr” to set a ram address of 0x32 (for example), “data register -> c 4” will reset the base address to 0x30 (= bank 3, registers 48-63) and then access data register 4 in that bank. Any subsequent “data -> c” instruction retrieves data register 0x30 not 0x32.

The HP67 microcode program has a number of cases where it uses “c -> addr” to select a data register within a bank (eg 0x06 during STO/RCL 6 operations) and then uses (per the listing) “data register -> c 0”. That results in data being stored and retrieved to/from memory 0; not memory 6.

The solution in the existing emulators was to override “data register -> c 0” with a special case “data -> c”. That one doesn’t reset the base address. Unless there are genuine cases where the reset side effect is used, it might have been better to code the internals as:

int mem;
mem = ram_addr & ~017;
mem += (opcode >> 6);
for (i = 0; i < WSIZE; i++) c[i] = ram[mem][i];

Rather than:

ram_addr &= ~017;
ram_addr += (opcode >> 6);
for (i = 0; i < WSIZE; i++) c[i] = ram[ram_addr][i];

I've used the original approach in case the side effect is used somewhere. In my case I simply replaced all "data register -> c 0" instruction text with the special case text "data -> c".

Eric Smith's site is www.brouhaha.com/~eric/hpcalc/

His original assembler & simulator (casmsim) can be found via: www.brouhaha.com/~eric/software/casmsim/. I don't know if it understands woodstock or just classic as I haven't looked through it yet.

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 *