Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!jarthur!sburke From: sburke@jarthur.Claremont.EDU (Scott Burke) Newsgroups: comp.sys.handhelds Subject: Re: Viewing stack Message-ID: <11382@jarthur.Claremont.EDU> Date: 26 Mar 91 03:48:35 GMT References: <1991Mar25.234257.15408@cs.utk.edu> Distribution: usa Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 23 Here's a chopped-down version of the 10-level stack viewer: STKV: # 59741d; 206 bytes \<< DEPTH 5 < { KILL } IFT @ don't do anything if < 5 levels used PICT RCL ERASE @ recall user's PICT for later restoration 1 DEPTH 2 - 10 MIN @ loop up to 10 or the stack size if < 10 FOR j PICT # 1d j # 6d * NEG # 63d + 2 \->LIST @ form list of coordinates j ": " OVER 5 + PICK + + 1 \->GROB REPL @ form font size 1 GROB line NEXT { } PVIEW PICT { # 0d # 0d } ROT REPL @ display, then reset PICT \>> Before somebody harshes me for using KILL: it saves 2.5 bytes and doesn't leave anything on the stack. No arguments, please. The alternative is to enclose all the code in a list with an IFT, or to use an IF/THEN, which we all know takes more RAM than an IFT. ;-) Scott. sburke@jarthur.claremont.edu