HP Forums
[WP 34S]How to implement an INPUT function - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: [WP 34S]How to implement an INPUT function (/thread-33.html)

[WP 34S]How to implement an INPUT function - Didier Lachieze - 12-12-2013 12:47 AM

In the old forum under the thread HP35s Calculator Max Rope Tension Program, Thomas Klemm provided a very neat program for the HP 35S in 22 steps.

I was looking to port this to the WP 34S when I realized that on the 34S there is no equivalent of the 35S INPUT function, mostly I presume because the 34S doesn't have the same A-Z alphanumeric variables.

One of the advantages of the 35S INPUT function is that it allows the user to check the value of the variables already stored and to enter only the ones that are changing between two runs of the program.

So I tried to keep the same program user interface by implementing a mapping of the A to Z variables to the 34S global registers 00 to 26.

Here is the result:
  • "INP" is an INPUT equivalent program, expecting a letter from A to Z in the alpha register, prompting the user with a question mark and the current value of the variable and returning with the modified or unmodified value in the X level of the stack.
  • "A" is the Max Rope Tension program, calling "INP" 4 times for the 4 variables L, F, N & D. Then, access to these variables is done through registers 12 (L), 06 (F), 14 (N) and 04 (D). The program is based on the first formula (P = (1 + F)^(N + D - 1)*L*F/((1 + F)^N - 1)) rather than on the second one (P = (1 + F)^(D - 1)*L*F/(1 - (1 + F)^-N)) because the status of the stack after the variable INPUTs make it more efficient.

001 LBL A
002 CLα
003 αL
004 XEQ'INP'
005 αF
006 XEQ'INP'
007 αN
008 XEQ'INP'
009 αD
010 XEQ'INP'
011 +
012 DEC X
013 INC Y
014 y^x
015 *
016 RCL* 06
017 RCL 06
018 INC X
019 RCL 14
020 y^x
021 DEC X
022 /
023 RTN

024 LBL'INP'
025 LocR 001
026 α->x
027 x->α
028 STO.00
029 CLx
030 #064
031 STO-.00
032 DROP
033 α?
034 VWα+->.00
035 STOP
036 ENTRY?
037 SKIP 001
038 RCL->.00
039 STO->.00
040 CLα
041 RTN

RE: [WP 34S]How to implement an INPUT function - Didier Lachieze - 12-12-2013 08:08 AM

I understand that there is no more space available for new functions but it would be cool to be able on the WP 34S to access global registers via letters, for example: RCL αL recalling global register 012.

RE: [WP 34S]How to implement an INPUT function - Marcus von Cube - 12-13-2013 11:08 PM

RCL αA as a synonym for RCL 01 does not fit easily into our encoding scheme:
  • A single command has 16 bits.
  • 8 Bits are reserved for the argument in the argument taking commands.
  • The command defines whether indirection is supported or not.
  • Some commands such as α have special handling.
  • The memory commands allow indirection and local registers which limits the argument range from 0 to 127.
  • Local and stack registers are defined by their argument value (from 100 to 127).
  • There are many more commands then STO and RCL which deal with registers.
There is simply no space in this encoding scheme to add another representation as suggested by you. Another issue would be the user interface on the calculator. You need a way to input such commands...

RE: [WP 34S]How to implement an INPUT function - Paul Dale - 12-14-2013 06:57 AM

Marcus is correct. We've basically exhausted the command encoding on the 34S. The triple alpha arguments are a bit of a hack that caused a lot more trouble than they originally appeared to. This will be completely redesigned for the 43S. We could add more functions, but each would have to be carefully justified and I can't see how the 35S INPUT function would fit.

The 34S has a plethora of input commands. Want to display a value, an alpha string and wait for user input? We've got commands for that. Even though there is nothing exactly equivalent to the 35S INPUT command, we have sufficient flexibility to implement reasonable input schemes. In fact, I'd even go as far as saying better. The 35S INPUT is fairly restricted -- why a single letter when you can display a proper name?

- Pauli

RE: [WP 34S]How to implement an INPUT function - walter b - 12-15-2013 06:15 AM

Bonjour Didier,

Pauli is right. Please also see pp. 80f in the printed manual.


RE: [WP 34S]How to implement an INPUT function - Didier Lachieze - 12-15-2013 04:15 PM

Marcus, Pauli & Walter, many thanks for your answers. I understand that the current implementation is pushing the 30b to it's limits and even beyond ...

While the 35S alphanumeric variables (coming I think from the 32S) make for simple formula programming, the 34S is much more powerful with some inherent complexity...

I'm looking forward to the wonders you'll do with the 43s Smile