Programming the RPN-38


A program is nothing more than 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 dis- played 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-38 calculator programming.

To get you started, try entering and executing the simple program shown on the Info screen of RPN-38 CX (tap the info button in the lower-left corner).


Entering and running a program







Reviewing your program





Debugging your program






Editing your program







Adding or removing steps will automatically adjust all affected GTO commands.
For example, if you enter GTO 40 after step 10 to branch to line 40, what gets stored is GTO 41, since your 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.



Programming the mode switch

The mode switch (also called "payment switch") may be set under program control.
The required program step, "D.MY/BEGIN" or "M.DY/END" is entered like this:




Reading the mode switch

The current position of the mode switch may be read under program control.
The required program step, "M.DY/END?", is entered like this:


If true, i.e. the switch is in the right position, the following step is executed, otherwise it is skipped.


Indirect Addressing (STi, RCi)






Note that the indirection register I may be incremented, decremented and tested by the loop control instructions DSE and ISG.





Example program




Example: Find the percentage that each of the following numbers represent of the total sum of the numbers: $54, $14, $83, $144, and $38.

Keys: Display: Description:
     
0 R/S 0.00 Initialize CF0 with zero.
54 R/S 54.00 Key in first number.
14 R/S 68.00 Sum of first two numbers.
83 R/S 151.00 Sum of first three numbers.
144 R/S 295.00 Sum of first four numbers.
38 R/S 333.00 Sum of all numbers entered.

Now tap 0 R/S to tell the calculator that you have finished keying in the numbers so that it can branch to the %T portion of the program. The calculator will pause about 2 seconds to display each of the following:

Keys: Display: Description:
     
0 R/S 38.00 Last number you keyed in.
  11.41 % of total.
  144.00 4th number you keyed in.
  43.24 % of total.
  83.00 3rd number you keyed in.
  24.92 % of total.
  14.00 2nd number you keyed in.
  4.20 % of total.
  54.00 First number you keyed in.
  16.22 % of total.

To recall the total again, simply tap x≷y.





Using GTOs and GSBs correctly

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

For details, click here.
      Managing programs on RPN-38 CX
       
      Use P/R to select program 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.
     

       
      Exporting a program
     
A program may be saved for archiving purposes.






     
     
       
     
Importing a program
     
To import a program from the Documents folder:







Note:
An empty program saved with registers will only replace the registers, leaving the program memory untouched.
This feature may be used to create pure data files.
       
     
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
     


 

 


Copyright © 2020. All rights reserved.