Advanced Techniques for RPN-67 and RPN-97
Breakpoints On the original calculators, forcing program execution to stop at a certain step – often referred to as "setting a breakpoint" – required inserting an R/S instruction at that step. This was cumbersome, as it not only changed the step numbers in the program, but you also had to remember the locations of the breakpoints in order to remove them later. RPN-67/97 solves this by attaching breakpoint information to steps without modifying the user's program in any way. A number of breakpoint commands are available. Up to 10 breakpoints may be simultaneously defined. Optionally, a counter may be specified for each breakpoint, causing it to fire only when the breakpoint step has been encountered a certain number of times (up to 999). Enabling the breakpoints feature Displaying breakpoint commands
3) To delete all breakpoints:
Enabling and disabling breakpointss
Displaying and printing breakpoints
Finding breakpoints
Restoring all breakpoints
Auto-deletion of breakpoints
Inserting and deleting program steps |
Using Breakpoints Make sure that "Use Breakpoints 0..9" is set to ON in Settings. Enter the (rather useless) program shown below. *LBL A:
001: 21 11 LBL A
002: 00 0
003: 35 46 STO I
004: 23 12 GSB B [007]
005: 36 46 RCL I
006: 24 RTN
*LBL B:
007: 21 12 LBL B
008: 16 26 46 ISZ I
009: 36 46 RCL I
010: -23 EEX
011: 02 2
012: 16-34 x>y?
013: 22 12 GTO B [007]
014: 24 RTN
(Note that in PRGM mode, you can paste the following listing right into the calculator's display.)
LBL A
0
STO I
GSB B
RCL I
RTN
LBL B
ISZ I
RCL I
EEX
2
x>y?
GTO B
RTN
The program clears register I, then – after calling subroutine B – displays the value of register I. Make sure registers are displayed (tap the View button or the area above the display.) Display 3 decimal digits: If necessary, clear any breakpoints: Tap A to run the program → 100.000 Attach breakpoint 1 to step 5: Attach counting breakpoint 2 to step 10. Examine the breakpoints: BP 1: 005/001 ( 1)
BP 2: 010/055 ( 55)
Breakpoint 1 has the default count of 1 attached. It will fire when step 5 is reached, and then re-arm automatically. Tap A to run the program → 55.000 Tap R/S to continue → 56.000 Examine the breakpoints: BP 1: 005/001 ( 1)
BP 2: 010/055 ( 1)
Both breakpoints behave in the same way right now. Let's disable BP 2, so the program may finish the loop and continue. Tap R/S to continue → 100.000 Examine the breakpoints: BP 1: 005/001 ( 1)
BP 2: 010/055 (off)
Restart the program by tapping A → 100.000 Examine the breakpoints: BP 1: 005/001 ( 1)
BP 2: 010/055 ( 1)
Note that breakpoint 2 still counts to one. RTN BP 1: 005/001 ( 1)
BP 2: 010/055 ( 55)
Breakpoint 2 will again count 55 occurrences before firing. To temporarily disable all breakpoints, go to any step that does not have a breakpoint attached to it. BP 1: 005/001 (off)
BP 2: 010/055 (off)
|
Source Code Editing
You are not restricted to punching keys to enter programs into RPN-67 and RPN-97. Apart from loading cards presented on this website,
you may also paste program listings into the emulators, either in the program listing (in RUN mode) or in the display
(in PRGM mode). You may also type in programs directly in the program listing field. Program listings may contain keycodes, but they don't have to. If keycodes are present, they will be used – just make sure to set the switch "Convert from HP-xx" as appropriate. (Conversion can't be specified if you paste your listing into the calculator's display.) If keycodes are not provided, the emulators will look for command symbols (mnemonics), like LBL A or DSP 9. You may use the HP-67/97 paper tape symbols defined by Hewlett-Packard (see link below), but you are not required to strictly follow the syntax. For example, arc sine may be entered as SIN⁻¹, SIN-1, SIN1, ASIN, g SIN (on HP-67), or f SIN (on HP-97), in either upper or lower or mixed case. Note that only commands and operations available on the original calculators are supported. The only exception is LBL, GTO and GSB with extended targets. E.g. "gto 67" will be accepted. HP-67/97 Symbols and Keycodes Example This input: lbl A
I
20
-
x=0
1x
r down
xy
stoi
isz I
x<>y
sto (i)
iszI
sf 1
lbl 1
rc I
2
/
rtn
will be instantly converted into this: (HP-97 keycodes shown)
*LBL A:
001: 21 11 LBL A
002: 36 46 RCL I
003: 02 2
004: 00 0
005: -45 -
006: 16-43 x=0?
007: 52 1/x
008: -31 R↓
009: -41 x≷y
010: 35 45 STO (i)
011: 16 26 46 ISZ I
012: -41 x≷y
013: 35 45 STO (i)
014: 16 26 46 ISZ I
015: 16 21 01 STF 1
LBL 1:
016: 21 01 LBL 1
017: 36 46 RCL I
018: 02 2
019: -24 ÷
020: 24 RTN
• In PRGM mode, go to the step where you want to insert the new code, then tap and hold the display and paste.• In RUN mode, open the card manager, tap and hold the spot in the listing where you want to insert the code, then paste. • In the listing, edit any line by typing in the desired symbol. Make sure to also delete the current keycode, as keycodes take precedence over symbols. |
|||
XML Format of RPN-67 Cards
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"…">
<plist version="1.0">
<dict>
<key>calcModel</key>
<string>67</string> -- Calculator model
<key>cardCategory</key>
<integer>50</integer> -- Category number
<key>cardCreated</key>
<date>2017-03-17T14:04:37Z</date>
<key>cardData</key> -- Program steps
<array>
<string>513</string> -- Settings
<string>31 25 11</string> -- Key codes
<string>31 81</string>
<string>22 01</string>
<string>42</string>
<string>_+2.54</string> -- Floating point step
<string>71</string>
</array>
<key>cardDescription</key> -- Description field
<string>Body-Mass-Index calulation</string>
<key>cardLabels</key> -- Card labels
<array>
<string>lb</string> -- A
<string>ft.in</string> -- B
<string></string> -- C
<string>BMI old</string> -- D
<string>BMI 2013</string> -- E
<string>kg</string> -- a
<string>m.cm</string> -- b
<string></string> -- c
<string></string> -- d
<string></string> -- e
</array>
<key>cardModified</key>
<date>2017-03-17T14:07:37Z</date>
<key>cardPac</key> -- HP Pac ID (0=none)
<integer>0</integer>
<key>cardTitle</key> -- Card title
<string>BMI Calculator</string>
<key>cardType</key> -- Card type
<integer>1</integer> -- 1=Prog, 2=Data
<key>cardUsage</key> -- Instructions
<string>Enter weight and height in
desired units.
Press D or E to calculate.</string>
</dict>
</plist>
Note:To format the Instructions field as desired, keep line length to 29 characters or less. |
Extended Single-stepping (RPN-97 only)
Unlike the original calculators, both RPN-67 and RPN-97 allow you to single-step into a subroutine. In many cases, however,
you're not interested in the entire subroutine, even less so in the subroutines called by it. Extended single-stepping solves this problem by allowing to continue execution at full speed until the RTN statement of the current subroutine is reached. Executing extended single-stepping Single-stepping into subroutine 1, then executing EXT SST at the location shown above, will run the program until the step marked "Stop" is reached. |
|||
Data Cards
Data cards store register contents which may be retrieved by simply reading the card. This is very useful for presetting registers with constants without wasting program steps. To write a data card:
RPN-67 and 97 Pro also import data cards created by RPN-65 (see right). W/DATA is programmable. If the running program encounters this command, it will stop and show the message "Crd". You can then proceed as shown above. After returning from the card manager, the program will continue automatically. You can also dismiss the "Crd" prompt by tapping any key. Then tap R/S to continue program execution. |
||||||||||||||||||||||||
|
Program Cards with Registers
Tips: By storing the stack in registers R.00..R04 (using STO ENTER), you can easily restore the stack on loading the program. Just execute RCL ENTER, possibly as an auto-executing subroutine (see "Auto-executing label 99" in section "Extensions".) To save program changes, don't turn "With Regs" on, unless you want to update the register data. Registers stored on a card are not affected by resaving the program. |
|
Using Touch ID / Face ID
From now on, whenever registers are about to be stored or retrieved from the associated program card, you'll be prompted to identify yourself. If authorization fails, registers will be simply ignored. Fallback to a passcode is not supported.
Note: On the iPhone, activating "With Regs", then double-tapping the ID-protected card in the card list will take you back to the card details. Use "Load" to load card. |