NutEm/PC — A Nut Firmware Interpreter Built On ooREXX/Win

Abstract:
NutEm/PC copies the logics of a Nut CPU to interpret the firmware of all Voyager and HP41 calculator models. It is the PC migration of my ancient NutEm written in FORTRAN running since decades on "real iron" under VM/CMS. Today NutEm/PC may still serve on PCs as a simple toy to test some simulation without need to be compiled, just edit and run.

Reason for update 6/9/2022:
HP41 only: 82242A simulation fixed, internal indication of Blinky buffer full now shown as 28 bytes stacked.
Reason for update 4/15/2022:
HP41 only: menu option 'Sho RAM' displays memory as tree view, grouped in branches like Buffer, PRGM, Data, etc. All content editable. See RAM-tv.
Afore running this program read the QPL public license in section 9.

TOC:

  1. A Brief Description
  2. Prerequisites, Install and Run it
  3. Config File in Detail
  4. Connectivity
  5. Controls of This Program
  6. Emulator or Simulation?
  7. Features, Constraints, Known Bugs
  8. Manuals of The Role Models
  9. The Fine Print

A Brief Description

Once upon a time Hewlett-Packard sold pocket calculators based on a proprietary "Nut" CPU. This CPU worked in famous HP-41C/CV/CX and the "Voyager" series (HP-10C, -11C, -12C, -15C, and -16C). With the time the firmware of these machines leaked out what resulted in emulators, simulations, virtual remakes. The firmware interpreter I publish herewith is a great grandchild of those, and in contrast to my feasibility study NutEm on the mainframe it's now NutEm/PC with several enhancements worth to mention.

The HP41 series is extensible by many plug in ROMs and devices. ROMs add more firmware or additional software or both and run at once in this program. Devices add some special hardware which needs to be simulated to work in a remake. NutEm/PC comes with four devices, the Time Module, the HP-82143A Printer (w/o graphic), the Card Reader and "Blinky" IR Printer Module.

Furthermore...

Once triggered by a contribution in a PPC Journal (from a Grecian author IIRC, pieced in almost unintelligible English so the editor mocked about it, describing – what I assumed to grasp – how to simulate a calculator by rebuilding the limited set of CPU instructions instead of redo the floods of functions from plug-in modules), I programmed about two decades ago (in FORTRAN and on a mainframe) a logical simulation of the Nut CPU. Now I ported it to ooREXX under Windows. The idea is to run Nut based calculators' firmware in an facile to program interpreter that does not need to be compiled only to test a little add-on. So I hope it will be easier to simulate more devices.

For me this hope turned true. In rather short time I was able to add simulations of
i) the HP 82242A Infrared Printer Module (to my knowledge first simulation of it at all) and
ii) the HP 82104A Card Reader (CR). Like the role model the CR reads "magnetic cards" (files representing them) from HP-67 and -97 too, furthermore this and that from LIF disk dumps (read only) and RAW files (read/write).

My goal is not to be a better emulator than the well known but to have a toy that serves as a simple aid for testing. For some time now there exist other quite suitable simulations/emulators/virtual remakes of those HP calculators prolonging their time of use. Nonetheless I publish my NutEm/PC, may be someone else may find it convenient too to waste some time with it.

A New Entire Version?

Until March 2022 I published two versions of NutEm/PC, fork 1 with source code but neither IR printer module nor CR simulation, and fork 2 with those two devices but without source code. Both forks had few additional restrictions, for example no program listing for HP15C.

Now I merged those two forks to an "entire version" which includes the a. m. peripherals – from a REXX point of view – as "external" complements. In contrast to the main part of the firmware interpreter these complements are shared "tokenized" only, without source code and hence not under the QPL. (Find the reason for non-publication in the CR section.)

This merger includes extra enhancements, e. g. a patch at start-up to make pause last exactly 1.2 seconds. Few restrictions still survived, the "entire version" does not come with all Voyager ROMs, and there are no program listings available for HP12C and -15C. (Why those restrictions? It's not a major reason, it's just to avoid redoubling other well known emulators.)

Prerequisites, Install and Run it

To run NutEm/PC you need (in brackets what I used for the development):
  • Windows (W7 Professional SP1),
  • Open Object REXX (V4.2.0), see oorexx of "Open Object Rexx",
  • ooDialog (V4.2.4 preview), see ooDialog of "Open Object Rexx",
  • optional a viewer to show backside images (IrfanView).
    To be unmistakably clear: IrfanView is not an indispensable prerequisite to run NutEm/PC, defining suffix GIF to be opened with a browser will do too.

