Programming the RPN-25


A program is simply a sequence of manual keystrokes that is remembered by the calculator. You can then execute the program as often as you like – typically with just one keystroke. The answer displayed at the end of execution is the same one you would have obtained by pressing the keys one at a time manually. No prior programming experience is necessary for RPN-25 calculator programming.

To get you started, try entering and executing the sample program shown on the Info screen of RPN-25 CE (tap the Info button at the bottom right).


Entering and running a program







Reviewing your program






Debugging your program






Editing your program






Adding or removing steps will automatically adjust all affected GTO and GSB commands.
For example, if you enter GTO 10 after step 03 to branch to line 10, what gets stored is GTO 11, since the GTO instruction caused the rest of program memory to move down one line.
However, if the GTO's target lies in the unused program area past your last program step, no adjusting takes place.





Example program 1 – Sum of 1 to x




Example: Find the sum of all integers from 1 to 100.

Solution: Enter 100, tap R/S. Result: 5050




Example program 2 – Quadratic Equation





Find solutions to the three equations below:

1.  x² + x - 6 = 0
2.  2.25x² + 3x + 1 = 0
3.  2x² - 3x + 5 = 0

1.
6 CHS ENTER 1 ENTER R/S → 6.2500 (D > 0, so solutions are real)
After 2 seconds:
→ -3.0000 (x₁)
R/S
→ 2.0000 (x₂)


2.
1 ENTER 3 ENTER 2.25 R/S → 0.0000 (D = 0, so solutions are real and equal)
After 2 seconds:
→ -0.6667 (x₁)
R/S
→ 0.6667 (x₂)


3.
5 ENTER 3 CHS ENTER 2 R/S → -1.9375 (D < 0, so solutions are complex)
After 2 seconds:
→ 0.7500 (u)
R/S
→ 1.3919 (v)
x₁,x₂ = 0.7500 ± 1.3919 i





Using GTOs and GSBs correctly

NOTE: This section applies to regular branches as found on the vintage HP-25. It is highly recommended to make use of the advanced _GTO, _GSB, and _LBL commands provided by RPN-25 CE instead.

When inserting or deleting program steps, RPN-25 automatically readjusts all affected GTO and GSB branch instructions. This huge time-saver is not entirely free of pitfalls.

Consider the following simple program that takes the square root of x.
If x is negative, 1 is added to its positive value first.
Negative values of x are handled in the subroutine starting at step 05.

Deleting CHS at step 05 causes the GSB in step 02 to address the preceding step 04 instead.

Restoring the deleted step doesn't change the target of the GSB – the program will not work anymore.

The cure:

Start the target of any GTO or GSB branch instruction with a NOP instruction.

Doing so will also allow you to easily insert an instruction before the
first target instruction.

Re-targeting the GSB to the original step 05 fixes the program.

RPN-25 identifies NOPs used as branch targets, renaming them to LBL nn (where nn is the step number) and assigning them their own keycode 98.

Deleting the GSB instruction transforms the LBL instruction back into an ordinary NOP.

To re-insert the GSB instruction after step 01, enter GSB 04 (not GSB 05, since step 04 is where the NOP is currently located.)





Data Files

Create, modify and import files that contain register data only (R00..R99.)
This feature allows you to easily run a program with different data sets.


Creating a data file

Any file with no program steps (except GTO 000) is regarded as data file.
To save the current register values (R00..R99) in a data file:






Loading a data file





Editing a data file

To change the title, description and/or any registers of a data file:






      Managing programs on RPN-25 CE
       
      Use the mode switch to select PRGM mode.
Tap the display to open the program listing.
Note that the current step is highlighted:
     
       
      Steps may be deleted by swiping left across the line:
     
       
      Tap Save to copy the changed program to the calculator.
To exit without changing the program, tap Cancel.

If you select a line before exiting, the line will be shown on the calculator display.
     

       
      Exporting a program
     
A program may be saved for later use or archiving purposes.







     
     
       
     
Importing a program
     
To import a program and its calculator settings from the Documents folder:








       
     
Deleting the current program
     
A. To delete the currently stored program and all metadata:




B. To delete the currently stored program, but keep title and description:

       
     
Deleting an exported program
     

       
     
Printing and PDF creation
     


       
     
Sample Programs
     
Some sample programs have been grouped according to their source. Their identifiers are as follows:

29MA – HP-19C/HP-29C SOLUTIONS - MATHEMATICS
29SE – HP-19C/HP-29C SOLUTIONS - STUDENT ENG.
29SE – HP-19C/HP-29C SOLUTIONS - STUDENT ENG.
41      – HP-41 Programs found here
VxNy – 65 NOTES Volume x Number y
HC    – Peter Henrici, "Computational Analysis with the HP-25"

 

 


Copyright © 2022. All rights reserved.