From Jake-S@cup.portal.com Mon Apr 30 18:59:05 1990 From: Jake-S@cup.portal.com (Jake G Schwartz) Newsgroups: comp.sys.handhelds Subject: HP48 6-Level Stack Display Date: 28 Apr 90 01:05:08 GMT Organization: The Portal System (TM) An HP48 Six-Level Stack Display Using Vectored Enter ------------------------------------------------------ The HP48SX vectored ENTER capability is useful when modifications must be done immediately before or after a command line is processed. Previous examples mentioned on Usenet include (1) the automatic conversion of real numbers to binary integers (using ENTER to add the # symbol in front) and (2) simulating the TRACE mode for the HP82240 printer (by having ENTER perform a PR1 or PRSTK after each keystroke which per- forms an automatic ENTER). Here is a use for ENTER which overwrites the display status area with the values of stack levels 5 and 6 following each parsing of the command line. (Having stack level one multi-line mode turned OFF guarantees that all six levels will always be displayed.) Enter the program below and store it as ENTER (where is the right shifted B) in the HOME directory; set flags -62 (USER mode) and -63; and at the end of each keystroke which parses the command line the program will automatically display the values of stack levels 5 and 6. Jake Schwartz 135 Saxby Terr Cherry Hill NJ 08003 609-751-1310 home 609-866-6268 work ENTER: ------------ %%HP: T(3)A(D)F(.); \<< DROP @ drops the command line converted to string "6: " @ initial 21-character string for line 6 IF DEPTH 7 \>= @ if stack level 6 exists THEN 7 PICK \->STR @ get it and convert to a string ELSE "" @ otherwise use a null string END 23 OVER SIZE @ get size of object string - 3 MAX SWAP REPL 1 @ position it right-justified in display string DISP @ display in line one of LCD "5: " @ -- repeat IF DEPTH 6 \>= @ the same THEN 6 PICK \->STR @ process ELSE "" @ for END 23 OVER SIZE @ stack - 3 MAX SWAP REPL 2 @ level 5 -- DISP 1 FREEZE @ and freeze the status area of the LCD \>>