To run under NutEm/PC any of the a. m. calculators you do need copies of its firmware (ROM). For your convenience I add following for a first try:

Voyagers:
11C and 16C (virtual remakes of 12C and 15C are available from HP in here)
HP41
version GFF
HP41 add-on
Time, 82143A printer, The HP-41 Advantage Advanced Solutions Pac, and PPC ROM.
Note:
I do know this files contain software which could still be protected by copyright. In the hope all authors may be proud to see their work still in use, I enclose it with NutEm/PC. Please see also Acknowledgments in the Advantage manual and PPC ROM documentation.

Install it

There is no automated installation procedure. Unzip ooNUlb.ZIP to a directory named at will, a directory of its own or not, it's up to you.

Note: Keep the organization of subdirectories, 'HTML' at least, otherwise you have plenty to trim in the CFG files. If you move 'HTML' or its content you even have to modify the program or hit F1 is of little help.

First Run and Subsequent Runs

Open ooNUlb.CFG first using a text-only editor of your choice and if necessary adapt it to your installation. For further explanations see comments therein or section Config File in Detail. In future do this step for modifications only. To have a distinct CFG file for a different model I suggest to file it with a new name you then use as argument when starting NutEm/PC.

NutEm/PC is a console application which displays some information, warnings and trace output only on the console window. "Real" errors will be shown in a dialogue in the middle of the screen. If not interested in those informations of minor importance, you may prepare one or several shortcut links which start NutEm/PC to your flavour without console window.

Start ooNUlb.rx either by

  • open a command window in the directory where you installed NutEm/PC and enter (without quotes) "ooNUlb" or "REXX ooNUlb.rx", it depends on your choice of suffixes at installation of ooREXX,
  • start the windows explorer, navigate to the directory where you installed NutEm/PC and double-klick ooNUlb.rx or right-click it and select open
    (alas drag-n-drop of a CFG file to the REXX program does not work),
  • single-click a shortcut link you prepared before.

