home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sources / hp48 / 305 < prev    next >
Encoding:
Text File  |  1993-01-22  |  8.2 KB  |  298 lines

  1. Newsgroups: comp.sources.hp48
  2. Path: sparky!uunet!seq!spell
  3. From: Detlef Mueller <detlef@dmhh.hanse.de>
  4. Subject:  v08i006:  chkit.dm - CHKIT v1.1 - an utillity for identifing suspect RPL programs, Part01/01
  5. Message-ID: <1993Jan22.043653.2805@seq.uncwil.edu>
  6. Followup-To: comp.sys.hp48
  7. Sender: spell@seq.uncwil.edu (Chris Spell)
  8. Organization: Univ. of North Carolina @ Wilmington
  9. Date: Fri, 22 Jan 1993 04:36:53 GMT
  10. Approved: spell@seq.uncwil.edu
  11. Lines: 289
  12.  
  13. Checksum: 2928438371 (verify with brik -cv)
  14. Submitted-by: Detlef Mueller <detlef@dmhh.hanse.de>
  15. Posting-number: Volume 8, Issue 6
  16. Archive-name: chkit.dm
  17.  
  18.  
  19. BEGIN_RDME chkit.rdm
  20.  
  21. The changes of the CHKIT library vs. v1.0:
  22.   - only contains one command: CHKIT
  23.   - add unit search
  24.  
  25. END_RDME
  26.  
  27. BEGIN_DOC chkit.doc
  28.  
  29. Hi all,
  30.  
  31. the amout of people owning a ROM rev J HP48 grows and most sys-RPL/assembler
  32. programs available as standalone objects or libraries are using 'unsupported'
  33. ROM entry points simply because lot's of low level function aren't 'supported'
  34. (eg. library handling, port management).
  35.  
  36. The little library provided in this article is a 1st step in trying to find
  37. moved RPL code. It is written using only ROM entries listed in ENTRIES.A of
  38. the HP toolkit, which should be safe on any HP48 ROM revision. It provides
  39. the command CHKIT; CHKIT expects an composite object (program, list, symbolic
  40. or unit) or a real number (the library ID of an installed library) on the
  41. stack. The object (resp. the objects of a library) is searched for RPL pointer
  42. into the ROM; each ROM pointer found is checked for pointing to a valid RPL
  43. object.
  44.  
  45. The following rules define a valid RPL pointer (PTR) into the ROM:
  46.  
  47.   - a pointer to a primitive code object, ie. [PTR] = PTR - 5
  48.   - a pointer to a RPL object, ie. [[PTR]] = PRLG
  49.   - a pointer to the pointer DupAndThen, ie. [PTR] = DupAndThen
  50.  
  51. In case no invalid RPL pointer are found, CHKIT reports
  52.     All inspected RPL
  53.     pointer are valid...
  54. in the status display area and leave the stack unchanged.
  55.  
  56. If CHKIT detects ROM pointer not following the above rules,
  57.        !!! Warning !!!
  58.     Found void RPL pointer
  59. is reported in the display status area, the passed object/number is dropped
  60. and a list of binary numbers is placed on the stack. The binary numbers are
  61. the values of the illegal pointer.
  62.  
  63. If you get a new piece of software, which was written on a HP48 with a
  64. different ROM revision than yours, run CHKIT on it.
  65.  
  66. If CHKIT reports any invalid RPL pointer, remove the new software immidately
  67. from your HP48, send the list of the illegal pointer to the author of the
  68. software and publish it in comp.sys.hp48 (please include the name of the
  69. software, where you get it from and what ROM rev your HP48 have).
  70.  
  71. If a checked object is reported to be clean means that all verified RPL
  72. pointer are valid from the scope of RPL execution; it means *NOT* that
  73. the ROM based code didn't move !
  74.  
  75. RPL bases on assembler routines; there are some supported assembler ROM
  76. entries and a lot of unsupported ones. In many RPL programs are CODE objects
  77. embedded, containing assembler code slices (eg. <-LIB->, QED, StrWrt etc.).
  78. Entries called by this assembler slices can't be validated without a complete
  79. entries list of each ROM rev !
  80.  
  81. CHKIT only works on installed libraries - the installation of a new library
  82. may cause trouble, if its configuration code makes use of unsupported entries !
  83.  
  84. However, I would really appreciate if someone owning a rev J HP48 will install
  85. the <-LIB-> library (be shure, that flag 5 is clear !), then executing
  86. 1221 CHKIT and mailing me the result..
  87.  
  88. Bye,
  89.     8-Detlef
  90.  
  91. END_DOC
  92.  
  93. BEGIN_RPL chkit.dir
  94. %%HP: T(3)A(D)F(.);
  95. DIR
  96.   $ROMID   815
  97.   $TITLE   "CHKIT :1.1\169DM'93"
  98.   $VISIBLE { CHKIT }
  99.  
  100.   $CONFIG
  101. "($CONFIG)
  102. ::
  103.  815 TOSRRP
  104. ;"
  105.  
  106.   CHKIT
  107. C$ 278 (CHKIT)
  108. ::
  109.  CK1 STRIPTAGS
  110.  ::
  111.   DUPTYPEREAL? case
  112.   ::
  113.    RDROPCOLA ID cklib
  114.   ;
  115.   DUPTYPECOL? ?SEMI
  116.   DUPTYPELIST? ?SEMI
  117.   DUPTYPESYMB? ?SEMI
  118.   DUPTYPEEXT? ?SEMI
  119.   INHARDROM? ?SEMI
  120.   SETTYPEERR
  121.  ;
  122.  NULL{} { LAM l } BIND
  123.  $ "Snooping object\\031"
  124.  DISPSTATUS2
  125.  ID snoop
  126.  ID bye
  127. ;
  128.  
  129.   cklib
  130. C$ 269 (cklib)
  131. ::
  132.  DUP
  133.  COERCEDUP ZERO
  134.  #>ROMPTR ROMPTR@
  135.  NOTcase
  136.  ::
  137.   TWELVE ERRORSTO
  138.   ERRJMP
  139.  ;
  140.  NULL{} { LAM l } BIND
  141.  ZEROSWAP BlankDA1
  142.  BEGIN
  143.   OVER #>$
  144.   $ "Snooping ROMPTR "
  145.   !insert$ DISPROW1
  146.   ID snoop DROP
  147.   #1+ 2DUP #>ROMPTR
  148.   ROMPTR@
  149.  NOT_UNTIL
  150.  2DROP
  151.  ID bye
  152. ;
  153.  
  154.   snoop
  155. "(snoop)
  156. ::
  157.  '
  158.  ::
  159.   ?ATTNQUIT
  160.   INHARDROM? case
  161.   ::
  162.    CODE
  163.     GOSBVL  =SAVPTR
  164.     A=DAT1  A     ->ob
  165.     D1=A
  166.     C=DAT1  A     [ob]
  167.     D1=C
  168.     C=C-CON A,5
  169.     ?A=C    A
  170.     GOYES   GpPfL
  171.     LA(5)   (=DupAndThen)-5
  172.     ?A=C    A
  173.     GOYES   GpPfL
  174.     A=DAT1  A   [[ob]]
  175.     LC(5)   =PRLG
  176.     ?A=C    A
  177.     GOYES   GpPfL
  178. GpPfL
  179.     GOVLNG  =GPPushT/FLp
  180.    ENDCODE
  181.    ?SEMI
  182.    CODE
  183.     GOSBVL  =SAVPTR
  184.     A=DAT1  A
  185.     P=      4
  186.     GOVLNG  =PUSHhxsLoop
  187.    ENDCODE
  188.    LAM l SWAP2DUP
  189.    EQUALPOSCOMP
  190.    #0<> case2DROP
  191.    >TCOMP
  192.    ' LAM l STOLAM
  193.   ;
  194.   DUPTYPECOL? case
  195.   :: 1GETLAM EVAL ::N
  196.   ;
  197.   DUPTYPELIST? case
  198.   :: 1GETLAM EVAL {}N
  199.   ;
  200.   DUPTYPESYMB? case
  201.   :: 1GETLAM EVAL SYMBN
  202.   ;
  203.   DUPTYPEEXT? NOT?SEMI
  204.   1GETLAM EVAL {}N
  205.   # 2ADA (DOEXT)
  206.   CHANGETYPE
  207.  ;
  208.  '
  209.  ::
  210.   INNERDUP
  211.   DUP#0=csDROP
  212.   ZERO_DO
  213.    ROLL 2GETEVAL
  214.    ISTOP@
  215.   LOOP
  216.  ;
  217.  { NULLLAM NULLLAM }
  218.  BIND 2GETEVAL ABND
  219. ;"
  220.  
  221.   bye
  222. C$ 197 (bye)
  223. ::
  224.  1GETABND DUPNULL{}?
  225.  ITE
  226.  ::
  227.   DROP
  228.   $ "All inspected RPL\\010pointer are valid\\031"
  229.  ;
  230.  ::
  231.   SWAPDROP
  232.   $ "   !!! Warning !!!    \\010Found void RPL pointer"
  233.  ;
  234.  DISPSTATUS2
  235.  SetDA1Temp
  236. ;
  237. END
  238. END_RPL
  239.  
  240.  
  241. BEGIN_ASC chkit.asc
  242. %%HP: T(1);
  243. "04B2076500013484B4944502A313E2139A44D472933301F234C40000000C9400
  244. 50000D9D2011920F230090770B2130D9D206B436F6A368DA16D9D2044230C2A2
  245. 0D400014C6C60296E637075636475646022505C4A007F696E647562702162756
  246. 026716C69646F1B2130D9D20B9F06C2A20F500002020212121202751627E696E
  247. 6760212121202020202A064F657E6460267F69646022505C40207F696E647562
  248. 7B2130C0721C2093B2130D9D2079E60D9D20E3424AD2A139916D9D20CCD20840
  249. 008FB9760143131147135818FA48A202808247C1468A21114334CF8208A2208D
  250. 6B026B3A16CCD20810008FB9760143248DD6950D6E2010C6C68363A4467CC300
  251. 7916AF25079E60D6E2010C6B1D70B21307E12639916D9D206B316E8F6054450B
  252. 21301122639916D9D206B316E8F6095450B21302D12639916D9D206B316E8F60
  253. D6450B2130A4026C2A166B316E8F609545011920ADA203BA50B213079E60D9D2
  254. 014C26DBC363C370523305E2369427043370B213047A2003D4303D43B21300D4
  255. 705E23679470B2130D9D20881301EC26FEF3005E7099E70DA916D9D2076040E0
  256. D401DE40B21309E55047A20D6E2010C6B21300D470A3E26645A32A1702C2304E
  257. 761C2A205200035E6F6F60796E6760225F4D4054525025E226B542129E20F232
  258. 0044230FED30CA13005E7099E706C3368523029E20F23300B21308F23000D9D2
  259. 05AA8157746D9D209612639916D9D208592629E20F23100B21307E126B3A1611
  260. 226B3A162D126B3A16A4026B3A16AD2A1B3A162BC81B21309E55047A20D6E201
  261. 0C6B21300D470C2A205200035E6F6F60796E67602F626A6563647F1C072129E2
  262. 0F2320029E20F23300B2130E4A2091000B1FFFB2EFFA6CFFE6BFFE4A20E60000
  263. 0000000000000000000140000000000000000000000000000000000000000000
  264. 00000000000000041000503484B49445000F000061DF708E"
  265. END_ASC
  266.  
  267. BYTES: #E807h 694
  268.  
  269. BEGIN_UU chkit.uue
  270. begin 644 CHKIT.LIB
  271. M2%!(4#0X+45`*W!6`!!#2$M)5"`Z,2XQJ41-)SDS$"]#3````,!)``4`T-D"-
  272. M$2GP,@`)=[`2`YTM8$MC;SJ&K6&=+4`D`RPJT`0`06QL(&EN<W!E8W1E9"!27
  273. M4$P*<&]I;G1E<B!A<F4@=F%L:60?*S'0V0*;#\:B`E\```("$A(2`G(5)N>6.
  274. MYG8&$A(2`@("`J)@]%;G1@9B]Y9&!B(%Q00"]Y;F1E<FMQ(##"?!`CDK,=#9V
  275. M`I=NT-D"/B2D+1J3&=;9`LPM@`0`^)MG$#0Q$70QA8&OA"H@""AT'&2H$A$T`
  276. M0_PH@"H"V+8@MJ-AS"V``0#XFV<0-$+8;5G0Y@(!;&PX-DIDQSP`EV'Z4G#I*
  277. M!FTN$,"VT0<K,7`>8I,9UMD"MA/F^`9%5+`2`Q$B-IEAG2U@.V&.;Y!%!2LQ?
  278. M(!UBDQG6V0*V$^;X!FU4L!(#2B#&HF&V$^;X!EE4$)$"VBHPJP4K,7#I!ITMF
  279. M$,1BO3PV/`<E,U`N8TER0#,'*S%`IP(P30/3-"LQ`$T'Y3)V20<K,=#9`H@QH
  280. M$,YB[S\`Y0>9?M":89TM<`8$#DT0[00K,9!>!70JT.8"`6PK,0!-!SHN9E0Z7
  281. MHG$@+`/D9\&B`B4`,.7V]@:7YG8&(O74!$4E!5(N8ELD(>D"+R,`1#+PW@.L%
  282. M,0#E!YE^8#QC6#(@Z0(O,P`K,8`O`P"=+5"J&'5'UMD":2$VF6&=+8"58I(N.
  283. M\#(!L!(#YR&VHV$1(K:C8=(AMJ-A2B"VHV':HK&C8;*,L1(#Z55`IP)M+A#`'
  284. MMA(#T'3`H@(E`##E]O8&E^9V!O(FIE8V1O?!<!*2+O`R`B#I`B\S`"LQX*0"4
  285. M&0"P\?\K_J_&_V[[[Z0";@``````````````$`0`````````````````````Y
  286. ;````````````````0`$`!4-(2TE4`/```!;]E
  287. ``
  288. end
  289. sum -r/size 13647/1011 section (from "begin" to "end")
  290. sum -r/size 38830/702 entire input file
  291. END_UU chkit.uue
  292. --
  293. +------------------------------------+--------------------------------------+
  294. |`What a depressingly stupid machine'|             Detlef Mueller           |
  295. | -- Marvin                          |          detlef@dmhh.hanse.de        |
  296. +------------------------------------+--------------------------------------+
  297.  
  298.