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: https://technical.swissmicros.com/decoders/dm42/

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

Re: External stack

Post by Thomas Okken »

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: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: External stack

Post by rprosperi »

Thomas Okken wrote:
Mon Apr 08, 2019 1:05 am
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 & 00656, DM10L: 071/100
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: External stack

Post by Thomas Okken »

rprosperi wrote:
Mon Apr 08, 2019 1:27 am
On Android, will 2.2 safely consume and update an existing state file?
Yes.
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: External stack

Post by rprosperi »

Thomas Okken wrote:
Mon Apr 08, 2019 1:57 am
rprosperi wrote:
Mon Apr 08, 2019 1:27 am
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 & 00656, DM10L: 071/100
hsilop
Posts: 70
Joined: Thu Mar 14, 2019 1:35 am
Location: Canberra, Australia

Re: External stack

Post by hsilop »

Thomas Okken wrote:
Sat Apr 06, 2019 3: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.
Steve

DM32 SN: 00316
DM41X SN: 00854
DM42 SN: 03223


HP11C, HP12C, HP15C, HP16C, HP25, HP32S, HP33C, HP41CV, HP46, HP65
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: External stack

Post by grsbanks »

rprosperi wrote:
Sun Apr 07, 2019 10: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!
There are only 10 kinds of people in the world: those who understand binary and those who do not.
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: External stack

Post by Walter »

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...
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: External stack

Post by Thomas Okken »

Walter wrote:
Mon Apr 08, 2019 2: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: 613
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: External stack

Post by dlachieze »

Walter wrote:
Mon Apr 08, 2019 2: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 - WP43: 00042
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Re: External stack

Post by mcc »

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 release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
Post Reply