NutEm/PC optionally takes one argument and/or several options (one at a time). More tailoring is done within an CFG file.

    [REXX] ooNUlb[.rx] [CFG-fileID] [ #KEY]
CFG-fileID
a file-ID or name of a CFG file ('.CFG' will be appended if missing), default is 'ooNUlb.cfg'.
KEY
This option is obsolete in that it is now available interactively. But I won't remove it to keep NutEm/PC backward compatible.
Separated by ' #' (blank and "Gartenzaun" = garden fence, croisillon) one single designation representing a key that will be "held down at on time". Meaningful for the Voyagers are one of ',./*-+' (dot or comma to change the decimal separator, dash to get a reset, slash for a keyboard test, the rest for single or endless self-testing). 'BA' (back arrow) induces a complete reset (MEMORY LOST) of HP41. With a PANAME ROM plugged one of '.,AKMTV' are also operatively, see Appendice ON of its manual (or Appendix ON of the translation).

For subsequent runs you don't need to edit CFG files unless you like to change something.

Config File in Detail

The manifoldly features that make up an emulated calculator are too much to be handled as arguments. NutEm/PC reads a "config file" that determines all aspects of a session, or run (younameit). The details:
File-ID
Filename and -type at will, but if type is .CFG filename is sufficing as argument for NutEm/PC.
Content
The .CFG file may contain comments, blank lines, section headers, keywords, and assignments.
Comments
a semicolon, ';' (w/o quotes), and all to the right of it in its line is ignored. It has no effect on subsequent lines.
Blank lines
Blank lines are ignored.
Section headers
Section headers are set in squared brackets. These are:
[MODEL]
This section must contain one of the keywords
HP41
10C
11C
12C
15C
or
16C
to define, which calculator model to emulate.
[RAM]
One single entry only: file-ID of RAM file, possible with path or location and path, file-type at will, .RAM proposed.
[ROM]
List of ROM file-IDs, prefixed by page (hex) and primary/secondary tag and arbitrary "chip-ID" for same-time bank-switched ROMs. HP41 ROM files are copies of single 4k pages, either for primary bank (tag 0) or secondary bank (tag 1). In contrast, ROMs of the Voyagers are in one file each. About the ROM file format see here. The "chip-ID" groups ROMs which are bank-switched together. An example:
[ROM]
;page p/s cID fID
 0    0       .\Coconut\hpcx0.MClst
 1    0       .\Coconut\hpcx1.MClst
 2    0       .\Coconut\hpcx2.MClst
 3    0   CX  .\Coconut\hpcx3.MClst
;4    0       .\Coconut\service.MClst
 5    0   CX  .\Coconut\hpcx5.MClst
 5    1   CX  .\Coconut\hpcx5sec.MClst	; bank 2
 6    0       .\Coconut\pr1e.MClst
 8    0   ADV .\Coconut\adv1.MClst
 9    0   ADV .\Coconut\adv2.MClst
 9    1   ADV .\Coconut\adv2sec.MClst	; bank 2
 A    0       .\Coconut\voranoge.MClst	; use only on a 41CX
 B    0       .\Coconut\rbx1b.MClst
 C    0       .\Coconut\ppc10.MClst
 D    0       .\Coconut\ppc20.MClst
 E    0       .\Coconut\crdr1g.MClst
 F    0       .\Coconut\zen.MClst
Example for a Voyager:
[ROM]
 *    *       .\Voyagers\hp10c.MClst
[PERIP]
List of additional peripherals (HP41 only). This section is "deprecated" as all peripherals are guessed self-acting by their ROMs when included. Could be used to override automatism. Possible keywords (each on a new line): TIME, HPIL, THPR (thermal printer), and BLKY (IR printer module).
[INI]
Few assignments in the format 'separator-name-separator-value', each on a new line. Separators may be any single character not present neither in name nor value.
Recognized names and their possible values are:
DECSEP. | , — decimal separator for 'Copy complete X-register', default is comma (Voyagers only, on HP41 flag 28 is relevant).
PSS((numeric value)) — seconds to show "splash screen" at start-up. Default delay is 1.6 seconds what may be waaaay too long.
TYTRATRACE | FULLTRACE — get a simple firmware trace or get one with CPU registers included.
Example:
[INI]
/tytra/TRACE		; Display commands on CRT
;/tytra/FULLTRACE	; Display commands on CRT, also CPU registers
/decsep/.
/pss/0
[MNL]
Reference to manuals in system menu by assignments (format same as in section [INI]). If nothing is set the system menu will show a link to literature.hpcalc.org to lookup the manual in question there.
Recognized names (set one or none) and their possible values are:
ALLIN((subdir)) — will show one item in system menu, that opens a Windows explorer at 'subdir'. This option is handy if there are more formats than PDF to lookup.
SHOSOM((subdir)) — will show up to six items in system menu, which reference associated PDFs found in 'subdir' – associated by means of the first number in a PDF's filename, it must match the number in calculator's designation.
Example:
[MNL]
/shosom/.\mnl
[BLKY]
HP41 only. Few assignments to define where to find the IR printer simulation and how to connect it. Dedicated HP82240B printer simulation may be started automatically but will not be closed self-acting at session end.
The example ought to be obvious enough:
[BLKY]		; connectivity of IR printer module
/port/5025
/dip/127.0.0.1
/IrPrIPa/C:\PRGM\HP-Emulators\HP82240B	; IR Printer Installation Path

Connectivity

NutEm/PC is currently not equipped to simulate HP-IL and link to Virtual IL. The only connectivity is necessary when the IR printer module is in use. The corresponding settings in .CFG file are shown in section above.

Controls of this program

Keys: F1        - show this help file (if your PC affiliated suffix HTM with a browser),
      F2        - displays the About information,
      F10       - activate menu (HP41 only),
      Shift+F10 - (also Shift+M) activate menu (Voyagers only),
      Ctrl+C    - copy display to clipboard,
      Ctrl+X    - copy X-register full precision clipboard,
      Ctrl+V    - use clipboard content as input (see note 3),
      Backspace = Back Arrow,
      Pause     = Enter,
      End       = R/S,
      Return    - hit the selected button,
      Esc       - ends the program,
      Underscores in the button's caption denote which key will press it (see note 1).
Buttons: Same as role model.
Context Menu: right mouse click not on the key buttons will show
      Copy      - take the display as is to the clipboard
      Paste     - use clipboard content to push short cuts
      Quit      - save calculator memory and shutdown NutEm/PC
System Menu: Underscored letters indicate which key will launch an option
      Quit w/o saving RAM      - ends NutEm/PC keeping RAM of previous session
      Reset Nut cycles counter - zeroes CPU count
      Show program...          - displays user program (see note 2)
      Sho RAM                  - displays RAM content (see note 3)
      Copy figure as displayed - copy display to clipboard
      Copy complete X-register - copy X-register full precision to clipboard
      Paste number to X-register - use clipboard content as input (note 4)
      Sho BS image...          - show reverse side of role model (note 5)
      1 - Mnl_1.PDF            \
      2 - Mnl_2.PDF            - manuals found in directory set in .CFG file,
      3 - Mnl_3.PDF            /
or -  Related Manuals...       - show directory as set in .CFG file,
or -  Manuals online...        - show https://literature.hpcalc.org
      More details...          - same as F1 (see note 6)
      About...                 - guess what...

Notes:

  1. The buttons' caption change according the shift status and with it the acceleration keys. On HP41 shift and alpha is relevant, on Voyagers it is f-shift, g-shift, user mode.
  2. This menu item is only available for Voyagers, to list programs on an HP41 use a printer.
  3. This menu item is only available for HP41, description see RAM-tv.
  4. The number from clipboard is interpreted to detect thousand's separators, comma, sign and exponent. What may not belong to the figure will be missed silently. This fuzzy logic is not perfect, so use with caution. An HP41 in alpha mode will put it as text to the alpha register, characters will be uppercased. (A ZEN ROM may disturb this process.)
  5. This menu item requires suffix .GIF to be linked with a viewer (if none available a browser might do).
  6. This menu item requires suffix .HTM to be linked with a browser.
Mighty Mouse

Besides the easy handling by keyboard or mouse the later offers two additional options:

  • For the HP41 hit-n-hold is an important element of the man-machine-interface. For most keys (ON is one of the exceptions) keeping a key held down it first shows the function it will execute, and, if still held down for a moment, NULL will be displayed to indicate, you may release the key now with no further action than NULL disappearing.
    The Voyager models offer hit-n-hold for few keys only to allow a prolonged readout, e. g. 'View Mantissa' (Clr Pref) or MEM (storage status).
     
  • {ON+key} is a gesture for rarely used features like changing the decimal separator on Voyagers or reset HP41 to factory-set. This option is available if the simulated machine is off, if the Ctrl key is held down, with a right mouse click (if reversed 'the other right') to the calculator's button in question. (Paname ROM is respected.)
RAM-tv – show/edit RAM

Red neon alert! Same warnings apply as for RAMED of ZENROM: make sure that you have first stored your programs and data onto magnetic cards or other massstorage media. Experimenting with Synthetics can corrupt programs/data held in memory. (End cit.)
Alas, CR function WALL (write all) does not comprise extended memory. Therefore I recommend to end and restart current session of NutEm/PC, so in case of mishap you may use menu point 'Quit w/o saving RAM' to recover the state before last restart.

For the inquisitive NutEm/PC displays memory as a two-level tree view (hence "RAM-tv"), see screen shot to the left. When running an HP41 (not Voyagers) it can be started with system menu point 'Sho RAM'.

The display, grouped in seven sections and sorting registers in reverse order, was certainly influenced by fig. 3.7.1 'HP-41 Memory Configuration' shown in ZENROM Usr. Mnl., p. 36. While the sections (branches, "parents") are shown in bold the registers (leaf nodes, "children") are displayed in normal font and indented. They are prefixed by their address, on "First Page" also by the register's tag, what enables a fast find by simply typing its letter. The 56 bits of a register, or 14 nibbles, are grouped to seven bytes, byte #6 to the left, #0 to the right. Data registers also indicate the register number. Except on "First Page" empty registers stay hidden, consequently empty branches can not be expanded, e. g. Data after CLRG. While running the HP41 displayed registers are updated instantly when changed. Changing the 'curtain' (address of R0) or 'chain head' (address of permanent .END.) in register 'c' ("First Page", @00D) updates the affected branches (Data, PRGM, and/or Buffer).

Handling of RAM-tv is possible quite similarly by mouse and keyboard, while incremental search for items' beginnings is only possible by keyboard. Home, End, Page up, Page down, Arrow up and Arrow down do the expected. The effect of Arrow left and right depends what is highlighted when hit, primarily a selected branch will be expanded or collapsed. If a child is selected Arrow left jumps to its parent.

Left mouse clicks (single and double) select an item, if it is a branch it's expanded. Same time an afore expanded branch will be collapsed. To keep more than one branch open the same time press Ctrl while selecting it. The mouse wheel scrolls the display (if applicable). A right mouse click presents a context menu which allows to toggle 'Read Only' and 'Read/Write' mode, indicated in the window's caption.

In 'Read/Write' mode single registers content may be edited (but not the branch names). A register is "opened" by a single left mouse click on a selected leaf node or either with F2, F11, Enter (not Return), Insert, or 8. Edit (an enforced overtype mode) is possible by typing hex values only (0..9 and A..F) and pasting from clip board. End of edit is done by Return or Esc which nullifies all changes, taking the focus off the RAM-tv dialog window causes an end of edit like Return. Moving the caret (here: overtype mark) may be done by arrow keys (including same time Ctrl for next or previous word, Home, End, Next, Prior) or mouse (left button, single click). Marking nibbles or bytes for copy to clip board is done with the a. m. keys plus same time Shift) or hoovering the cursor while left mouse button is held down.

