Post Reply 
(50g) Mirror the stack
03-19-2016, 02:23 PM (This post was last modified: 03-19-2016 02:24 PM by Vtile.)
Post: #1
(50g) Mirror the stack
Hello, late yesterday (or yearly today) I were toying with the 50g before going to sleep, well I entered long series of the number to the stack just to notice I entered them in reverse order. Then I tried to find a "stack mirror" function or script, without success so I created this UserRPL software to do it. I'm sure there is more sophisticated method of doing it, but here is one solution.

Provided as is, in the hope it is usefull. Public domain.

Code:

<< DEPTH Y → X Y 
<< 2 'Y' STO
2 X START
Y PICK
2 Y + 'Y' STO
NEXT
X →LIST
X ROLLD
X 1 - DROPN
OBJ→ DROP
>>
>>

- Vtile
Find all posts by this user
Quote this message in a reply
03-19-2016, 02:50 PM (This post was last modified: 03-19-2016 05:48 PM by Gerald H.)
Post: #2
RE: (50g) Mirror the stack
An efficient way on the 50g:

Enter number of elements you want to mirror & execute:

Code:

::
CKN
reversym
UNCOERCE
;

Edited following rprosperi, posting #7.
Find all posts by this user
Quote this message in a reply
03-19-2016, 03:01 PM
Post: #3
RE: (50g) Mirror the stack
What are these commands I can not find them from AUR?
Find all posts by this user
Quote this message in a reply
03-19-2016, 04:38 PM (This post was last modified: 03-19-2016 04:40 PM by Tugdual.)
Post: #4
RE: (50g) Mirror the stack
The Hp 50g supports two command sets: user RPL and system RPL.
The second has more commands and less checks making it faster than the first but also more prone to errors and possibly hard locks.
The second is also not documented in the user guide so you'll have the surf the wild wild web to get info.
You can do a lot already with user RPL, so wisely choose how you want to use your free time...
Find all posts by this user
Quote this message in a reply
03-19-2016, 04:54 PM (This post was last modified: 03-19-2016 05:08 PM by Vtile.)
Post: #5
RE: (50g) Mirror the stack
(03-19-2016 04:38 PM)Tugdual Wrote:  The Hp 50g supports two command sets: user RPL and system RPL.
The second has more commands and less checks making it faster than the first but also more prone to errors and possibly hard locks.
The second is also not documented in the user guide so you'll have the surf the wild wild web to get info.
You can do a lot already with user RPL, so wisely choose how you want to use your free time...
That what I was suspecting, but I were on the (wrong) impression that AUR constains also SysRPL commands. I think I stay away from it. Smile UserRPL mirror does mirror 1000 stack entries in about 6½ seconds and 2000 entries before I can get new cup of coffee, so there is no need for me for more speed. Edit.. It seems calculator starts to "fail" above 1k high stack, not bad.

Anyway thx, Gerald H. for sysRPL version.
Find all posts by this user
Quote this message in a reply
03-19-2016, 05:08 PM
Post: #6
RE: (50g) Mirror the stack
You might also consider entering the values in the right order.
This is even faster than swapping the stack...
Find all posts by this user
Quote this message in a reply
03-19-2016, 05:23 PM
Post: #7
RE: (50g) Mirror the stack
(03-19-2016 02:50 PM)Gerald H Wrote:  An efficient way on the 50g:

Enter number of elements you want to mirror & execute:

Code:

::
CKN
reversym
UNCOERCE
::

A minor nit, but the closing "::" should be simply ";"
But a really good example of the power and elegance of SysRPL, thanks Gerald.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-19-2016, 05:53 PM
Post: #8
RE: (50g) Mirror the stack
(03-19-2016 05:08 PM)Tugdual Wrote:  You might also consider entering the values in the right order.
This is even faster than swapping the stack...
Naturally, the 50g is missing this kind of command though. "Pick a block" would be even better command for scratch book use (half braindead mode Big Grin), maybe I should propose it for the newRPL crew.
Find all posts by this user
Quote this message in a reply
03-19-2016, 06:13 PM
Post: #9
RE: (50g) Mirror the stack
(03-19-2016 04:54 PM)Vtile Wrote:  
(03-19-2016 04:38 PM)Tugdual Wrote:  The Hp 50g supports two command sets: user RPL and system RPL.
The second has more commands and less checks making it faster than the first but also more prone to errors and possibly hard locks.
The second is also not documented in the user guide so you'll have the surf the wild wild web to get info.
You can do a lot already with user RPL, so wisely choose how you want to use your free time...
That what I was suspecting, but I were on the (wrong) impression that AUR constains also SysRPL commands. I think I stay away from it. Smile UserRPL mirror does mirror 1000 stack entries in about 6½ seconds and 2000 entries before I can get new cup of coffee, so there is no need for me for more speed. Edit.. It seems calculator starts to "fail" above 1k high stack, not bad.

Anyway thx, Gerald H. for sysRPL version.
On your free time you might check this page: http://www.hpcalc.org/details.php?id=5142
This is a pretty good introduction to sysRPL.
Find all posts by this user
Quote this message in a reply
03-19-2016, 06:32 PM (This post was last modified: 03-19-2016 06:34 PM by Claudio L..)
Post: #10
RE: (50g) Mirror the stack
(03-19-2016 05:53 PM)Vtile Wrote:  
(03-19-2016 05:08 PM)Tugdual Wrote:  You might also consider entering the values in the right order.
This is even faster than swapping the stack...
Naturally, the 50g is missing this kind of command though. "Pick a block" would be even better command for scratch book use (half braindead mode Big Grin), maybe I should propose it for the newRPL crew.

How about this way?
Code:

<< DEPTH →LIST REVLIST OBJ→ DROP >>
Find all posts by this user
Quote this message in a reply
03-19-2016, 06:38 PM (This post was last modified: 03-19-2016 06:42 PM by Vtile.)
Post: #11
RE: (50g) Mirror the stack
Big Grin too simple. I see it were the REVlist that I were searching.. Half an hour weren't enough to come up with that from AUR.

Rev .. Reverse naturally, dang.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)