US orders - shipping cost for small items includes tariffs cost !!!

HP16c Programs !!

The HP-16C is a classic programmable RPN calculator designed for computer science tasks like bit manipulation, base conversions, and integer arithmetic. While it's discontinued, enthusiast communities have preserved and created programs for it. Below, I've reformatted the information with clean program listings using code blocks for clarity. These include full keystroke listings (enter them in Program mode via g PRGM), descriptions, and usage notes.

1. Integer-to-Float and Float-to-Integer Converter

Author: Jamie Cox

Description: Provides subroutines to switch between floating-point and 32-bit integer (hex) modes, useful for mixed-mode programming. Handles basic conversions but truncates fractions and may not fully support negatives/fractions—use for positive integers primarily.

Usage:

GSB A: Float to 32-bit hex integer (enter float in X).

GSB 9: Integer (any base) to float with 3 decimal places.

2. IBM Hex Floating-Point to HP Float Converter

Author: Neil Redmond

Description: Converts IBM hexadecimal floating-point format (from old COBOL/mainframe data) to standard HP-16C floating-point. Includes two subroutines for bidirectional conversion, leveraging bit shifts and masks. Sample input: 44A45B40 → 42075.25.

Usage: Enter IBM hex value in X, then GSB A (IBM to HP) or GSB B (HP to IBM). Set to HEX mode first.

3. Enhanced Float/Integer Converter with INT and RND Functions

Author: Richard Beal

Description: Improved converter handling negatives and fractions (truncates on float-to-int). Adds missing HP-16C functions: INT (floor) and RND (round to nearest integer). Uses subroutines for sign handling and rounding.

Usage:

GSB A: Float to hex integer.

GSB 9: Integer to float (4 decimals).

GSB B: INT on float in X.

GSB D: RND on float in X.

4. Exponentiation by Squaring (Integer Mode)

Author: Daniel Fox

Description: Implements efficient integer exponentiation (y^x where x ≥ 1) using binary exponentiation to minimize multiplications. Works in integer mode only; great for large exponents without overflow checks.

Usage: Integer mode. Base in Y, exponent in X, then GSB E. Result in X.

5. Towers of Hanoi Puzzle Solver

Author: Valentin Albillo

Description: Non-recursive solver for the Towers of Hanoi puzzle (move N disks from peg 1 to 3 using peg 2). Uses indirect addressing, variable word size (8 bits), and logical ops to simulate recursion up to 111 levels. Pauses to show moves.

Usage: DEC mode, UNSGN. Enter N (e.g., 3), GSB A, then R/S per move. Shows "FROM X TO Y" with disk #. For N=3: 7 moves.

HP16c Programs