Since empty registers are not displayed they are not at call for edit. Press Ctrl+Insert (same time) to enter the address of an empty register you'd like to modify. Entry of address is assisted but not too restrictive (to avoid maledictions), therefore invalid input is sorted out in a subsequent step showing error messages if necessary.

Notes:
  1. RAM-tv is new and may still be buggy, in case of doubtful display Return (not Enter) will update it completely,
  2. in contrast to RAMED there is no insert mode when editing in PRGM area.

About The ROMs

For a first try this NutEm/PC comes bundled with few ROMs, including a CX enabled to display lower case letters (a patched by Jean-François Garnier). More to find
for HP41
within V41 and here and there, and if still not enough more here;
for the Voyagers
here and there, see also on this pen drive.

NutEm/PC uses ROMs in a "human readable" format as shown below, columns 1..4 address, column 5 blank or a colon, columns 6..8 command, address and command values in hex. If comments follow they may start minimum at column 10, separated from commands by a blank or more. So ZEN ROM decoder print-out will do.

The ROMs that come with NutEm/PC bundle are unchanged for HP41, patched for Voyagers to fix a stack-lift bug in HP-11C and -16C. During start-up of NutEm/PC a pause patch is applied to get – regardless the speed of your PC – a 1.2 seconds delay for PSE, MEM, and View Mant (by ClrPref). To achieve this the C=C-1 X in the delay loop is replaced by 1F0, an invalid opcode. Following an example for the HP11C, similar at different spots for the others.

original:                   patched:
0D11 046 C=0    X           0D11 046 C=0    X
0D12 21C PT=    2           0D12 21C PT=    2
0D13 210 LC     8           0D13 210 LC     8
0D14 266 C=C-1  X           0D14 1F0 ** loop patch **
0D15 3FB JNC    -01 0D14    0D15 3FB JNC    -01 0D14
To pass self-tests the chksm is adjusted correspondingly.

Emulator or Simulation?

A software-defined emulator behaves like another system or computer, while a simulation imitates the operation of a real-world process only. Although the "Em" in its naming stands for 'emulator', I'd like to avoid a non-ambiguous assignment according the a. m. determinations and say instead, NutEm/PC is a "firmware interpreter". — Why? – The Nut-CPU is not emulated, it's merely "rebuilt logically", disregarding all timing and most hardware bugs of the role model. Highly likely there are differences between real machinery and its clone. But obviously it's behaving well enough not to impede the execution of all firmware available for the Nut-CPU (excluded from this claim are supplements with additional hardware like Clonix, Hepax, HP-IL, MLDL, RAMBox, and Wand). Regarding it on the whole NutEm/PC acts almost like an emulator, while behind the scene, at a different scale, it's not – it is an "emulator" of the CPU-simulating kind, thus NutEm/PC is a "firmware interpreter".

In contrast to the Voyager models, which are not extensible, the HP41 system offers many optional additions. While the "firmware interpreter" is virtually complete regarding the CPU, some of the simulated peripherals focus on the most important features. For example, the included 82162A may print text but no graphics. That is why I call this a simulation, it imitates only selected aspects of the real-world printer, not the entire printer.

NutEm/PC comes with several peripherals, completing the 'virtual machine', moving nothing but electrons (at times the operator too). Here some details:

The Time Chip Simulation

The way the TIME CHIP test of service ROM concludes TIME IC OK is a little bamboozlement. With a service ROM 2A in place I do similar reversing like VW and other cars who change motor regulation as soon as they detect to run under test conditions – what is by far more than just a dirty trick.

