INPUT stack lift: 32S vs. 42S
|
10-11-2019, 01:49 PM
Post: #1
|
|||
|
|||
INPUT stack lift: 32S vs. 42S
I spent some time last night adapting the triangle solver from the 32S Engineering Applications book to my 42S, and after about an hour of trying to figure out why I was getting incorrect results, I discovered that INPUT behaves differently on the two models.
On the 32S, INPUT first recalls the variable to X, obeying the current stack lift mode. Then it disables stack lift, so the user's entry overwrites whatever was recalled to X. When entry is complete and the program continues, INPUT enables stack lift. On the 42S, it's a bit different. INPUT recalls the variable to X, while obeying the current stack lift mode as the 32S does. But then it enables stack lift, so if the user enters a value, the old value of the variable gets pushed to Y. When INPUT is complete, it enables stack lift, as on the 32S. Is there a clean, clever way to reconcile this difference? I'm not sure what the rationale is behind having the 42S enable stack lift so the old value gets preserved in Y (aside, perhaps, from 41C compatibility). Ideally I'd want it to behave like the 32S, where the old value in X is overwritten by the new entry. The best I could think up was something gross like checking flag 30, saving Z and/or T, calling INPUT, checking flag 22, and restoring Z/T. Is it better to just analyze the intent of the surrounding program code and modify it to accommodate the difference? This is the code in question: Code: LBL E On the 32S, the steps after INPUT D will calculate C*sin(D)/A regardless of whether a new value is entered into D. On the 42S, they end up calculating D*sin(D)/A if a new value is entered (and the RCL A certainly doesn't stay where the program subsequently expects it to be either). |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
INPUT stack lift: 32S vs. 42S - Dave Britten - 10-11-2019 01:49 PM
RE: INPUT stack lift: 32S vs. 42S - rprosperi - 10-11-2019, 02:01 PM
RE: INPUT stack lift: 32S vs. 42S - Thomas Okken - 10-19-2019, 09:39 PM
RE: INPUT stack lift: 32S vs. 42S - Dave Britten - 10-19-2019, 09:47 PM
RE: INPUT stack lift: 32S vs. 42S - rprosperi - 10-20-2019, 01:46 AM
RE: INPUT stack lift: 32S vs. 42S - Thomas Okken - 10-20-2019, 03:27 AM
RE: INPUT stack lift: 32S vs. 42S - ijabbott - 10-11-2019, 04:20 PM
RE: INPUT stack lift: 32S vs. 42S - Dave Britten - 10-11-2019, 04:35 PM
RE: INPUT stack lift: 32S vs. 42S - Valentin Albillo - 10-11-2019, 05:12 PM
RE: INPUT stack lift: 32S vs. 42S - Dave Britten - 10-15-2019, 07:35 PM
|
User(s) browsing this thread: 7 Guest(s)