Post Reply 
Detect number entry on HP-35s?
02-25-2015, 02:15 PM (This post was last modified: 02-25-2015 02:30 PM by Dieter.)
Post: #6
RE: Detect number entry on HP-35s?
(02-25-2015 01:45 PM)mbrethen Wrote:  The idea is to fill a number of unnamed indirect variables and then branch off (terminate loop) when the user does not enter a value, similar to using FC?C 22 on the 41c.

The flag 22 method (or flag 3 on the 67/97) does not always work – for instance it cannot detect if the user recalls a value from a register instead of typing it directly, nor will it handle an input as simple as pressing the pi key.

(02-25-2015 01:45 PM)mbrethen Wrote:  Here is the beginning of my code:

I assume this is not the code you are actually working with. For instance there is no LBL W in line 001 (which is required for branching to line numbers) and I also wonder what line 005...011 will do. At line 005 the value in X always is 1.001, so the following three lines will always evaluate to 1000 and the display is [1000, 1]. Is this how the program is supposed to work? What is this [1000, 1] supposed to mean? Due to the "1E3 x" in line 007-008, LastX always is 1000, and so is the first value displayed within the square brackets.

If this is not the intended behaviour, please give an example of a value entered by the user on program start, and what you want the program to display in the first, second, third, ... loop. Finally, what's the use of SF 0 at the beginning?

BTW, if you want to use the indirect variables (with positive index), you have to make sure that a sufficient number of registers is allocated. This is usually done by storing a non-zero (!) value in the highest-numbered register beforehand. If the values are stored in consecutive registers and ascending order, simply storing the entered values will do. But this also means that no zero values can be entered! If you want to allow zero entries, the maximum number of registers has to be known on program start, and a non-zero value has to be stored in that register to make sure it exists (i.e. memory is allocated).

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Detect number entry on HP-35s? - mbrethen - 02-25-2015, 03:37 AM
RE: Detect number entry on HP-35s? - Dieter - 02-25-2015 02:15 PM
RE: Detect number entry on HP-35s? - d b - 02-26-2015, 06:31 AM



User(s) browsing this thread: 1 Guest(s)