From conte@crest.csg.uiuc.edu Mon Apr 9 18:11:54 1990 From: conte@crest.csg.uiuc.edu (Tom Conte) Newsgroups: comp.sys.handhelds Subject: Two tools for 48sx Keywords: 48sx, hp Date: 8 Apr 90 21:40:19 GMT Reply-To: conte@crest.csg.uiuc.edu (Tom Conte) Organization: University of Illinois at Urbana Here are two tools I've found useful for the 48sx. Included is also one open question... The first uses vectored enters to perform a nice `printerless printer' interface: every operation is displayed in the status area. For example, 6 ENTER 5 + 7 / would first display 6 in the status area, then "5 +", then "7 /". I've found this real, real handy in a test/pressure situation where I wanted to make sure I had just hit the right key. With a litte alteration, this can be turned into a trace mode for the printer. [sorry, no serial cable yet, I've done my best to make it easy on those who have a cable] xsum: #1E19h, bytes: 27 '\GaENTER' @ \Ga means `alpha', right-shifted A \<< DUP 'L' STO OBJ\-> \>> xsum: #1D8Dh, bytes: 71 '\GbENTER' @ \Gb means `beta', right-shifted B \<< 'L' RCL " " ROT "\010" @ a new-line + + + 1 DISP 1 FREEZE "" 'L' STO \>> xsum: #A657h, bytes: 53 'PPON' \<< -62 -63 SF SF "" 'L' STO \>> xsum: #44ADh, bytes: 48 'PPOFF' \<< -62 -63 CF CF 'L' PURGE \>> The second tool is useful for finding out the USER-mode bindings of a key. You execute SKEY and then hit a key, and it shows you all the assignments for that key. xsum: #DB67h, bytes: 371.5 'SKEY' \<< 10 CF "Press key to see\010its assignments:" 1 DISP 1 FREEZE WHILE KEY 0 == REPEAT END LASTARG DROP { " :" " L:" " R:" " \Ga:" "L\Ga:" "R\Ga:" } @ \Ga means `alpha', right-shifted A RCLKEYS \-> k l a @ just a plain old lower-case "K L A" here \<< "" 1 6 FOR i l i GET a @ lower-case a k i 10 / + POS IF DUP 0 \=/ @ \=/ is the not-equals sign, right-shifted Y THEN 1 - a @ lower-case a SWAP GET \->STR 10 SF ELSE DROP "" END "\010" @ a new-line + + + NEXT IF 10 FC? THEN DROP "No assignments\010" @ a new-line END 1 DISP 3 FREEZE \>> \>> And now the question: the above, when confronted with a string that contains a new-line, will DISPlay it in multi-line form. But this is cumbersome, since I would like to restrict output to a single line, perhaps terminating with a "...". In other words, I would like to display a string the way the oper- ating system does when the string is in levels 2 or greater. Any clues how to do this? ------ Tom Conte Center for Reliable and High-Performance Computing conte@uiuc.edu University of Illinois, Urbana-Champaign, Illinois