[comp.sys.handhelds] 20 level stack viewer

ahernsd@mentor.cc.purdue.edu (Dynastar) (04/09/91)

Just yesterday, I accidentally crashed my HP48sx and wiped
the entire memory.  (sob)

So I spent last night redownloading stuff and rewriting
programs that I hadn't backed up.  I took this opportunity
to improve on a couple programs.

I had a 10 level stack viewer, but I decided to do it one
better.  Here's a twenty level stack viewer that will
display the stack in two columns for you to look at.
If you have less than 11 things on the stack, it will
only display it in 1 column, just like my old stack viewer.

I used the smallest font so I could display
as much of the stack as I could.  Unfortunately, this font only
has capital letters.  If there is enough interest, I will post
a version of this with a variable font size.

Enjoy!
-----
%%HP: T(3)A(R)F(.);
\<<
  IF DEPTH
  THEN PICT RCL \->
BACKUP
    \<< PICT PURGE 1
DEPTH 1 - 20 MIN \->
V
      \<< V
        FOR S S
PICK \->STR RCLF -49
CF -50 CF S \->STR
": " +
          IF 'S\=/10'
          THEN " "
SWAP +
          END SWAP
STOF SWAP +
          IF 'S>10'
          THEN
"             " +
          END 1
\->GROB PICT SWAP
          IF 'S<11'
          THEN # 0d
64 S 6 * -
          ELSE
# 62d 64 S 10 - 6 *
-
          END R\->B 2
\->LIST SWAP REPL
        NEXT
        IF 'V>10'
        THEN # 64d
64 V 10 - 6 * - R\->B
2 \->LIST { # 64d
# 63d } LINE
        END { }
PVIEW BACKUP PICT
STO
      \>>
    \>>
  END
\>>
----
-- 
Sean Ahern ----------- Purdue University --------- ahernsd@mentor.cc.purdue.edu
Dan Quayle: "Japan is an important ally of ours.  Japan and the United States
             of the Western industrialized capacity, 60 percent of the GNP,
  :-)        two countries.  That's a statement in and of itself."