Post Reply 
Bit's WP 34S and 31S patches and custom binaries (version: r3802 20150805-1)
11-15-2014, 08:49 PM (This post was last modified: 08-06-2015 02:27 AM by Bit.)
Post: #1
Bit's WP 34S and 31S patches and custom binaries (version: r3802 20150805-1)
I've been usually asked to provide compiled binaries along with my patches for the WP 34S and 31S. I'll publish here the custom builds and those patches that haven't yet made it into the mainline code so they can all be found in one place. Some features in these builds are already present in mainline as compile time options but are disabled, other features are new.

Feedback would be very welcome. I will check this thread every once in a while and update the patches and builds, but not necessarily very often unless I get prodded. Please just send me a private message instead of posting here if you'd only like to ask for updated builds.

It's easy to produce multiple binaries with various patches or compile time options so if you think some other combination of settings would really make sense, let me know. I'm happy to port patches to the 31S and fix bugs but I don't use it regularly, so the users of the 31S are expected to test everything thoroughly.

Changes in the current version compared to mainline:
  • Y register displayed by default
    While it's easy to understand and get used to the basic idea of a stack, it may not be easy for a complete beginner who's new to RPN to master all its nuances, for example to develop such a good intuitive grasp on when to expect a stack lift, and when not to, that they're never taken by surprise. Having a constant reminder on the screen makes it much easier. Therefore I consider the Y register display a more beginner-friendly default. It makes sense to require advanced users to change it if they prefer rather than the other way around.
  • Y register display in integer modes (34S only)
    The Y register can be displayed not only in floating point modes but also in integer modes. The least significant digits are cut off if necessary and the number of removed digits is indicated after a colon, like very large exponents in double precision mode. A new status screen, accessible by [h] [STATUS], shows the word size and the signed integer representation. A more detailed description can be found here.
    [Image: attachment.php?aid=1533]
  • Quick access to bitwise operations (34S only)
    Bitwise operations are directly accessible from the keyboard, no need to dive into catalogs. It's a huge time saver. Please see the illustrated explanation.
  • Four-digit exponents (34S only)
    Four-digit exponents are displayed, and can be entered directly, in double precision mode. During number entry the last three digits of the mantissa are removed if necessary to make space for the four-digit exponent. The mantissa is not rounded in this case and a right hook indicates that some entered digits are not shown, as you can see in the upper two screens in the attached image. When a result with a four-digit exponent is displayed, only the first ten correctly rounded digits of the mantissa are shown as you can see in the lower screens. (I added these features to mainline but they're disabled there.)
    [Image: attachment.php?aid=1534]
  • Smart exponent limits
    The range of valid exponents for the currently entered mantissa is dynamically calculated. You may enter any exponent as long as the number can be stored without loss of precision or overflow. For example, 0e999 or 0.1e385 are allowed in single precision mode but 10e384 isn't. Entering denormal (also called subnormal) numbers is allowed as long as all entered digits can be stored. The digits of the exponent aren't shifted, you receive a warning instead if you try to enter an invalid exponent. (I added these features to mainline but they're currently disabled pending a decision about the default configuration. See this post for the available compile time configuration options.)
  • Significant figures modes
    Two new display modes, SIG and SIG0 (accessible via the [h] FIX catalog in the 34S or the [f] DISP catalog in the 31S), allow the user to specify the number of significant digits displayed. Please see the detailed explanation. (This feature is present but disabled in mainline.)
  • More user-friendly fraction entry
    In the original builds if you enter two numbers as a..b with two consecutive decimal marks, you get the weird mixed fraction a 0/b, which is really the integer a. While this is very simple to implement because it's consistent with how ordinary mixed fractions are handled, it serves no useful purpose. In my builds a..b is treated the same as .a.b and produces the fraction a/b, which makes it more convenient to enter fractions for those who don't find it natural to always start fractions with a decimal mark. (This feature is present but disabled in mainline.)
  • Easy switching between proper and improper fractions (31S only)
    The [f] [a b/c] key switches between proper and improper fractions (or perhaps more accurately: toggles mixed fractions) when already in fraction mode. The IMPFRC and PROFRC commands have been removed from the MODE catalog since they're no longer needed.
  • EEX and decimal fractions exit fraction mode
    Entering a number with an exponent or entering a decimal fraction (e.g. 1.23) will automatically exit fraction mode. (I added these features to mainline but they're disabled there.)
  • Reverse angular conversions (34S only)
    The conversion arrow can be reversed by pressing it again, and the reversed arrow converts from the selected angular mode to the current angular mode. This is much faster than entering the conversion catalog, and the last remembered catalog position doesn't change.
  • Easy angular conversions (31S only)
    The ->DEG function always converts radians to degrees and the ->RAD function always converts degrees to radians, regardless of the current angular mode, so you can do conversions in either direction without having to switch modes. The modified behavior is more sensible than ->DEG doing nothing in degrees mode and ->RAD doing nothing in radians mode because the 31S doesn't support gradians and so only two conversions are possible. It's also what calculators typically do and what most users expect.
  • Rectangular/Polar conversions save the Y register (34S only)
    Rectangular/Polar conversions cannot always be reverted using only the last value of X (register L) because the angular result is reduced modulo 360°. Saving the Y register as if the conversion was a complex operation (and it could certainly be considered as such) solves the problem. There was only one example program in the library that depended on the I register not being modified during such conversions, and I've included a patch to fix that.
    I didn't add this feature to the 31S because on the one hand it doesn't support complex operations so updating the I register would be unusual there, and on the other hand its undo operation can be used to recover the original values.
  • ALL 4 display
    The default display mode after a reset is ALL 4, so up to three zeros can appear after the decimal mark before the display switches to scientific notation. This is more similar to what other calculators typically do and what most people would probably expect than the original default of ALL 0 that makes e.g. 1/3 appear as 3.33333333333e-1. If you prefer the old behavior, just set ALL 0 manually.
  • Easy toggling of the thousands separator (34S only)
    The [h] [./,] key toggles the thousands separator instead of changing the decimal mark. Commas and periods aren't easily distinguishable on the screen of the HP 20b/30b so you could find yourself turning the thousands separator on and off under different lighting conditions or depending on the numbers you work with. A shortcut for that operation is much more useful than one for changing the decimal mark, because most people will select their preferred decimal mark when they start using the calculator and will never change it again. (This feature is present but disabled in mainline.)
  • Eight-level stack by default
    Newcomers to RPN could easily run out of four stack levels if they perform calculations in the wrong order. It also helps with complex numbers etc. and probably many advanced users prefer it but the primary goal is to make the defaults as beginner-friendly as possible.
  • Stack size displayed
    One dot in the upper line indicates a four-level (single) stack and two dots indicate an eight-level (double) stack. These indicators disappear automatically if something else needs the space. (I added this feature to mainline but it's disabled there.)
  • Order of catalog entries fixed (optional)
    In the official build arrow characters are sorted together with alphanumeric ones. This results in, for example, 'mmHg->Pa' preceding 'm->feet' in the conversion menu, which I find very unnatural because the arrow looks like punctuation between words and shorter words should come before longer ones in the dictionary order. This is fixed in my builds and applies to all catalogs.
    For those who are used to the original ordering, I also provide alternative builds with all other changes included except this one.
  • Unit conversions
    - I've renamed 'cft' to 'cu.ft' because the 'cft' notation is very rarely used.
    - I've added sq. ft because it's commonly used and we already have ft and cu. ft among the unit conversions, so it fills a gap.
    - I've added miles per gallon conversions because they're commonly used and aren't very simple to calculate without a dedicated function.
    - The original names of the U.S. survey foot based units ('feetUS' and 'acreUS') were misleading because they're never actually used in everyday situations in the United States. I've renamed them and since probably nobody used them (except by mistake), they're disabled. (If someone does need those units, please let me know.)
    Earlier discussion about these changes can be found here.
    The PREVP command (find the previous prime number), analogous to NEXTP, has been added to the X.FCN catalog in the 34S and the MORE catalog in the 31S. (I added the code to mainline in r3702 but it's disabled there.)
  • FACTOR, FIB, LOGx, SLVQ, Wp and Wm (31S only)
    The FACTOR (find smallest prime factor), FIB (extended Fibonacci number), LOGx, SLVQ (solve quadratic equation) and Wp and Wm (principal and negative branches of the Lambert W function) commands have been added to the MORE catalog. (These are already available in the 34S, except FACTOR, which is a compile time option that's disabled by default.) SLVQ works exactly as on the 34S and returns complex roots (indicated by a lower case 'i' in the upper line) even though the 31S doesn't support complex calculations otherwise.
  • Warnings in the upper line
    Warnings about invalid digits or exponents are displayed in the upper line only and don't hide the number you're currently typing. The messages are just as informative as before (the lower line only contains the word 'error' in the official build) but they're less visually disruptive. (I added this feature to mainline but it's disabled there.)
  • No-crystal builds (34S only)
    34S binaries ('noxtal') that don't support the crystal oscillator are included. This saves about 1000 bytes compared to the default build. (I added this feature to mainline but such binaries aren't published currently.)
  • No-stopwatch builds (34S only)
    I've included variants of the 'xtal' and 'ir' builds that lack the stopwatch function. This saves about 2000 bytes in the firmware, which is a significant reduction. Many devices offer similar functionality nowadays so it may be a worthwhile trade-off for some. The 'ir_full' binaries are only available without the stopwatch as they'd be too big otherwise.
  • No BEG annunciator (31S only)
    Since the 31S isn't programmable, there's no point in having the little BEG sign lit up on the display.
  • Universal dispatch
    Experimental feature that slightly reduces the size of the firmware, it's present in mainline but is currently disabled there (see point 2 here).
Previously applied changes that have since been incorporated into mainline:
  • Pretty full number display
    When viewing the full X register digits are grouped to improve legibility and the sign is displayed for negative numbers.
    [Image: attachment.php?aid=1218]
The attached file contains all binaries and patches, it's a 7-Zip archive inside a plain old Zip file. The newer 7-Zip format compresses the binaries really well (free decompressors are available for all major operating systems, for example at, and the outer Zip container is used because this forum doesn't accept 7-Zip attachments.

20141115-1: YDON by default, thousands sep. toggling (34S), a..b fractions, stack size shown, reordered catalogs (optional), cu.ft renamed, sq.ft, mpg, no survey units, universal dispatch, r3688.
20141115-2: LOGx (31S).
20141116-1: Easy switching between im/proper fractions (31S), FIB (31S), r3690.
20141117-1: Pretty full numbers, no BEG annunciator (31S), improved patch for switching between im/proper fractions (31S).
20141127-1: Eight-level stack by default, PREVP, SLVQ (31S), noxtal (34S), pretty full numbers moved to mainline, r3705, build environment fixed.
20150102-1: Y reg. in int. modes (34S), large exponents (34S), smart exp. limits, FACTOR (31S), Wp & Wm (31S), warnings in the upper line, no-stopwatch builds (34S), r3719.
20150121-1: EEX and dec. fractions exit fraction mode, ALL 4, r3738.
20150125-1: Quick bitwise operations (34S), r3743.
20150131-1: Reverse angular conv. (34S), easy angular conv. (31S), R<->P saves Y (34S), VERS indicates modified build, r3745.
20150207-1: Significant figures modes, r3747.
20150805-1: r3802.

Attached File(s) Thumbnail(s)

.zip (Size: 339.42 KB / Downloads: 54)
.zip (Size: 339.91 KB / Downloads: 42)
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Bit's WP 34S and 31S patches and custom binaries (version: r3802 20150805-1) - Bit - 11-15-2014 08:49 PM

User(s) browsing this thread: 1 Guest(s)