Post Reply 
HP41 backarrow to CLX behavior
07-24-2016, 07:34 PM
Post: #1
HP41 backarrow to CLX behavior
I discovered a strange behavior in the HP41 digit entry and wonder if this is a bug.

When I enter a number and then backarrow up to rub out every digit, I end up with 0 in the display and stack lift disabled. It did a CLX.

However, if I press and hold the backarrow key at the last digit, I get CLX shown followed by NULL. Now release the key and I also have 0 in the display, but with stack lift ENABLED.

First of all, I cancelled the operation, should it not go back to showing the last digit again?
Second, why is stack lift enabled? Well, I guess it cancelled the CLX, but still it stored a 0.

You can try as follows:

Get 7 and 5 on stack with stack lift enabled:
2 ENTER 5 + LASTX

Start digit entry :
3_

Press and hold <- (until NULL)
Gives 0

Now try to add 1:
1 +

HP41C now shows 1, RDN gives 5.

If I do not hold backarrow (or try this on an HP16C), I get 6, RDN gives 7.
Find all posts by this user
Quote this message in a reply
07-25-2016, 11:17 AM
Post: #2
RE: HP41 backarrow to CLX behavior
(07-24-2016 07:34 PM)hth Wrote:  I discovered a strange behavior in the HP41 digit entry and wonder if this is a bug.

I don't think so.

(07-24-2016 07:34 PM)hth Wrote:  Start digit entry :
3_

Press and hold <- (until NULL)
Gives 0

Sure. You entered a number and then deleted all of its digits by pressing the backspace key. This leaves an "empty value" in X, i.e. a zero. The CLX function was not executed (because keeping the key pressed has NULLed it) so there is stack lift is enabled. However, pressing the backspace key has removed the last (here = only) digit, so all that remains is a plain zero.

Dieter
Find all posts by this user
Quote this message in a reply
07-25-2016, 01:18 PM (This post was last modified: 07-25-2016 01:21 PM by Harald.)
Post: #3
RE: HP41 backarrow to CLX behavior
(07-25-2016 11:17 AM)Dieter Wrote:  
(07-24-2016 07:34 PM)hth Wrote:  I discovered a strange behavior in the HP41 digit entry and wonder if this is a bug.

I don't think so.

(07-24-2016 07:34 PM)hth Wrote:  Start digit entry :
3_

Press and hold <- (until NULL)
Gives 0

Sure. You entered a number and then deleted all of its digits by pressing the backspace key. This leaves an "empty value" in X, i.e. a zero. The CLX function was not executed (because keeping the key pressed has NULLed it) so there is stack lift is enabled. However, pressing the backspace key has removed the last (here = only) digit, so all that remains is a plain zero.

Dieter

I am not convinced the behaiviour is intentional.
Lets simplify things a bit
for example you have
Code:

Z: 1
T: 2
Y: 3
You now enter a number into x, a 5 for example.

If you then press the back arrow once (and get a zero) and follow this up with a 4, you end up with
Code:

Z: 1
T: 2
Y: 3
X: 4

But if you press and hold the back arrow after entering the 5 you get a "CLX", followed by "Null". To me that would mean that no function has been executed. Yet, if you now enter a 4 you get this:
Code:

Z: 2
T: 3
Y: 0
X: 4

Clearly the back arrow has been executed, and then clx has not been executed.
(Now that I have written all that, I realise that is just what you said Dieter ;-))

But the question is, why do we get the annulled "CLX"?
If you have entered more then one digit, say you have entered 56, and then press and hold the back arrow, the 6 gets deleted, leaving the 5. Nothing else happens. Why is that different when deleting the last digit?

Harald
Find all posts by this user
Quote this message in a reply
07-25-2016, 05:39 PM
Post: #4
RE: HP41 backarrow to CLX behavior
(07-25-2016 01:18 PM)Harald Wrote:  But the question is, why do we get the annulled "CLX"?
If you have entered more then one digit, say you have entered 56, and then press and hold the back arrow, the 6 gets deleted, leaving the 5. Nothing else happens. Why is that different when deleting the last digit?

Harald

Normally in digit entry, adding (or erasing) a digit will just happen once you press the key. There is no NULL test or backing out. It just waits for you to release the key and debounce it. Done, end of story.

When you back arrow to the point of erasing all previous digit entries, what happens is that digit entry puts 0 in X, without touching the stack lift flag. Then it kick back the function code of CLX to the keyboard parser who now thinks you pressed a key to execute that function. It then performs the NULL test on this key pressed, and aborts if it times out with NULL. If the key is not aborted, it proceeds to normal CLX operation.

If you try to put:
7
5
9 ENTER

So we have:
7
5
9
9 (stack lift disabled)

Now start entering a number, then rub out and hold on last to get CLX-NULL. We are left with:
7
5
9
0

And stack lift disabled, press 1 + and you get:

7
7
5
10

So the problem is that stopping last entry with CLX-NULL, does put a zero in X, but it does not affect the original status of the stack lift flag.

I still think it is a bug. The intention would be that if you back out of digit entry, you get 0 and stack lift disabled, so that you can start over with another number, which will replace the 0. This is not always what happens here.

The problem is that digit entry when it decides to give up just does half the job by putting a 0 in X, but it does not clear the stack lift flag, which I think it should have. This can be seen in BAKDE (@732 in QUAD 2).
Find all posts by this user
Quote this message in a reply
Post Reply 




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