External stack

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: http://www.swissmicros.com/dm42/decoder/

You can then copy/paste the listing and post it in "code" tags.
Thomas Okken
Posts: 674
Joined: Tue May 02, 2017 3:48 pm
Contact:

Re: External stack

Post by Thomas Okken » Sun Apr 07, 2019 11:05 pm

Thanks everyone for testing!

I did a bit more polishing, couldn't find any more bugs. I think it's ready. I removed the test builds from my site and I'm releasing the official version 2.2.

rprosperi
Posts: 701
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: External stack

Post by rprosperi » Sun Apr 07, 2019 11:27 pm

Thomas Okken wrote:
Sun Apr 07, 2019 11:05 pm
I removed the test builds from my site and I'm releasing the official version 2.2.
@Thomas - On Android, will 2.2 safely consume and update an existing state file?

@David - when 2.2 is integrated into some future build of DM42, same question?

Thanks
--bob p

DM42: β00071 & 00282, DM41X: β00071, DM10L: 071/100

Thomas Okken
Posts: 674
Joined: Tue May 02, 2017 3:48 pm
Contact:

Re: External stack

Post by Thomas Okken » Sun Apr 07, 2019 11:57 pm

rprosperi wrote:
Sun Apr 07, 2019 11:27 pm
On Android, will 2.2 safely consume and update an existing state file?
Yes.

rprosperi
Posts: 701
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: External stack

Post by rprosperi » Mon Apr 08, 2019 12:04 am

Thomas Okken wrote:
Sun Apr 07, 2019 11:57 pm
rprosperi wrote:
Sun Apr 07, 2019 11:27 pm
On Android, will 2.2 safely consume and update an existing state file?
Yes.
Indeed it does, it has already updated. That was fast!

Thx
--bob p

DM42: β00071 & 00282, DM41X: β00071, DM10L: 071/100

hsilop
Posts: 33
Joined: Thu Mar 14, 2019 12:35 am
Location: Canberra, Australia

Re: External stack

Post by hsilop » Mon Apr 08, 2019 4:47 am

Thomas Okken wrote:
Sat Apr 06, 2019 1:12 am

...

You could use that mechanism to create parameters. For example, a function that takes a parameter X and uses a local A could look like this:

...
Similarly, the caller could create a local variable in which the function stores a return value. The LSTO mechanism is pretty flexible -- or at least it will be once I get it to work, hopefully this weekend. It'll be interesting to see how people end up using it.
Totally awesome! I always try to build programs that "play nice" with each other. This would certainly help.
DM42 SN: 03223

HP11C, HP12C, HP15C, HP16C, HP25, HP32S, HP33C, HP41CV, HP46, HP65

grsbanks
Posts: 882
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: External stack

Post by grsbanks » Mon Apr 08, 2019 7:33 am

rprosperi wrote:
Sun Apr 07, 2019 8:57 pm
@Godwin - The DM42 Encoder/Decoder will need to be updated to allow processing of the new LSTO command. Is the proper byte code needed from Thomas, or how the heck do you know what to use?
Indeed, I need to set some time aside for this!
Not SwissMicros staff, just an enthusiast.

User avatar
Walter
Posts: 1342
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: External stack

Post by Walter » Mon Apr 08, 2019 12:36 pm

Ok, the WP 34S got local registers in 2011, Free42 got local variables now. Beyond the difference between registers and variables, is there anything else? Just for curiosity...
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

Thomas Okken
Posts: 674
Joined: Tue May 02, 2017 3:48 pm
Contact:

Re: External stack

Post by Thomas Okken » Mon Apr 08, 2019 3:00 pm

Walter wrote:
Mon Apr 08, 2019 12:36 pm
Ok, the WP 34S got local registers in 2011, Free42 got local variables now. Beyond the difference between registers and variables, is there anything else? Just for curiosity...
Well, Free42 is basically an HP-42S, with more memory, more speed, and higher precision, several extensions, and now, local variables and a bigger RTN stack. (LSTO isn't documented yet in the extensions page, I'll probably write that documentation next weekend.) I don't know enough about the WP34S to do a feature-by-feature comparison.

dlachieze
Posts: 181
Joined: Thu May 04, 2017 10:20 am
Location: France

Re: External stack

Post by dlachieze » Mon Apr 08, 2019 4:45 pm

Walter wrote:
Mon Apr 08, 2019 12:36 pm
Ok, the WP 34S got local registers in 2011, Free42 got local variables now. Beyond the difference between registers and variables, is there anything else? Just for curiosity...
AFAICS:
  • On the plus side for the WP-34S: LocR is allocating local registers AND 16 local flags. There is so far no local flags on Free42.
  • On the plus side for Free42: if you define a local variable in one program, it is available to any subroutine called by this program, even if they define their own local variables. However on the WP-34S, if a subroutine allocates it's own local registers, it will not be able anymore to access the caller's local registers.
DM42: 00425 - DM41X: β00066

mcc
Posts: 213
Joined: Fri Jun 23, 2017 3:10 am

Re: External stack

Post by mcc » Sun Apr 14, 2019 1:26 pm

Hi,

sorry for being a little late to the show... :)

From one of the previous posts of this thread I learned, that the new Free42
has LSTO beside other wonderful magic.
This would not only improve subroutine handling it will also help to unclutter
the amount of variables left over, when a program has ended its work.

In this context I would like to suggest a "LMVAR" command, wich works similiar
to the LSTO-command and would create variables which evaporize into thin
air, when the program has ended.

Would this be possible?

@Thomas: Thank you for adding such nice features like LSTO to Free42!!! :)

Cheers!
mcc
DM 42 - SN: 00373, Firmware v.:3.18. / 3.18. RC2 as compiled by SwissMicros

Post Reply