HP 15c question about [ENTER]



Post: #7

LBL {blockvalue}	; blockValue(x: value): x: counter ready
2 ; 1, 2, 3 -> 3.001
+ ; 4, 5, 6 -> 6.004
3 ; 7, 8, 9 -> 9.007
/
INT
3
*
ENTER
ENTER
2
-
EEX
3
/
+
RTN

i have the above mentioned part. it requires 2x enter to duplicate the x stack. simple question, why is not only one enter enough?


Post: #8

Because the last one gets overwritten by your next entry "2"

Post: #9

In a nutshell, ENTER disables stack lift, meaning your next entry will overwrite what's in X. I think there are a few other things that disable stack lift, but I'm drawing a blank at the moment.

Post: #10

Unlike with an RPL machine ENTER on an RPN machine disables stack lift. Therefore any numeric entry immediately after an ENTER overwrites the 'X' (visible) register. On an RPL machine ENTER is more like a 'DUP' instruction and it duplicates anything on the bottom of the stack. The reason that it *appears* to work the same way is that RPL machines have a command line which is separate from level 1 of the stack and ENTER from the keyboard effectively pushes the command line onto the stack. Any ENTER on an RPL machine with nothing on the command line operates like a 'DUP' and has no effect on stack lift.

Hope this helps. And anyone who cares to correct me or make this more understandable please jump in.

Cheers,

-Marwan


EDIT: Added below.

Here is the relevant section from the HP41CX manual (I'll try to find the section in the 15C manual and post that separately):

Stack Lift

Operations in the HP-41 C are of three types with respect to their effect on the stack. Most
operations enable the stack lift. A few operations disable the stack lift, and a few others are
neutral.

Enabling Operations

All operations on the HP-41 C other than those listed below (under Disabling Operations and
Neutral Operations) enable the stack lift. If you key in a number immediately following an
enabling operation, the stack is lifted and the number is entered into the display.

Disabling Operations

If you key in a number immediately following a disabling operation, the stack is not lifted.
Therefore, the contents of the X-register are not copied into the Y -register before the new
number is keyed into the X-register. The disabling operations are:

ENTER, CLx, Sigma+, Sigma-

Neutral Operations

Neutral operations are those that do not alter the status of the stack lift, so that whether or not
the stack is lifted depends upon the previous operation. Note that CHS and EEX are neutral
only during digit entry. When pressed any other time, CHS and EEX enable the stack lift.
The neutral operations are:

PRGM, ALPHA, ON, CHS, EEX, USER, <--, shift

Edited: 29 Mar 2012, 9:48 a.m.


Post: #11

thank you for your explanation, and of course from the others as well.

i found in the manual page 210 appendix b the action of enter.


Post: #12

Glad you found it. I found it as well and was trying to figure out how to post it. It was quite a bit longer and more detailed than the HP41 manual version :).

Cheers,

-Marwan


Forum Jump: