rejig

HP-15C Support
Login

HP-15C Support

Because the HP-15C support in rejig shares many of the 30-series limitations — and for the same essential reasons — I will not repeat all that here. Instead, I will give the differences particular to these I/O paths.

The general limitations of rejig are also worth review, to set the broader context.

Input

There are four alternative input paths:

The following HP-15C features needed careful mapping:

Matrices

Is the following a valid HP-15C program?

LBL A
  STO B
  RTN

It depends, because HP-15C registers A-E can only be used to store matrices, which then calls into question whether the indexing registers (R0 and R1) are within the predefined range for B’s dimensions. If not, the machine will spit an unfriendly Error 3 back at you when you run the program.

In the interest of not being overly restrictive, rejig does not attempt any type of static analysis to predict HP-15C register misuse. While it could in principle produce a call graph, then walk it with the intent of finding the DIM that applies to each matrix register at each step in the program, a proper model of the calculator’s runtime rules would also require knowing the contents of the stack. Lacking this, our translation-time rejig validation rules must presume the programmer knows their own business and blindly allow STO/RCL with A-E for HP-15C I/O.

There is no mapping for any of the HP-15C’s programmable MATRIX ops due to the near-total mismatch with the way the R47 handles matrices. Take MATRIX 0 for example, which zeroes the dimensions for all five (A-E) matrices; for that to work on the R47, it would have to walk not only its vastly larger register space looking for matrices to redimension, it’d have to do the same for the named variables. That’s doable in principle, but one may readily see why the R47 developers chose not to offer that facility. Without an IR form to raise an HP-15C MATRIX call to, there is nothing to lower it from even in a 15-to-15 translation.

Automatic register name mapping is restricted to the numbered registers when the target is an HP-15C format. It will only use the named registers A-E in its output when they were explicitly given as input.

Numeric Entry Tricks

Because Voyagers encode each numeric input keypress separately, while the R47 instead stores numbers whole, constructs like this will fail:

x=? 0.
  .
1

That puts either .1 or 1 into X depending on whether the prior value was nonzero, giving you a conditional divide-by-10 factor. While there is doubtless at least one way to recode that to work as intended on an R47, rejig is not yet clever enough to apply such a transformation automatically on your behalf, and as a result, it must currently abort the conversion with an error when it detects such trickery.

Output

Excepting the single input-only path documented above, inverses for each exist on the output side:

Lowering programs using SOLVE strips the injected instructions mentioned above. It also translates PGMSLV ops back to the SOLVE key codes.

Of what’s left, I believe everything round-trips cleanly. Where you are most likely to run into trouble is when starting with --from $SOMETHING_ELSE.

Cosmetics

There are several minor cosmetic differences between rejig --to hp15c output and that of the simulators:

The point of listing these differences is that it affects my round-tripping tests. If you load one of my programs up into one of the simulators and save it right back out, the differences listed will make this test appear to fail. A proper round-trip test uses rejig throughout the chain.

RLM-15C

This is another fine HP-15C simulator, which uses a different (JSON-based) file format. Because it uses the *.15C file name extension and rejig matches that case-insensitively, you must give --from/to rlm15c to read these files in/write them out.

This format can include non-program data such as the contents of the stack, the simulator settings, etc., but rejig ignores all that. Because the RLM simulator preserves elements not explicitly overwritten, round-tripping a program through rejig does not necessarily lose these other elements. Simply load the new program atop the existing configuration, then save it back out with those items checked in the “Select data to Save” dialog that pops up.

(You may now wish to return to the rejig home page.)

License

This work is © 2026 by Warren Young and is licensed under CC BY-NC-SA 4.0


  1. ^ The author “…sees no advantage in offering the help files without the simulator.” Well, I see one: it would let me point people directly to the docs I used without using OS-specific file:// URLs like this one for macOS.
  2. ^ The Manz sim will conform to my strong preference for UTF-8 if one goes into its Preferences and unchecks the “Encode programs in UTF-16 (LE)” option on the Files tab.
  3. ^ Well, mostly. Because HP-15C matrix support in rejig is nearly nonexistent, our instruction counter cannot recognize their key codes and classify them with the 2-byte set. This includes the oddball STO/RCL g (i) instruction; rejig cannot parse it, so there’s no point teaching its byte counter about it.