[comp.sys.handhelds] Two tools for 48sx

conte@crest.csg.uiuc.edu (Tom Conte) (04/09/90)

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

cloos@batcomputer.tn.cornell.edu (James H. Cloos Jr.) (04/10/90)

In article <1990Apr8.214019.13779@ux1.cso.uiuc.edu> conte@crest.csg.uiuc.edu (Tom Conte) writes:
|Here are two tools I've found useful for the 48sx.  Included is also
|one open question...
[ tools DELed]
|
|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?

I've been having a slightly different problem with this.  I had a program
that I would have like to have had a 3 line error message to be displayed
via DOERR.  Unfortunately, based upon my empirical evidence, DOERR breaks
at only the first \010 (decimal) displaying the rest as if they were \158 
whereas DISP breaks at all occurances of \010.  I'm sure the former is for
efficiency, but I must admit surprise that the two commands work
differently.

I would be interested in any concrete info on this and how to circumvent it
:-).

-JimC
--
James H. Cloos, Jr.          "Entropy isn't what it used to be."
Cloos@CrnlThry.BITNET            --c/o Fortune @ batcomputer.UUCP
Cloos@TCGould.TN.Cornell.EDU	 #include <std_disclaimers.h>
<world>!cornell!batcomputer!cloos	PersonalZipCode: 14048-0772