A couple additional functions that would be cool to have

Discussion around the Swiss Micros DM42 calculator.
Dave Britten
Posts: 22
Joined: Wed Jun 14, 2017 7:27 pm

A couple additional functions that would be cool to have

Post by Dave Britten » Mon Dec 18, 2017 9:04 pm

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.

pauli
Posts: 41
Joined: Tue May 02, 2017 8:11 am
Location: Australia

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

Post by pauli » Tue Dec 19, 2017 7:38 am

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: 22
Joined: Wed Jun 14, 2017 7:27 pm

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

Post by Dave Britten » Tue Dec 19, 2017 12:24 pm

pauli wrote:
Tue Dec 19, 2017 7: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: 628
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

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

Post by grsbanks » Tue Dec 19, 2017 1:04 pm

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!
Not SwissMicros staff, just an enthusiast.

Dave Britten
Posts: 22
Joined: Wed Jun 14, 2017 7:27 pm

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

Post by Dave Britten » Tue Dec 19, 2017 1:25 pm

grsbanks wrote:
Tue Dec 19, 2017 1: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: 180
Joined: Tue May 02, 2017 11:56 am

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

Post by akaTB » Tue Dec 19, 2017 3:18 pm

Dave Britten wrote:
Tue Dec 19, 2017 1:25 pm
grsbanks wrote:
Tue Dec 19, 2017 1: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

-+×÷ ↔ left is right and right is wrong

Dave Britten
Posts: 22
Joined: Wed Jun 14, 2017 7:27 pm

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

Post by Dave Britten » Tue Dec 19, 2017 7:06 pm

akaTB wrote:
Tue Dec 19, 2017 3:18 pm
Dave Britten wrote:
Tue Dec 19, 2017 1:25 pm
grsbanks wrote:
Tue Dec 19, 2017 1: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: 17
Joined: Sat Jul 22, 2017 7:14 pm

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

Post by Bill (Smithville NJ) » Tue Dec 19, 2017 9:54 pm

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: 19
Joined: Thu Dec 21, 2017 12:23 pm

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

Post by whuyse » Thu Dec 21, 2017 12:53 pm

grsbanks wrote:
Tue Dec 19, 2017 1: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
42S #3249S01123
DM42 #00345

Dave Britten
Posts: 22
Joined: Wed Jun 14, 2017 7:27 pm

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

Post by Dave Britten » Thu Dec 21, 2017 1:23 pm

whuyse wrote:
Thu Dec 21, 2017 12:53 pm
grsbanks wrote:
Tue Dec 19, 2017 1: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