## Difference in handling of NSTCK-stack and 4STCK-stack

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
mcc
Posts: 258
Joined: Fri Jun 23, 2017 5:10 am

### Difference in handling of NSTCK-stack and 4STCK-stack

Hi,

With activated NSTCK in the setup and switched to 4STCK via MODE (stack empty)
When I enter

Code: Select all

42
ENTER
The stack looks like

Code: Select all

42
42
After switching to NSTCK via MODE and entering the same sequence at an empty stack I get

Code: Select all

42

All stacks are born equal, aren't they?

Cheers!
mcc
DM 42 - SN: 00373, Firmware release v.:3.19. / DMCP 3.21. as compiled by SwissMicros
Thomas Okken
Posts: 913
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

### Re: Difference in handling of NSTCK-stack and 4STCK-stack

Yes, it was intentionally implemented differently this way. In NSTK mode, during number entry, the [ENTER] key terminates number entry, without duplicating level 1; if number entry is not active, the [ENTER] key performs DUP, duplicating level 1 without disabling stack lift. Furthermore, when [←] terminates number entry, it performs DROP instead of CLX. All of this is intended to emulate the behavior of [ENTER] and [←] on the RPL calculators.
HPMike
Posts: 241
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

### Re: Difference in handling of NSTCK-stack and 4STCK-stack

Actually, Free42 does not exactly emulate number entry in the same manner as an RPL calculator, such as the HP50g, where an entry line that HP calls the "Command Line" is inserted underneath the stack, until number entry is completed with Enter. So, in the example above what you would see after typing 42 is:

3:
2:
1:
42

Upon hitting Enter you will then see:

3:
2:
1: 42

If you now start typing in a second number, say 56, you will then see:

3:
2:
1: 42
56

So, you have effectively raised the first number, even though it is stack level 1, because the number being entered is in a separate unnumbered data entry register. Otherwise, you would overwrite the first entry. On the Free42, this is displayed as:

3:
2: 42
1: 56

which is the same as the result on the RPL calculator after hitting a second Enter.

Now, functionally there is no difference, because in either case you do not replicate the value in stack level 1 into stack level 2 the way normal RPN calculators work. Also, there is another difference with Enter between an RPL and an RPN calculator. For example to multiply 42 by 56, in either case the keystrokes are 42 Enter 56 X . However, on an RPL calculator you could also type 42 Enter 56 Enter X , and get the same result, so the second Enter is unnecessary and is effectively a NOP .
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973.