(71B) Basic RPN Program
|
08-30-2016, 03:46 AM
Post: #1
|
|||
|
|||
(71B) Basic RPN Program
The program RPNBASIC puts the HP 71B into RPN mode with arithmetic functions, power, square root, and π. The program contains room for one independent memory and a four level stack that works like the classic Hewlett Packard RPN calculators.
I have the array S set up for six slots: Slot 1: X stack (display) Slot 2: Y stack Slot 3: Z stack Slot 4: T stack Slot 5: Independent memory stack Slot 6: (temporary memory) For an idea of how RPN works, check out this tutorial: http://edspi31415.blogspot.com/2011/09/rpn-basics.html As a note, this program requires you to press the equals key [ = ] before you enter a number to the stack. Example: 2 + 3 + 9 = 14 Keys: [ = ], 2, [END LINE] [ = ], 3, [END LINE], [ + ], [ = ], 9, [END LINE], [ + ] The keys available during RPNBASIC: [ = ] Input [ + ] Add: Y + X [ - ] Subtract: Y - X [ * ] Multiplication: Y * X [ / ] Divide: Y/X [ g ] [ / ] (^) Exponent: Y^X [ Q ] Square Root √X [ P ] Enter π to the stack [ M ] Store X in independent memory [ R ] Recall memory [ C ] Clear X stack to 0 Stack operations: [ S ] Swap with X and Y [ D ] Roll stack down, result { Y, T, Z, X } Exit the program: press [ E ] HP 71B Program: RPNBASIC (828 bytes) Code: 5 ! SIMPLE RPN, EWS 8/29/2016 |
|||
05-12-2024, 09:34 PM
Post: #2
|
|||
|
|||
RE: (71B) Basic RPN Program (see second post)
This is a repost of a basic program for the HP 71B. I received an email from Kenneth who pointed out that line 145 lead to an error. In further testing, this lead to the input routine not working correctly. The following code in today’s repost is a corrected algorithm. Edited lines are 5, 125, and 145.
The program RPNBASIC puts the HP 71B into RPN mode with arithmetic functions, power, square root, and π. The program contains room for one independent memory and a four level stack that works like the classic Hewlett Packard RPN calculators. I have the array S set up for six slots: Slot 1: X stack (display) Slot 2: Y stack Slot 3: Z stack Slot 4: T stack Slot 5: Independent memory stack Slot 6: (temporary memory) The keys available during RPNBASIC: [ = ] Input [ + ] Add: Y + X [ - ] Subtract: Y - X [ * ] Multiplication: Y * X [ / ] Divide: Y/X [ g ] [ / ] (^) Exponent: Y^X [ Q ] Square Root √X [ P ] Enter π to the stack [ M ] Store X in independent memory [ R ] Recall memory [ C ] Clear X stack to 0 Stack operations: [ S ] Swap with X and Y [ D ] Roll stack down, result { Y, T, Z, X } Exit the program: press [ E ] Code: 5 ! SIMPLE RPN, EWS 5/12/2024 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)