Post Reply 
Clear Stack (CLST, CLSTK) and LastX
03-12-2015, 01:55 PM
Post: #1
Clear Stack (CLST, CLSTK) and LastX
When I got my first HP with CLST command, a 41C, I wondered why this command did clear X, Y, Z and T but not LastX. That's not much of a problem since an additional [+] or [×] will do this, but nevertheless it did not seem consistent to me. On the other hand this behaviour was quite handy as it allowed to return a result in an otherwise empty stack by means of a simple ABS CLST LastX sequence.

I now discovered an interesting variation as I tried the latter on my 35s. I was quite surprised to see that instead of the previously computed result a plain zero was returned. As I single-stepped through the program I found that CLSTK obviously also cleared LastX as well. I then tried the same in run mode, i.e. within a normal calculation, and I was surprised even more to find that in this case LastX was preserved.

001 π
002 5
003 ×
005 LASTx
006 RTN

Running the program yields a completely empty stack (including LastX), while doing the same calculation manually returns 5 that is still in LastX.

In other words: within a program, the 35s seems to clear LastX, while in run mode LastX is preserved (as in classic HPs). I could not find this behaviour described anywhere, so I wonder if this is a known "feature". Do you know of any other calculator where CLST / CLSTK behaves this way?

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

Messages In This Thread
Clear Stack (CLST, CLSTK) and LastX - Dieter - 03-12-2015 01:55 PM

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