A couple additional functions that would be cool to have

Discussion around the SwissMicros DM42 calculator
Dave Britten
Posts: 137
Joined: Wed Jun 14, 2017 9:27 pm

A couple additional functions that would be cool to have

Post by Dave Britten »

Just throwing out some ideas for some functions that would make really slick additions to Free42:

RTN+1 - Return to one instruction after where RTN would normally go, i.e. return and skip the next instruction. This allows creating custom conditional functions. I think the WP-34S has this.

PUSHST and POPST - Push Stack and Pop Stack. This would require reserving space in memory for extra copies of the stack according to how many levels this would support, but would eliminate the need to do things like implement stack saving and restoring in programs. Begin a program with PUSHST, do your work, POPST, STO ST L if appropriate, and RCL your result(s) to the stack.
User avatar
pauli
Posts: 252
Joined: Tue May 02, 2017 10:11 am
Location: Australia

Re: A couple additional functions that would be cool to have

Post by pauli »

Yes, the 34S has RTN+1.

Wouldn't saving and restoring the stack to/from a register (as an array) be as useful?


Pauli
Dave Britten
Posts: 137
Joined: Wed Jun 14, 2017 9:27 pm

Re: A couple additional functions that would be cool to have

Post by Dave Britten »

pauli wrote:
Tue Dec 19, 2017 8:38 am
Wouldn't saving and restoring the stack to/from a register (as an array) be as useful?
Yes, but it would be cumbersome if you wanted to support any sort of recursion.
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: A couple additional functions that would be cool to have

Post by grsbanks »

Sorry to disappoint everyone but DM42-related patches to Free42 are being kept to a strict minimum, basically limited to what's needed to drive the hardware.

Now, if someone wants to contribute a PUSHST/POPST pair in RPN and post it in the Software Library it can form the start of a bunch of utilities that everyone can benefit from!
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Dave Britten
Posts: 137
Joined: Wed Jun 14, 2017 9:27 pm

Re: A couple additional functions that would be cool to have

Post by Dave Britten »

grsbanks wrote:
Tue Dec 19, 2017 2:04 pm
Now, if someone wants to contribute a PUSHST/POPST pair in RPN and post it in the Software Library it can form the start of a bunch of utilities that everyone can benefit from!
I'll bet it could be done in RPN fairly cleanly, though I haven't personally worked with matrices enough on the 42 (yet) to bang it out myself.
User avatar
akaTB
Posts: 794
Joined: Tue May 02, 2017 1:56 pm
Location: Milan, Italy

Re: A couple additional functions that would be cool to have

Post by akaTB »

Dave Britten wrote:
Tue Dec 19, 2017 2:25 pm
grsbanks wrote:
Tue Dec 19, 2017 2:04 pm
Now, if someone wants to contribute a PUSHST/POPST pair in RPN and post it in the Software Library it can form the start of a bunch of utilities that everyone can benefit from!
I'll bet it could be done in RPN fairly cleanly, though I haven't personally worked with matrices enough on the 42 (yet) to bang it out myself.
Seems like you already resolved this... :lol:
http://www.hpmuseum.org/cgi-sys/cgiwrap ... ead=159644
Greetings,
    Massimo
ajcaton
-+×÷ left is right and right is wrong :twisted: Casted in gold
Dave Britten
Posts: 137
Joined: Wed Jun 14, 2017 9:27 pm

Re: A couple additional functions that would be cool to have

Post by Dave Britten »

akaTB wrote:
Tue Dec 19, 2017 4:18 pm
Dave Britten wrote:
Tue Dec 19, 2017 2:25 pm
grsbanks wrote:
Tue Dec 19, 2017 2:04 pm
Now, if someone wants to contribute a PUSHST/POPST pair in RPN and post it in the Software Library it can form the start of a bunch of utilities that everyone can benefit from!
I'll bet it could be done in RPN fairly cleanly, though I haven't personally worked with matrices enough on the 42 (yet) to bang it out myself.
Seems like you already resolved this... :lol:
http://www.hpmuseum.org/cgi-sys/cgiwrap ... ead=159644
He he, yup. I haven't loaded that on my DM42 yet, though. I wanted to see if there might be a more lightweight way of doing this with matrices, but that causes problems if you've got strings or other matrices on the stack. So I'll probably just stick with the old method.
Bill (Smithville NJ)
Posts: 34
Joined: Sat Jul 22, 2017 9:14 pm

Re: A couple additional functions that would be cool to have

Post by Bill (Smithville NJ) »

The ability to page up/down through the list
of Files in the "Load Program" menu would be a welcome addition.
It's pretty tedious to go up/down in the file list.

Maybe page up/down is already there - but I couldn't discover
the correct buttons to push to achieve it.

Could possibly use Shift Up or Shift Down, but even better would be the
extreme left and extreme right top line of buttons.

This would save a lot of up/down button pushing when selecting a file
to load.

Bill
Smithville, NJ
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: A couple additional functions that would be cool to have

Post by whuyse »

grsbanks wrote:
Tue Dec 19, 2017 2:04 pm
Now, if someone wants to contribute a PUSHST/POPST pair in RPN and post it in the Software Library it can form the start of a bunch of utilities that everyone can benefit from!
Done.
PUSH/POP stack

Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Dave Britten
Posts: 137
Joined: Wed Jun 14, 2017 9:27 pm

Re: A couple additional functions that would be cool to have

Post by Dave Britten »

whuyse wrote:
Thu Dec 21, 2017 1:53 pm
grsbanks wrote:
Tue Dec 19, 2017 2:04 pm
Now, if someone wants to contribute a PUSHST/POPST pair in RPN and post it in the Software Library it can form the start of a bunch of utilities that everyone can benefit from!
Done.
PUSH/POP stack

Cheers, Werner
Very nice! I'll have to try those out later. It looks much shorter than I was expecting it to be.
Post Reply