HP-29 Microcode Reference

This is a bit early but I wanted to get a few things down now

98 Program steps occupy 14 registers, 7 steps per register, in ram[32..45].
The user program counter is in M2[2..0] as step, bank, register.
Register starts as D (13) and works down to 0.
Steps are 6..0. Bank is always 2 (ram 32..47).
A value of 000 shows as step “00”.

Memories are 0-9 in ram[0-9], .0-.5 (indirect 10-15) in ram[10-15], and indirect 16-29 in ram[16-29]. These are in ram banks 0 and 1.

LastX is in ram[31]
X gets stored in lots of places (A/B, C, M1, and ram[30] and ram[47])
The magic number gets stored in ram[46]. If this is missing, the microcode reports an “Error” due to a loss of Continuous Memory.

s3 is the PRGM-RUN switch flag. 1=RUN.
s5 is power ok. 0=low power.
s15 is keypressed

The microcode includes 01120, 01220 and 01320 opcodes, which are unknown and presumed to be printer related.

In the real world, only ram banks 0 and 2 are CMOS. In the emulator, all are.

Whilst there is no way to share programs between a HP-29C and a HP-19C, they use the same hex codes for user program steps. This means the HP-29C could potentially attempt to execute “printer related” keys intended for a HP-19C. This lends credence to the unknown opcodes being “printer related”.

User program step 1 is stored in the bottom 2 nibbles of ram[45]. The user program counter value for this is “62D”. “D” of bank 2 is ram[2*16+13]= ram[45] (ie ram[0x2D]).

The HTML5 emulator (hp29u) saves ram if you close the browser or tab, navigate to a different page, or do a refresh. It also does a save if you switch the calculator OFF.

You WILL get an “Error” the first time you load the HTML5 emulator. This is because Continuous Memory has not been saved previously and cannot be loaded. All values are zero and this triggers the (memory lost) “Error” message. It is very hard to get that error again afterwards. *Update*: use menu, advanced, settings to zero out the value in d46 (ram[46]); then refresh the page. This will save the zeros and restart with the memory lost “Error”.

Precision is stored in ram[46][2], the exponent sign.

For the hp29 emulators a voltage of 1.9 or less will trigger the low voltage display and 2.1 or more is fine. (2.0 varies, sorry – my inconsistency). I don’t know what the trigger point is on the real thing. It has 2xAA batteries so that is nominally 3V though, with rechargeables, that might be 2.6 or 2.4V. Below 2 seemed plausible for “low”.

There is a HP-29C microcode listing with octal addresses and statements.

Addresses

00000 start
00152 wait loop start
00124 end of function (common code from here)
01167 clear prefixes (& s0,13,14)
00425 key_sto
00436 key_9
00437 key_8
00440 key_7
00441 key_sub
00443 key_3
00444 key_2
00445 key_1
00456 key_dot
00457 key_0
00462 key_6
00463 key_5
00464 key_4
00465 key_add
00467 key_f
00473 key_g
00555 key_clx
00745 digit
00747 upd_hex (adds digit into hex code)
01045 gto_dot
06000 hex_0x
06401 func_enter (hex code 01)
06404 func_clx (hex code 04)

s Flags

s3 run_mode (PRGM-RUN switch)
s5 power_ok
s4,6,7,8,10 prefix code (f,g,STO,RCL,GTO,GSB,LBL,..)
s9 auto_enter
s12 digit entry
s13 (for STO/RCL/LBL/…) over 5 (not .0 – .5)
s15 key_pressed

RAM

00-09 STO/RCL 0-9
10-15 STO/RCL .0-.5
16-29 STO/RCL i (i = 16-29)
30 used?
31 LastX
32-45 98 program steps (14 registers)
46 Magic (cmos fail if mantissa wrong) [xs]=precision
47 SaveX (keeps X in cmos when off)

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 *