ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ HP48G/GX -- LIBEVAL ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
by Joe Horn
The G/GX has a new command: LIBEVAL. It's sort of like SYSEVAL, but
instead of taking a memory address (which could be ambiguous due to
the G/GX's massive need for bank switching), it takes XLIB numbers.
It's a "back door" for us hackers. Unlike the ELSYSEVAL command in
the HP Solve Equations Library Card, which only worked for the
libraries in that card, LIBEVAL works for *any* library, including the
hidden ones in the operating system.
CAUTION: LIBEVAL, like SYSEVAL, is both powerful and
dangerous. If used with incorrect input(s) and/or in
the wrong environment, it can nuke your memory.
LIBEVAL takes a single user binary integer of the form #LLLFFFh, where
LLL is the library ID (hex), and FFF is the three-digit function
number (hex, with leading zeros if necessary).
For example, the R->B command is XLIB 2 9. So you can perform a R->B
by executing #2009h LIBEVAL. Try it: 10 #2009h LIBEVAL ÄÄ #Ah.
Using it for named commands is unnecessary, but the G/GX is highly
XLIB oriented (again, due to the need for bank switching), and there
are many useful and interesting features accessible only thru LIBEVAL.
A prime example is the G/GX's inability to programmatically launch the
new "dialog boxes". Suppose a program needs to print things; it would
be awfully nice to be able to throw the I/O PRINT dialog box onto the
screen. The User's Guide is no help here, and in fact it would seem
impossible to do. But #B4197 LIBEVAL is all it takes! Try it. Cool,
huh?
Here's a table of a few useful LIBEVAL magic numbers that I've been
able to nail down. Be sure to type them in correctly!
# hex LIBEVAL result
ÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
B2000 *CMD (Last Command window)
B2001 CHARS Application
B41C1 MODES Application input form
B41CF *Flag Browser (returns TRUE or FALSE to level 1; just DROP it)
B41D7 *MEMORY Application (aka Variable Browser)
B4000 *SOLVE Application choose box
B4001 Solve Equation input form
B4017 Solve Differential Equation input form
B402C Solve Polynomial input form
B4033 Solve Linear System of Equations input form
B4038 Solve Financial Equation (TVM) input form
B4045 PLOT input form
B4113 *SYMBOLIC Application choose box
B4114 Integrate input form
B4122 Differentiate input form
B412B Taylor Polynomial Expansion input form
B412D Isolate A Variable input form
B4130 Solve Quadratic input form
B4131 Manipulate Expression input form
B4137 *TIME Application choose box
B4138 Set Alarm input form
B415B Set Time and Date input form
B416E *Alarm Browser (aka Alarm Catalog)
B4175 *STAT Application choose box
B4176 Single-Variable Statistics input form
B417D Frequencies input form
B417F Fit Data input form
B418F Summary Statistics input form
B4192 *I/O Application choose box
B4193 Send to HP 48 input form
B4197 Print input form
B41A8 Transfer input form
B50FF *Get from HP 48 (immediate)
E4012 *recalls the contents of the reserved variable 'Mpar'
* ÄÄ see note below
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Note: Ray Depew figured out that if you run a program that looks like:
<< #B2001h LIBEVAL LCD-> >>
and exit the input form by pressing the ON key, you'll grab a snapshot
of the screen into a grob on the stack! Excellent for printing
examples of input forms (see PCLPRINT.LIB and EPSPRINT.LIB).
* ÄÄ This method does *not* work with the LIBEVAL's listed with an
asterisk above; it only seems to work for input forms and the CHARS
application.