Free42 with big stack, test version
|
02-07-2021, 01:35 PM
Post: #61
|
|||
|
|||
RE: Free42 with big stack, test version
Despite the new Allow Big Stack setting, I'm still considering other options for peaceful coexistence of 4STK and NSTK. They will just be provided in addition to the current functionality, not instead of.
Disabling the big stack completely by default makes sense because HP-42S compatibility is a central aspect of Free42, and that is something which many users require. So that will stay in place regardless of whatever else I come up with. But for people who are interested in using both modes, an additional "allow big stack, but automatically switch to four-level stack if..." mode would probably be useful. Details to be worked out. What should the "if" condition be? A program not tagged with BIGSTK in line 01, or a program containing LBL instructions instead of NLBL, or something else? And if the automatic switch takes place, should it be permanent or temporary, 4STK or L4STK? I suppose there may not be one single best answer to this, it will depend on how one intends to use this feature, the specifics of each user's workflow. I'll hold off on implementing anything further until I have a better idea of what would actually work well in practice. |
|||
02-07-2021, 05:20 PM
Post: #62
|
|||
|
|||
RE: Free42 with big stack, test version
Like I said before, I think the NLBL/LBL/RTN/END is the safest way to distinguish between two programs and their stack mode usage.
This is what I would do if I was doing it:
|
|||
02-07-2021, 10:34 PM
Post: #63
|
|||
|
|||
RE: Free42 with big stack, test version
That seems pretty similar to the behavior of LNSTK and L4STK, except the implementation is totally different. I'm only using one stack and extending or truncating it as needed. L4STK saves levels 5..N to a hidden local variable, and when used in conjunction with FUNC, it also saves the levels that will end up in the four-level stack but are not used as input parameters. So if you have a function with FUNC 21, i.e. two inputs and one output, L4STK will save levels 3..N.
The question of when to do the automatic switch is a bit difficult. In terms of implementation, it seems like there's only one way to do it: when execution starts, perform L4STK or LNSTK, as needed, and if execution ends with a RTN while the RTN stack is empty, then the normal L4STK/LNSTK cleanup mechanism will do the right thing. But if a program ends with STOP, i.e. without returning from the top-level routine, then the automatic L4STK or LNSTK cleanup will not happen right away, because the calculator has no way of knowing whether the program is just stopped for input or really done. The L4STK or LNSTK cleanup could still be done when the user performs an action that clears the RTN stack, like GTO or XEQ, but that might come as a bit of a surprise when it finally happens. |
|||
02-08-2021, 03:21 PM
Post: #64
|
|||
|
|||
RE: Free42 with big stack, test version
(02-07-2021 10:34 PM)Thomas Okken Wrote: But if a program ends with STOP, i.e. without returning from the top-level routine, then the automatic L4STK or LNSTK cleanup will not happen right away, because the calculator has no way of knowing whether the program is just stopped for input or really done. The L4STK or LNSTK cleanup could still be done when the user performs an action that clears the RTN stack, like GTO or XEQ, but that might come as a bit of a surprise when it finally happens.You have a point here, I did not think about that scenario, this is rendering my way of doing it flawed and useless. I now see why keeping a single stack is a better solution. Thanks! |
|||
03-10-2021, 08:18 AM
Post: #65
|
|||
|
|||
RE: Free42 with big stack, test version
(01-30-2021 01:18 AM)Thomas Okken Wrote: I finished implementing the big stack logic in Free42. This isn't an official release; depending on the feedback I get, additions and changes to the instruction set are still possible. But I think this is useful enough as it is to share it around. Comments welcome! Hi Thomas. I found one minor improvement, at least to me. As the big stack does not "purge" automatically old objects, in real life use the stack may became very deep. In RPL models i use a lot the CLEAR function (on the 50g is Orange_Sht+bksp) to periodically purge the stack. In Free42 the CLST command is buried in CLEAR menu and need a lot of keystrokes to be reached. At present i mad a workaround by mean of custom menu. In would be nice to have CLST mapped somewhere in the keyboard. |
|||
03-10-2021, 09:45 AM
Post: #66
|
|||
|
|||
RE: Free42 with big stack, test version
(03-10-2021 08:18 AM)Marco Polo Wrote: I found one minor improvement, at least to me. A lot of keystrokes for CLST? [Shift] [←] [LOG], three keystrokes, I think that's not so bad, and I use it all the time. But I understand that not everybody feels that way. There are several skins in my collection that have CLST on the keyboard, take a look at the skins collection at my web site, there might be something there you like. |
|||
03-10-2021, 10:24 AM
Post: #67
|
|||
|
|||
RE: Free42 with big stack, test version
(03-10-2021 09:45 AM)Thomas Okken Wrote:(03-10-2021 08:18 AM)Marco Polo Wrote: I found one minor improvement, at least to me. For sone odd reason (age? lockdown?) i did not see CLST is in the first page of CLEAR menu. So i cycled with arrow.... Totally equivalent to custom key. Maybe i need some rest in a wood cottage far from work and family :-D |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 15 Guest(s)