Академический Документы
Профессиональный Документы
Культура Документы
PACKARD
Acknowledgements
Much of this documentation is credited to James Donnelly. You can check out his page at:
http://www.peak.org/~jimd/calcpage.html. I bought his book An Introduction to HP48 System
RPL and Assembley Language Programming and definitely recommend it to anyone who plans
to use the HP48 to its fullest capabilities. The examples (and there are lots of them) of system
RPL and assembley language are more than enough reasons to get the book. A good deal of the
information in this document comes from the above-mentioned book. But since I used mine so
much, a lot of the pages are almost torn off (the covers have been lost, and the spine is coming
apart =); hence my need to write this document.
Thanks also goes to Hewlett Packard for making such a great calculator. Without them, there
would be no input forms =).
I would also like to thank Chris Tham, christie@extro.ucc.su.oz.au, for his template that I used to
make this document. It made things go much faster and more organized.
I hope that this document will be usefull to some of you who program in system RPL. Feel free
to email me at hduong@junix.ju.edu for any comments and suggestions.
DATES OF REVISIONS
First Revision July 8, 1998 youre reading it.
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
1. Introduction
The input forms used by the HP48 G and GX series calculators use the DoInputForm command
that comes built-in with the ROM. Unfortunately, this command was not implemented in the S
and SX series, and hence will make any applications that use DoInputForm version dependent.
The command is NOT a library commandit is simply a system level command that is actually a
secondary. The address of the command in hexidecimal is #199EBh.
1.1. Features
Input forms provide an excellent graphical user interface for users to enter in data that will be
processed by the rest of the program. They can be customized to allow as little limitations on
what kinds of inputs can passed to the remainder of the program to having full control of what
kinds of inputs are allowed and what flags are affected.
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
2. DoInputForm Parameters
There are many parameters that get passed to DoInputForm, so it may be good convention to
group the parameters into blocks so as to clearly identify which parameter is which. An example
of how DoInputForm can be found in the Appendix section. Below are the parameter which
must be on the stack at the time when DoInputForm is reached in the runstream:
Label
Label
.
Label
Specifier 1
Specifier 2
. .
Specifier N
* Label Specifiers
Field
Field
.
Field
Specifier 1
Specifier 2
. .
Specifier N
* Field Specifiers
Label Count
Field Count
General Message Handler
Title
The label title is simply a string that will get displayed, in the smallest built-in font, at the
coordinate specified by the horizontal and vertical positions. These positions are system binaries
which specify the top left corner of the label title relative to the top left corner of the HP48
display. The top left corner of the display has a coordinate value of #0 #0 (two system binaries)
and as you move right and down, the coordinates increase in value. The coordinate values are
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
equivalent to one less than the number of pixels from the left side and from the top of the HP48
display.
The message handler can be either DROPFALSE or a secondary. DROPFALSE is the default
message handleruse this if you do not want to bother with, nor intend to test/change, the input
entered by the user. However, you can use a secondary for the message handler. Just make sure
that the secondary gets pushed onto the stack (not evaluated). When using a secondary, both the
passed objects (varies depending on the input field type) and the message number (a system
binary) is passed to the handler. When the handler is executed, either the correct parameters and
TRUE is returned, or the flag FALSE is returned. Below is an example of a typical message
handler for a field specifier:
::
FORTYSIX #<> case FALSE
DUPLEN$ TWENTYTWO #<
ITE TRUE DROPFALSE
;
Note that ONLY message number 46, which checks the object value of a field, is handled here.
The horizontal position and vertical position are the pixel coordinates of the highlight bar
when it is moved over the field. The coordinate is the top-left corner of the highlight bar, and is
in system binary integer form. These values are similar to those in the Label Specifiers.
The field height and width height are system binary integers that represent the height and width
of the hihglight bar (i.e. the field) in pixels. The height is normally EIGHT.
The field type is a system binary that represents the type of field to use. For example, in the
PLOT envrionment uses an algebraic field type for the EQ field. The type of field used depends
on the bits of the system binary. What each bit represents, I dont know for sure. However,
valid system binary integers are:
Decimal Value
1
3
12
32
Field Type
Text Fields
Algebraic Field auto-ALG mode and add tic () marks to editline
Choose Field
Check Field
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
The object types list is a list of system binary integers, where each integer represents the type of
objects allowed. These values are the same as those normally used for argument checking. If
you are using a choose field or a check field, then use MINUSONE instead of a list of system binary
integers.
The decompile object can either be secondary that takes an object and returns a string, or a system
binary integer. An example of a valid secondary as a decompile object is given below:
::
DUP MINUSONE EQUAL casedrop NULL$
DUPTYPECSTR? ?SEMI EDITDECOMP$
;
If you choose to use a system binary integer, the bits of the integer have different specifications.
Bit Value Set
0
1
2
3
4
5
Decompile Format
No decompileexpect only strings
Decompile object to have stack appearance (numeric formats apply)
Decompile object to have stack appearance (but uses STD number format)
Get first character of the stringexpects a string
Get first object in a composite object and decompile it
Get second object in a composite object and decompile it
If you set bits 4 or 5, then make sure to set one of those between 0 and 3 so that the input form
knows how to decompile the extracted object. You may use a combination of set bits. For
example, if your program passes a list containing a list of two strings, you might choose to set
bits 4 and 0, giving you a system binary integer value of 2 * 2 ^ 4 + 2 * 2 ^ 0 = 17. If you use the
GUI.H include file, then this will be taken care of for you. GUI.H normally comes with the HP Tools
package.
The help string is simply a string that gets displayed just above the menus when the field gets highlighted.
These strings might contain messages on how and/or what to enter into the field.
The choose field data varies according to what you intend to have as choices. Normally, using a list of
strings is sufficient.
The choose field decompile object follows the same rules as the field decompile object.
The reset value is what gets put into the field when the user presses the RESET menu button. The initial
value is what gets displayed at the start of the input form. M ake sure that your reset value and initial value
are of the same object type listed in your allowed object type list.
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
2.5 Title
The title is simply a string that will be centered at the top of the display. It will be shown in the
area normally associated with the first line of the display with middle-sized fonts. If the string is
too long, it will be truncated so as to fit within the 131 pixels of the HP48 display.
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
Appendix A (Example)
Below is the source of the input form interface for the VOLUME command from CALC LIB 1.0
The original source was modified so as to be more explicit in some areas. The GUI.H and
KEYDEFS.H files are assumed to be included in the compilation of this source.
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
::
"Undefined\0AValue(s)"
NINE FIFTEEN
GrobAlertIcon
MsgBoxMenu
DoMsgBox DROP
;
TRUE
;
"VOLUME BY ROTATION"
DoInputForm
;
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U
Appendix B (Resources)
Below are websites that have information on programming (USR-RPL, System RPL, and
Assembly). Also listed are sites containing files for download for the HP48.
Websites
http://hp48.ml.org
This is the HP48 Archive and contains many documents on programming, and just as
many files containing programs that provide additional commands for programming.
http://hp48.wsjr.com/webring.htm
The HP48 Web ring is a collection of HP48 sites linked together by the Webring. Add
your page to the ring, or check out the full list of members (each with a brief
descriptions).
comp.sys.hp48
Join the HP48 newsgroups and read postings on how to program, or post your own questions. If
you dont have a newsreader, just check out Deja News at http://www.dejanews.com and browse
through the newsgroups using your favorite web browser.
E rror! Utilice la pestaa Inicio para aplicar Title al texto que des ea que aparezca aqu.
Error! U