/rpn83p

RPN calculator app for TI-83 Plus and TI-84 Plus inspired by HP-42S

Primary LanguageAssemblyMIT LicenseMIT

RPN83P

RPN calculator app for the TI-83 Plus and TI-84 Plus inspired by the HP-42S.

RPN83P is an RPN calculator app for the TI-83 Plus (including the Silver Edition) and the TI-84 Plus (including the Silver Edition). The app is inspired mostly by the HP-42S calculator, with some significant features from the HP-12C and the HP-16C.

The RPN83P is a flash application written in Z80 assembly language that consumes 2 pages (32 kiB) of flash memory. Since it is stored in flash, it is preserved if the RAM is cleared. It consumes about 735 bytes of TI-OS RAM through 3 AppVars: RPN83REG (496 bytes), RPN83STK (116 bytes), and RPN83SAV (123 bytes).

Summary of features:

  • traditional 4-level RPN stack (X, Y, Z, T), with LastX register
  • 8-line display showing all stack registers
  • hierarchical menu system similar to HP-42S
  • quick reference HELP menu
  • storage registers
    • store and recall:STO nn, RCL nn
    • storage arithmetics: STO+ nn, STO- nn, STO* nn, STO/ nn, RCL+ nn, RCL- nn, RCL* nn, RCL/ nn
    • 25 storage registers: nn = 00..24
  • all math functions with dedicated buttons on the TI-83 Plus and TI-84 Plus
    • arithmetic: /, *, -, +
    • algebraic: 1/X, X^2, SQRT, ^ (i.e. Y^X)
    • transcendental: LOG, 10^X, LN, e^X
    • trigonometric: SIN, COS, TAN, ASIN, ACOS, ATAN
    • constants: pi and e
  • additional menu functions
    • arithmetic: %, %CH, GCD, LCM, PRIM (prime factor), IP (integer part), FP (fractional part), FLR (floor), CEIL (ceiling), NEAR (nearest integer), ABS, SIGN, MOD, MIN, MAX
    • algebraic: X^3, 3RootX
    • transcendental: XRootY,2^X, LOG2, LOGB, E^X- (e^x-1), LN1+ (log(1+x))
    • trigonometric: ATN2
    • hyperbolic: SINH, COSH, TANH, ASNH, ACSH, ATNH
    • probability: PERM, COMB, N!, RAND, SEED
    • angle conversions: >DEG, >RAD, >HR, >HMS, >REC, >POL
    • unit conversions: >C, >F, >hPa, >inHg, >km, >mi, >m, >ft, >cm, >in, >um, >mil, >kg, >lbs, >g, >oz, >L, >gal, >mL, >floz, >kJ, >cal, >kW, >hp
  • statistics and curve fitting, inspired by HP-42S
    • statistics: Sigma+, Sigma-, SUM, MEAN, WMN (weighted mean), SDEV (sample standard deviation), SCOV (sample covariance), PDEV (population standard deviation), PCOV (population covariance)
    • curve fitting: Y>X, X>Y, SLOP (slope), YINT (y intercept), CORR (correlation coefficient)
    • curve fit models: LINF (linear), LOGF (logarithmic), EXPF (exponential), PWRF (power)
  • base conversion and bitwise operations, inspired by HP-16C and HP-42S
    • base conversions: DEC, HEX, OCT, BIN
    • bitwise operations: AND, OR, XOR, NOT, NEG, REVB (reverse bits), CNTB (count bits)
    • integer arithmetics: B+, B-, B*, B/, BDIV (divide with remainder)
    • shift and rotate: SL, SR, ASR, RL, RR, RLC, RRC, SLn, SRn, RLn, RRn, RLCn, RRCn
    • carry flag and bit masks: CCF, SCF, CF?, CB, SB, B?
    • word sizes: WSIZ, WSZ?: 8, 16, 24, 32 bits
  • time value of money (TVM), inspired by HP-12C, HP-17B, and HP-30b
    • N, I%YR, PV, PMT, FV, P/YR, BEG, END, CLTV (clear TVM)
  • complex numbers, inspired by HP-42S and HP-35s
    • stored in RPN stack registers (X, Y, Z, T, LastX) and storage registers R00-R24
    • computation modes: RRES (real results), CRES (complex results)
    • display modes: RECT, PRAD (polar radians), PDEG (polar degrees)
    • linking/unlinking: 2ND LINK (convert 2 reals to 1 complex, same as COMPLEX on HP-42S)
    • number entry: 2ND i (rectangular), 2ND ANGLE (polar degrees), 2ND ANGLE 2ND ANGLE (polar radians)
    • extended regular functions: +, -, *, /, 1/x, x^2, SQRT, Y^X, X^3, 3RootY, XRootY, LOG, LN, 10^x, e^x, 2^x, LOG2, LOGB
    • complex specific functions: REAL, IMAG, CONJ, CABS, CANG
    • unsupported: trigonometric and hyperbolic functions (not supported by TI-OS)
  • various modes (MODE)
    • floating display: FIX, SCI, ENG
    • trigonometric: RAD, DEG
    • complex computation: RRES, CRES
    • complex display: RECT, PRAD, PDEG
    • SHOW (2ND ENTRY): display all 14 internal digits

