From: mheiskan@hut.fi (Mika Heiskanen)
Newsgroups: comp.sys.hp48
Subject: Re: XLIB headers???
Date: 12 Aug 92 14:43:08 GMT
Reply-To: mheiskan@.vipunen.hut.fi
Distribution: comp
Organization: Helsinki University of Technology - Finland


Here's an old article posted to me by KK.

-------------------------------< cut here >----------------------------------

Hello all.

I've been looking at the, for lack of a better (ie, HP's) word,
algebraic-flags found before each named XLIB that is a program.
(Algebraics, etc. do not have these flags.)  I do have to make one
disclaimer, though: everything below is conjecture on my part, based on
perusal of libraries 2 and 700h in the 48's ROM, and of the output of
usrlib.  Therefore, use this at your own risk.  But if you know that I'm
wrong, tell me so so that we all can benefit!

If we assume that the `D' in D9d20....b2130 is at address N, then addresses
N-3 to N-1 hold the xlib`s number w/in its library, addresses N-6 to N-4
hold the library's number, and addresses N-9 to N-7 hold the `algebraic-
flags.'  What I would like is to know what each bit of these flags
signifies and how to use it in my libraries.  What I've been albe to
discern is below, a minimal subset of what it could be.

To indicate each of the flags, I'll use the convention (xxx) where x is a
hex integer.  Thus, (800), (400), (200), (100) are the bits in the nybble
at address N-9.

Flag (400) indicates if the word can be integrated.
Flag (080) indicates if the word can be differentiated.
Flag (040) indicates if hte word can be inverted (ie., solved by ROOT).
*See below for a comment on these.*

If flag (001) is set, it usually means that the word's symbolic syntax is
not the standard prefix format.  (Ie, 'SIN(X)' or 'MAX(A,B)' are standard
prefix format, while 'X!' or 'A MOD B' are not.)

Flag (004) works with (001) in a way I haven't figured out yet.

If flag (008) is set, then the N-9 and N-8 nybbles are ignored.  In this
way RPN commands can save a byte each by not including the N-8 or N-9
nybbles.

Using sad, I've documented these occurances in library 2:
000, 3A1, 8C5, 080, 8C0, 005, CC5, 105, CC0, 400, 4C5, 4C0, 001, 800, 7A5,
3A5, 121, A, E, 8.

Obviously more needs to be discovered/leaked ;^) but I hope that this can
be useful to anyone trying to implement libraries containing xlibs useable
in algebraics.

NB:  wrt the integrate, differentiate and solve flags, obviously info must
be kept somewhere to indicate that, eg. ACOS is the inverse of COS.  Where
that is kept and if external libraries can hook in to that/those table(s) I
do not know.  At least (000), (001) and (005) can be used for algebraics of
hte form: 'FACT(X)', 'X!', 'X+Y' respectively.  (Some of the commands that
have (005) as their flags do not appear to me to be infix, and some with
(001) do not appear to be postfix (eg, NOT and MOD, respectively). (NOT is
"prefix_w/o_parentheses" and MOD is "infix_with_spaces.")

BTW:  I hope I'm not predicting vaporware, but don't be surprised if RPLC
goes beta by the end of March.

Happy 48'ing!

-JimC
--
James H. Cloos, Jr.             Phone:  +1 716 673-1250
cloos@ACSU.Buffalo.EDU          Snail:  PersonalZipCode:  14048-0772, USA
cloos@ub.UUCP                   Quote:  <>
-------------------------------------------------------------------------------

The obvious question is: Has anything new come up after this?

   --
   --> mheiskan@vipunen.hut.fi
--
--> mheiskan@vipunen.hut.fi
Newsgroups: comp.sys.hp48