Description of V10C/X, an HP10C running Q and Q-1 of HP32E
- Abstract:
- V10C/X simulates the Nut CPU (once used in HP-41 and Voyager calculators)
to interpret the firmware of an HP10C expanded with the Q and fixed(!) Q-1 functions
of the HP32E.
Besides that it offers more memory for data and programs.
V10C/X is programmed with ooRexx and runs under Windows.
- Update 5/3/26
- • Added option to toggle between fixed Q-1 and original f/w, migrated original to be precise
- Update 4/29/26
- • Fixed key caption shown in PRGM mode
• Fixed hidden flaw of one root finder in Q-1 function
• Altered ROM concealment
TOC:
- What's worth to know
- The modifications in detail
- Prerequisites, install and run it
- Continuous memory or virgin evermore
- Controls of this program
- Present its program
- Paste a program
- Manuals of the role models
- The fine print
What's worth to know
To emulate ancient calculators by simulating its CPU is common practice.
Thus V10C/X is nothing special in this respect, in fact it is an offspring of
NutEm/PC.
The unusual feature is, I was able to carry over (migrate) the Q and Q-1 functions from the HP32E, a model
of the "Spice" series with differing CPU and technology than the 10C of the "Voyager" series.
Some time ago I analysed trace logs of an HP32E running under Tony Nixon's
Classic Calculator Emulator + and disentangled
the algorithm used to compute Q,
the
cumulative distribution function for
the normal distribution.
Later I
came
to know, this is
Algorithm 39 published in 1969.
One rainy day I also analysed the inverse function Q-1 and discovered to my surprise, it computes
an initial value for a root finder but does not use it – clearly a flaw in my view.
Even so I did not grasp all bits and pieces (probably some housekeeping routines)
I now achieved to migrate the algorithm from the HP32E to the HP10C,
including the non-understood parts.
And it works.
When verifying the progress I saw occasionally deviations in results of computing logarithms,
but only in the "guard digits" (mantissa digits 11..13).
Final results rounded to 10 digits are highly likely all the same on the HP32E and V10C/X.
Looking for a way to fix the a. m. flaw (I call it hidden flaw because it's ironed out
by 1..2 more iterations thus the only way to find it was analysing trace logs) I was lucky.
Replacing one single call to a subroutine does the trick and reduces for some input the time
to return a result by more than 17%.
The modifications in detail
V10C/X differs in four ways from an original HP10C.
The changes are —
- 1. USER mode
- The additional functions are callable in USER mode only.
While the HP10C has no USER mode its display comprises this annunciator.
When in GRAD mode GRD (f-shift 6) will toggle it.
- 2. More Memory
- Not influenced by the program size there are allways 16 data register available
but only 10 are directly accessible at any time.
The six "inaccessible" registers can be swapped with the statistics registers R0..R5.
It may be used as primary and secondary data set – or ad lib,
it's up to you.
To do P<>S hit X≤Y (f-shift /) in USER mode.
- 3. Normal Distribution
- How to use Q and Q-1 is described with examples in
HP-32E
Owner's Handbook, subsection Normal Distribution.
To run Q hit →RAD (f-shift -) in USER mode,
to run Q-1 hit →DEG (f-shift +) in USER mode.
- 4. Decimal Mark
- Reset, also start w/o RAM file, will set comma as decimal separator.
The sign used for 'copy X to clipboard' depends on your setting.
Notes:
- Q-1 of HP32E
has had a hidden flaw I fixed now.
It computed an initial guess for the root finder but didn't use it for unknown reasons.
This mistake was ironed out by one..two more iterations.
V10C/X copies precisely HP32E's Q and Q-1 algorithm except this bug.
- At every start of V10C/X the fixed Q-1 algorithm is used.
This may be temporarily changed while all RAM content remains untouched,
just tick or tick off menu item 'bug fixed Q-1'.
- The additional functions are not programmable.
Any attempt to enter them in PRGM mode will result in the original function code
of the corresponding key.
In contrast, GRD in GRAD mode will toggle USER mode, also when executed by a program.
(GRD is not an additional function.)
- More memory does not enable longer programs.
GTO in 10C programs use line numbers as target, GTO > 79 are filtered at entry.
To change that is not worth the drudgery me think.
Prerequisites, install and run it
To run V10C/X you need:
- a PC running
UTF-8 enabled Windows (W10, maybe newer, or maybe a virtual machine),
- Open Object REXX, see
oorexx of
"Open Object Rexx", V5.0.0 (it seems V5.1.0 works also),
Portable ooRexx may be an alternative for those prudent contemporaries w/o a sandbox,
- download either V10CX_win32.zip or V10CX_win64.zip, depending on the addressing mode of your OS.
Install it
There is no automated installation procedure.
Unzip one of the a. m. ZIPs to a directory named at will, a directory of its own or not, it's up to you.
Depending how you like to run it, prepare one ore more shortcut links where you find them again.
V10C/X ignores any arguments and options.
First Run and Subsequent Runs
Other than the preparatory work mentioned under 'Prerequisites' and 'Install it' there is nothing
else to do before the first run.
Don't be surprised that the very first notification is an error message:
"Pr Error" what stands for 'Power Error.'
That is the same as inserting batteries for the first time into a real HP10C.
Leaving the session (not by 'Quick Quit') will write a state file "## trial run ##.mem"
which will be ignored at next run of V10C/X.
To use it rename it to "V10CX.mem" – for more see next paragraph.
Continuous memory or virgin evermore
An HP10C is so scantily equipped with memory it's rather a "4-banger" than a programmable calculator.
That is why it could be desirable to get a pristine machine every time you start V10C/X.
This is possible by not renaming the state file "## trial run ##.mem" or
– if once renamed – by erasing "V10CX.mem",
That way every run of V10C/X will give you a brand-new machine.
In contrast, if you like a calculator with continuous memory like the role model, rename the state file
to "V10CX.mem" and include it in your back-up.
Controls of this program
Keys: F1 - will show this help file (if you linked suffix HTM with a browser),
F2 - displays the About information,
F10 - activate context menu,
Esc - ends the program.
Buttons: Same as role model (see note 1).
System menu: Underscored letters indicate which key will launch the option
additions only:
Quit w/o saving RAM - ends program but keeps RAM of previous session
Reset Nut cycles counter - set CPU count to zero
Bug fixed Q-1 - toggles patched f/w
Show PRGM... - list user program in an extra window
Get PRGM from clipboard - import a routine or parts of it
Copy figure as displayed - copy display to clipboard
Copy complete X-register - copy X-register in full precision to clipboard (note 2)
Paste number to X - import clipboard content (note 3)
Sho BS image... - show reverse side of role model (note 4)
Manuals online... - show https://literature.hpcalc.org
More details... - same as F1 (see note 5)
About... - guess what...
Notes:
- Caption of buttons change according to shift status and with it also acceleration keys.
For V10C/X f-shift, GRAD and USER mode are relevant,
in addition pointer P and some internal flags to identify partial key sequence.
- The used decimal marker depends on the calculator setting.
- Pastes a number to X-register, or in PRGM mode into program.
A number is interpreted to detect thousand's separators, comma, sign, exponent, and exponent sign.
What may not belong to the figure will be missed silently.
This fuzzy logic is not perfect, so use with caution.
- This menu item requires suffix .GIF to be linked with a viewer (if none available a browser might do).
- This menu item requires suffix .HTM to be linked with a browser.
Present its program
Voyagers lack a printer.
An emulator may fill that gap easily.
V10C/X offers at least a virtual printing strip for programs,
see Show PRGM... option above.
Mark all or sections to copy to clipboard.
When you changed the program the 'Sho' button will refresh the "print-out".
Paste a program
The afore mentioned option to show and copy programs enables to build
a compilation of your routines worth to preserve.
The feature to put them back to work is pretty handy.
To make it really useful the saved listings may be annotated at pleasure.
A listing apt for import may look like this:
#! 10C
* vapour pressure of water
* rel. err. < 0,3% in range 0..100 °C
|...+....1....+....2....|
1- 36 Enter^
2- 35 CLX
3- 42 10 x<=y?
4- 22 06 GTO 06
5- 42 12 LN impede input < 0
6- 33 RDN
7- 7 7
8- 48 .
9- 4 4
10- 6 6
11- 3 3
12- 34 x<>y
13- 20 *
14- 2 2
15- 3 3
16- 6 6
17- 42 36 Last X
18- 40 +
19- 10 /
20- 13 10^x
* * * 6,107E-03 bar is p_W//0 °C
21- 6 6
22- 1 1
23- 0 0
24- 7 7
25- 26 EEX
26- 16 CHS
27- 6 6
28- 20 *
- All lines up to and including the scale are optional.
- An optional "shebang" in first line may indicate the program's origin and/or target machine.
- Lines starting with "*" (asterisk) are ignored, by that comments may be inserted ad lib
at any line of the listing.
- The scale is ignored.
- The program listing is the same as displayed with menu
item Show PRGM... .
Relevant for the import are the key codes in columns 4..10,
only these are used to type in the program.
- Since only key codes are relevant for import, inline comments may be added at will from column 12 on.
- Consider when merging routines, GTO on HP10C use line numbers as target.
- More
about this example.
Manuals of the role models
- HP10C
- https://literature.hpcalc.org/#model:10C/author:Hewlett-Packard
- HP32E
- https://literature.hpcalc.org/#model:32E/author:Hewlett-Packard
The fine print
(i) Do not use this program.
(ii) Any damage you cause with this program, intentional or by chance, is a violation of clause (i).
Thus all consequences are completely at your own risk.
(iii) Because the program is published w/o source no 'free license' like the
QPL is applicable.
Nevertheless existing laws protect its content – the interpreted firmware is included
within the "running phase" (sourceless program) but in an encoded format.
That is why it is unlawful to decode it and distribute it in decoded format.
In case you accomplish to decode the expanded firmware of V10C/X – enjoy your achievement,
but do not publish it, even not in private circles – there may always be a "leaky spot".
* * * * * END OF FILE * * * * *