Path: republic.btigate.com!news-xfer.netaxs.com!news.maxwell.syr.edu!scanner.worldgate.com!rover.ucs.ualberta.ca!news.ucalgary.ca!acs2.acs.ucalgary.ca!mmastrac
From: Matthew Mastracci <mmastrac@acs.ucalgary.ca>
Newsgroups: comp.sys.hp48
Subject: Making objects with ML [Library Data]
Date: Sat, 7 Mar 1998 23:38:18 -0700
Organization: The University of Calgary
Lines: 132
Message-ID: <6dted9$5au@ds2.acs.ucalgary.ca>
Reply-To: Matthew Mastracci <mmastrac@acs.ucalgary.ca>
NNTP-Posting-Host: mmastrac@acs2.acs.ucalgary.ca
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Xref: republic.btigate.com comp.sys.hp48:7758

Thanks to some helpful tips from this newsgroup, I've put together a
couple of nifty little utilities to "hide" (armour?) any object inside a
Library Data type object.  Not everything is as optimized as it could be,
but it runs fast and hasn't crashed on me yet.  If anyone finds a bug or
improvement (or a comment), email me ASAP.  

Note: if you get the message "ROM Object", that means that you're trying
to convert an object in ROM, which isn't really something you need to
do... 

Example:
1.3 [\->LD] --> Library Data 
Library Data [LD\->] --> 1.3
1 [\->LD] --> Error: ROM Object

Notes:
 - You can "double-hide" an object by running \->LD on it twice, run it
twice again to "double-unhide" it.
 - You can only run LD\-> on Library Data objects that were created with
\->LD (yes, it checks too).
 - This program was tested on ROM rev. R, but it only uses supported
entries, so it should work on other types.

\->ASC of compiled binaries in directory:

"69A20FF7201000000030D8C44430D9D20D29515AA81AD2A18DA16D9D20C2A209
100025F4D402F426A6563647933A1B2130D9D20CCD20F80008FC1523D81308F9
1030132E0102D410311A818F2E8FEB9303488B2013213114517411A818F29145
174345432114517411B13411A1038FC07608F2D7601138F68A308D465D2B2130
B21303F00030C444D830D9D20D29512BF8111920FA000D9D20CCD20620001438
FB97601311791438F2D7608DC7530119205432191D308DA16D9D20CCD2002000
8FC1523818F0E8F662458D465D2B2130D9D20C2A201200094E66716C6964602F
426A6563647933A1B2130B2130B2130B97D"

Source Code:

(compiled with Jazz, but it should work just fine with SASM)

\->LD:
( obj --> libdat )
::
 CK1NoBlame
 CK1
 INHARDROM?
 ITE
 ::
  $ "ROM Object"
  xDOERR
 ;
 ::
  CODE
        GOSBVL  =PopASavptr
        B=A     A
        D0=A
        GOSBVL  =SKIPOB
        AD0EX
        A=A-B   A
        R2=A
        A=B     A
        R3=A
        C=R2
        C=C+CON A,15
        GOSBVL  =GETTEMP
        LC(5)   =DOEXT0
        AD0EX
        D1=A
        DAT1=C  A
        D1=D1+  5
        C=R2
        C=C+CON A,10
        DAT1=C  A
        D1=D1+  5
        LC(5)   #12345
        DAT1=C  A
        D1=D1+  5
        C=R3
        D0=C
        C=R2
        R3=A
        GOSBVL  =MOVEDOWN
        GOSBVL  =GETPTR
        A=R3
        GOSBVL  =PUSHA
        GOVLNG  =Loop
ENDCODE
 ;
;

LD\->:
( libdat --> obj )
::
 CK1NoBlame
 CK&DISPATCH1
 # AF
 ::
  CODE
        A=DAT1  A
        GOSBVL  =SAVPTR
        D1=A
        D1=D1+  10
        A=DAT1  A
        GOSBVL  =GETPTR
        GOVLNG  =PUSH#ALOOP
ENDCODE
  # 12345
  #=
  ITE
  ::
   CODE
        GOSBVL  =PopASavptr
        A=A+CON A,15
        GOSBVL  =GPPushA
        GOVLNG  =Loop
ENDCODE
  ;
  ::
   $ "Invalid Object"
   xDOERR
  ;
 ;
;

Enjoy!

/\/\att /\/\astracci                  mmastrac@acs.ucalgary.ca

"Tout choses sont dites deja, mais comme personne n'ecoute, il faut
toujours recommencer."