My reasoning is, when executed in a simulation firmware commands all take a different time span due to their complexity and implementation, moreover NutEm/PC runs on a multitasking system with its typical uncertainties. Therefore it's quite impossible to have the (also simulated, not emulated) time chip in sync with the wall clock time of the host-PC. Consequently I use the virtual Nut CPU as time standard, 64 command cycles (word time) take almost 1/100th second nominally, no matter how long this lasts. By that the very pernickety service ROM passes all tests and shows TIME IC OK after all. Neither test content nor addresses are stored within the time chip simulation, otherwise I could fake the tests entirely by a direct jump to the wanted result at once. Record a trace log and check it.

Without service ROM, time and date of the host-PC are master, what makes CORRECT, SETAF, SETDATE and SETIME of virtual HP41 useless.

The Card Reader Simulation

The CR is good for to save programs, data, calculator status or its main memory in full to magnetic cards, and to import it again. In addition, it also reads cards written by the predecessors HP-67 and -97.

NutEm/PC simulates this by writing and reading card contents to/from PC files. If the data or program to write exceeds a card's track capacity of 16 registers, the simulation "inserts" self-acting extra empty cards. Tracks belonging to a set of cards are written to a single file. Reading those "pack of cards" are processed together.

"Cards" from the predecessors HP-67 and -97 are available from Tony Nixon's classic calculator emulator – scroll his site to Try it all out and the downloads thereafter, he offers the HP-97 as "stand-alone emulator". Those card files contain a single track only. Moreover they are kind of concealed, but Tony was so kind and showed me i) how to decode it, and ii) all details about data on magnetic cards of HP67/97. For this I also "hide" my card's content and will not publish neither the source how I read Tony's HP67/97 cards nor how I treat mine. Sorry, but it's kind of a moral obligation with respect to Tony's kind assistance, without his help my CR simulation would still be incomplete.

Card Reader Simulation Extensions
As input for the CR there exists just what you saved afore and the Application PACs for HP-67/97 (scroll to Application PAC). Most HP41 software offered in the Internet is either within plug-in modules (ROM or MOD), or LIF-disk dumps, or RAW files (literally "raw", almost unspoilt program dumps), some bar code scans, or plain program listings. Thus I enabled the CR simulation to take also RAW files and LIF-disk dumps too. The various input formats are transformed to "virtual magnetic cards" then imported the same way as usual. This kind of RAW utilisation has the square advantage that it behaves in perfect compliance with GETP/GETSUB of XF and READP/READSUB of MassMem. In contrast, I never got accustomed to V41 throwing in ENDs here and there when reading RAW files, blithely disregarding decades of common usages.

In addition to HP41 and 67/97 cards, NutEm/PC may read also the LIF file types 'E040'x (41WALL), 'E050'x (41KEYS), 'E060'x (41STAT), 'E080'x (41PRGM), and 'E0D0'x (41DATA), no problem.

In contrast, there is a problem when reading RAW files, this option requires user's attention. — Why? – well, a sad story. In short, V41 running HP41 as well Emu42 when running HP-42S use for the same task but occasionally differing content, the same suffix and the same file format despite the existing chance to jeopardize an emulated calculator when reading RAW files from the wrong model. Sure, it's not lethal, but kind of nasty surprise if it happens to you. Therefore take precautions not to read RAW files originating from Emu42. There is no way (now and hardly in future although simplest to realise while writing the RAW) to prevent this misuse.

NutEm/PC offers the feature to save programs as RAW files. Proceed like saving a program to magnetic cards but change in the save file dialog file-type to *.RAW — or: choose *.RAW as PC file-type before you hit the [Insert empty card] button. Resulting RAW files are marked "provenience NutEm/PC" (in fact a single bit flipped) to make it obvious it contains a program from and for HP41. Reading such RAW files is done right away, while those untagged will query the user "Potentially unsafe input – deny or allow?" before processing (or not at will). Reading and writing RAW files is part of the CR simulation, therefore at call only when a CR module is "plugged" in the CFG file.

Since release 9 of V41 it may bundle several programs in one RAW file. In contrast, by design the CR can process only a single program at once. That is why the CR simulation reads the first routine of a bundle and saves the remaining in a temporary file which could be read next. Due to the standard CR behaviour this makes it easy to keep actually required routines only.

The IR Printer Module Simulation