Missing features (partial list):

  • vectors and matrices
  • keystroke programming

Version: 0.9.0 (2024-01-06)

Changelog: CHANGELOG.md

Project Home: https://github.com/bxparks/rpn83p

User Guide: USER_GUIDE.md

Table of Contents

Installation

RPN83P is a flash application that is packaged as a single file named rpn83p.8xk. Detailed instructions are given in the RPN83P User Guide, but here is the quick version:

  • Download the rpn83p.8xk file from the releases page.
  • Upload the file to the TI-83 Plus or TI-84 Plus calculator. Use one of following link programs:
  • Run the program using the APPS:
    • Press APPS
    • Scroll down to the RPN83P entry
    • Press ENTER
  • Exiting:
    • Quit app: 2ND QUIT
    • Turn off device: 2ND OFF

The RPN83P app starts directly into the calculator mode, like this:

RPN83P Initial Start Screen

Supported Hardware

This app was designed for TI calculators using the Z80 processor:

  • TI-83 Plus (6 MHz Z80, 24 kB accessible RAM, 160 kB accessible flash)
  • TI-83 Plus Silver Edition (6/15 MHz Z80, 24 kB accessible RAM, 1.5 MB accessible flash)
  • TI-84 Plus (6/15 MHz Z80, 24 kB accessible RAM, 480 kB accessible flash)
  • TI-84 Plus Silver Edition (6/15 MHz Z80, 24 kB accessible RAM, 1.5 MB accessible flash)

The app configures itself to run at 15 MHz on supported hardware, while remaining at 6 MHz on the TI-83+.

I have tested it on the following calculators that I own:

  • TI-83 Plus, OS v1.19
  • TI-83 Plus Silver Edition, OS v1.19
  • TI-84 Plus Silver Edition, OS v2.55MP

Community members have verified that it works on the TI-84 Plus.

The following calculators are not supported because their internal hardware is too different:

  • TI-84 Plus C Silver Edition
  • TI-84 Plus CE

Quick Examples

Example 1

Let's compute the volume of a sphere of radius 2.1. Recall that the volume of a sphere is (4/3) pi r^3. There are many ways to compute this in an RPN system, but I tend to start with the more complex, inner expression and work outwards. Enter the following keystrokes:

  • Press 2 button
  • Press . button
  • Press 1 button
  • Press x^2 button
  • Press 2ND ANS button (invokes the LastX functionality)
  • Press * button (r^3 is now in the X register)
  • Press 2ND PI button (above the ^ button)
  • Press * button (pi r^3)
  • Press 4 button
  • Press * button (4 pi r^3)
  • Press 3 button
  • Press / button (4 pi r^3 / 3)
  • the X register should show 38.79238609

Here is an animated GIF that shows this calculation:

RPN83P Example 1 GIF

(Note that the RPN83P provides a X^3 menu function that could have been used for this formula, but I used the LastX feature to demonstrate its use.)

Example 2

The RPN83P supports most of the base conversion and logical operators found on the HP-42S and the HP-16C calculators.

Let's calculate the bitwise-and operator between the hexadecimal numbers B6 and 65, then see the result as an octal number (base-8), a binary number (base-2), then right shift the result 3 bits which sets the Carry Flag, then view the final result as a decimal number:

  • Press MATH to reset the menu to the home row.
  • Navigate the menu with the DOWN arrow to get to ROOT MenuRow 2
  • Press BASE menu to get to BASE Menu DEC
  • Press HEX menu to get to BASE Menu HEX
  • Press ALPHA B buttons
  • Press 6 button
  • Press ENTER button
  • Press 6 button
  • Press 5 button
  • Press DOWN arrow to get to the menu row with the AND menu item BASE MenuRow AND
  • Press AND menu, the X register should show 00000024
  • Press UP arrow to go back to BASE Menu HEX
  • Press OCT menu, the X register should show 00000000044 with the menu showing BASE Menu OCT
  • Press BIN menu, the X register should show 00000000100100 with the menu showing BASE Menu BIN
  • Press DOWN DOWN (twice) to the menu row with the shift right SR item BASE MenuRow SR
  • Press SR SR SR (three times) to show 00000000000100 and the Carry Flag C set
  • Press UP UP (twice) to reach the base conversion menu row BASE Menu BIN
  • Press DEC menu, the X register should show 4 with the menu showing BASE Menu DEC