The HP 82242A Infrared Printer Module, or "Blinky", is one of the last mysteries within the HP41 system. While the "Red Eye" IR protocol is documented and the bank-switched Blinky ROM is available – without description of the supposedly additional hardware it was conjectured by many experts as outright impossible to run it with a virtual HP41.

I refuted this belief: NutEm/PC effectively simulates the operation of "Blinky" using the unidirectional interface of the HP82240B Printer Simulator well known by those running printing calculators under Emu28, Emu42 and Emu48. As described in the corresponding manuals, it prints text and graphic. Printing bar code is possible, theoretically, see this append in the HP41 forum. (This 82162A simulation uses the same virtual output device but is much faster.)

Using the IR printer module reveals quite soon an important difference to both, the 82143A and 82162A printers. "Important" in respect to daily habits which end at a sudden. While the two other printers have a mode slider to set MAN–TRACE–NORM which i) shows at a quick glance the currently set print mode, and ii) allows even during a key sequence to change the mood and shift the slider to another mode – with the IR printer module this is not possible any longer. Before printing a program as compacted listing you have to enter XEQ "TRACE" first, even though, that is only needed if it wasn't already in trace mode.

To compensate for the missing slider as indicator, I display the status of the IR printer module between the topmost and next key row. The leftmost RE: stands for Red Eye what is in actual fact the IR protocol, but the abbreviation of "Blinky Status" could be misconceived. The rightmost value, prefixed by BB: is the "water level" of Blinky Buffer. The rest is quite obvious, otherwise... look elsewhere.

Note: the function TESTP (Test Printer) returns BAD at once. Without detailed descriptions of the additional hardware within the IR printer module, it's quite impossible to find out, what exactly this function is about to test, I guess.

Features, Constraints, Known Bugs

Features worth to mention:
  • New!Show/edit RAM (HP41 only),
  • Hit-n-hold – an important element of the user interface, functional when using the mouse to operate the calculator
    (if you prefer operation by key board you probably like it speedy, hence no hit-n-hold at this),
  • {ON+key} available by Ctrl + right mouse button (also as option at program launch),
  • key captions changing with shift status,
  • fuzzy logic for pasting numbers,
  • 41's beeper someway imitated vaguely only, but at least you'll be warned when typing the 24th character in alpha,
  • executing TIME CHIP test of service ROM 2A shows "TIME IC  OK" - hooray!
  • Time with SW (stop watch) and alarms — accurate to a fifths of a second (that is the pace maker's watch frequency at idle time),
  • HP41 with 82143A printer – translating 'synthetics' to human readable, eg. RCL M in place of RCL [ like the role model,
  • CR handles besides "normal" program-, data-, status-, and write-all-cards (read and write),
    HP-67/-97 cards (read only),
    RAW files (R/W), and some
    HP41 related LIF file-types within LIF disk dumps (R/O),
  • CR shows file types in lists of LIF disk dumps,
  • CR quickens handling of long lists by enhanced keyboard control,
  • Voyager's display may blink, now simulated too,
  • Voyager program listings shown with HP41 style mnemonics,
  • trace logs shown with ZENROM style mnemonics,
  • trace log shows display changes and read values of RDROM what simplifies to locate code sections,
  • in trace log POWOFF is correctly shown as double word command,
  • display of CPU count, resettable in system menu,
  • modification of setup with ease using the text editor of your choice.
Constraints, missing, annoying:
  • The surface looks nasty — by design, to make it distinguishably different (nevertheless NutEm/PC is an emulator of the CPU-simulating kind), moreover, a photo-realistic skin enforces also a display looking real beyond reproach,
  • no graphic on 82143A printer, bar code with 82242A IR printer module annoying slow — use my oo82162A IL2IR bridge, works best with V41,
  • no HP-IL for now — instead use Emu41 or V41,
  • NutEm/PC is distinctly faster than the originals — albeit about 1600 times slower than the PC versions from HP (find 12C and 15C with others in this package).
Bugs:
  • Not all bugs are fixed, two showed only once and never again, so they could bite once more.
  • Another one bites at fast scrolling (using the mouse wheel) a list of LIF disk dumps. It's missing a throttle to limit new requests for time-consuming evaluation of LIF disks.

So you are warned, do not use NutEm/PC for serious work, don't even think about it. I programmed it only to get some insight and nice trace logs, nothing else.

Manuals of The Role Models

NutEm/PC links in the system menu to related manuals. Options may be set in three ways, for details see CFG file, section [MNL].
  1. Amass all kind of files you like within quick reach in one directory. A single menu point in system menu will show it in Windows explorer. This option is favourable if there is more you need than just PDFs, e. g. the "HP-41 Quick Ref, Card for Synthetic Programming.GIF" or .JPEG or whatsoever.
  2. Collect all relevant PDF manuals related to machines NutEm/PC emulates in one directory. The first number in the filenames must match the model number, e. g. for "HP11C USR MNL Rel 15-12-85.PDF" it is the '11'. Up to six PDFs belonging to the actually emulated calculator will be linked directly in the system menu.
  3. Choosing none of the a. m. options the menu point 'Manual...' links to literature.hpcalc.org where the manual(s) in question may be found.
In addition to this site following some more references. If no PDF is referenced directly it's a format to read online (download possible).
HP41
HP-41CV Owner's Handbook and Programming Guide
HP-41CX Quick Reference Guide
In case you like to know more there is a torrent about almost all HP41.
Voyager
HP-10C Owner's Handbook
HP-11C Owner's Handbook and Problem Solving Guide (PDF, 11 MB)
HP-12C Financial Calculator User's Guide (PDF, 2.1 MB)
HP-15C Owner's Handbook (PDF, 6.5 MB)
HP-16C Computer Scientist Owner's Handbook (PDF, 2 MB)

The fine print

On the whole:
(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.

Furthermore, for the parts with source code:
(iii) If you manage to improve this program you have to inform me as stipulated in following THE Q PUBLIC LICENSE (QPL).
(iv) Over and above that applies the QPL below:


THE Q PUBLIC LICENSE version 1.0

Copyright (C) 1999 Trolltech AS, Norway.

Everyone is permitted to copy and distribute this license document. The intent of this license is to establish freedom to share and change the software regulated by this license under the open source model.

This license applies to any software containing a notice placed by the copyright holder saying that it may be distributed under the terms of the Q Public License version 1.0. Such software is herein referred to as the Software. This license covers modification and distribution of the Software, use of third-party application programs based on the Software, and development of free software which uses the Software.

Granted Rights

  1. You are granted the non-exclusive rights set forth in this license provided you agree to and comply with any and all conditions in this license. Whole or partial distribution of the Software, or software items that link with the Software, in any form signifies acceptance of this license.
  2. You may copy and distribute the Software in unmodified form provided that the entire package, including - but not restricted to - copyright, trademark notices and disclaimers, as released by the initial developer of the Software, is distributed.
  3. You may make modifications to the Software and distribute your modifications, in a form that is separate from the Software, such as patches. The following restrictions apply to modifications:
    a. Modifications must not alter or remove any copyright notices in the Software.
    b. When modifications to the Software are released under this license, a non-exclusive royalty-free right is granted to the initial developer of the Software to distribute your modification in future versions of the Software provided such versions remain available under these terms in addition to any other license(s) of the initial developer.
  4. You may distribute machine-executable forms of the Software or machine-executable forms of modified versions of the Software, provided that you meet these restrictions:
    a. You must include this license document in the distribution.
    b. You must ensure that all recipients of the machine-executable forms are also able to receive the complete machine-readable source code to the distributed Software, including all modifications, without any charge beyond the costs of data transfer, and place prominent notices in the distribution explaining this.
    c. You must ensure that all modifications included in the machine-executable forms are available under the terms of this license.
  5. You may use the original or modified versions of the Software to compile, link and run application programs legally developed by you or by others.
  6. You may develop application programs, reusable components and other software items that link with the original or modified versions of the Software. These items, when distributed, are subject to the following requirements:
    a. You must ensure that all recipients of machine-executable forms of these items are also able to receive and use the complete machine-readable source code to the items without any charge beyond the costs of data transfer.
    b. You must explicitly license all recipients of your items to use and re-distribute original and modified versions of the items in both machine-executable and source code forms. The recipients must be able to do so without any charges whatsoever, and they must be able to re-distribute to anyone they choose.
    c. If the items are not available to the general public, and the initial developer of the Software requests a copy of the items, then you must supply one.

Limitations of Liability

In no event shall the initial developers or copyright holders be liable for any damages whatsoever, including - but not restricted to - lost revenue or profits or other direct, indirect, special, incidental or consequential damages, even if they have been advised of the possibility of such damages, except to the extent invariable law, if any, provides otherwise.

No Warranty

The Software and this license document are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Choice of Law

This license is governed by the Laws of England (if not yet part of Spanish East Indies)