Here is the animated GIF that shows this calculation:

RPN83P Example 2 GIF

Example 3

The RPN83P supports the Time Value of Money functionality of the HP-12C calculator.

In this example:

  • We calculate the monthly payment of a $500,000 mortgage over 30 years at 8%, then,
  • We recalculate the payment at 7%, then,
  • We fix the monthly payment at $3000/month and calculate the interest rate that is needed for that monthly payment.

Here are the steps:

  • Press MATH to reset the menu to the home row.
  • Navigate the menu with the DOWN arrow to get to ROOT MenuRow 2
  • Press the TVM menu to get to TVM MenuRow 1
  • Press the DOWN arrow to get to TVM MenuRow 2
  • Press the CLTV button to clear the TVM variables.
  • Press the UP arrow to get back to TVM MenuRow 1
  • Press 360 N (30 years * 12 months = 360 payments)
  • Press 8 I%YR (interest percent per year)
  • Press 500000 PV (present value)
  • Press 0 FV (future value)
  • Press PMT (payments)
    • You should see -3668.822869 ($3668.82)
  • Press 7 I%YR
  • Press PMT
    • You should see -3326.512476 ($3326.51)
  • Press -3000 PMT
  • Press I%YR
    • After a couple of seconds, you should see 6.006990008 (6%).

Here is the animated GIF that shows this calculation:

RPN83P Example 3 GIF

Example 4

Let's add 4 complex numbers, divide by 4 to get their average, view the result in rectangular, polar radian, and polar degree modes, then extract the complex magnitude of the result. The following complex numbers were chosen to illustrate the 4 ways that complex numbers can be entered into RPN83P:

  • 100 - i/(2*pi*60*(1e-5)) using 2ND LINK
  • 100 + 250i using 2ND i
  • 200 e^(i 10deg) using 2ND ANGLE
  • 300 e^(i 0.1) using 2ND ANGLE 2ND ANGLE

The keystrokes are:

  • (optional) Press CLEAR CLEAR CLEAR to clear the RPN stack.
  • Press MODE downarrow RECT: MODE MenuRow 2
  • Press 100 ENTER
  • Press 2 PI * 60 * 1 EE 5 (-) * 1/X (-) (-265.26)
  • Press 2ND LINK (100-265.26i)
  • Press 100 2ND i 250 + (200-15.26i)
  • Press 200 2ND ANGLE 10 + (396.96+19.47i)
  • Press 300 2ND ANGLE 2ND ANGLE 0.1 + (695.46+49.42i)
  • Press 4 / (173.89+12.35i)
  • Press PRAD (174.30 e^(i 0.07)
  • Press PDEG (174.30 e^(i 4.04deg))
  • Press MATH CPLX: CPLX MenuRow 1
  • Press CABS (174.30)

RPN83P Example 4 GIF

Exiting the Menu

Press:

  • ON button (ESC/EXIT) multiple times to back to the home menu, or
  • MATH button (HOME) to go back directly.

ROOT MenuRow 1

Documentation

Compiling from Source

I use Ubuntu Linux 22.04 for my development. The following instructions have been verified only on my dev machine.

  • Clone this repo:
    • $ git clone git@github.com:bxparks/rpn83p.git
    • develop branch (default) contains the active development
    • master branch contains the stable release
  • Install spasm-ng.
    • I use the static binary zip file, because the .deb file would not resolve dependencies.
    • Unpack the zip file so that the spasm directory is a sibling to the rpn83 directory. (See the SPASM_DIR variable inside the Makefile).
  • $ cd src
  • $ make
  • Should produce a file named rpn83p.8xk.

Tools and Resources

Here are the tools and resources that I used for development on Ubuntu Linux 22.04:

License

MIT License

Feedback and Support

If you have any questions, comments, or feature requests for this library, please use the GitHub Discussions for this project. If you have bug reports, please file a ticket in GitHub Issues. Feature requests should go into Discussions first because they often have alternative solutions which are useful to remain visible, instead of disappearing from the default view of the Issue tracker after the ticket is closed.

Please refrain from emailing me directly unless the content is sensitive. The problem with email is that I cannot reference the email conversation when other people ask similar questions later.

Author

Created by Brian T. Park (brian@xparks.net).