AOH :: CSHP48_2.FAQ

HP 48 S/SX/G/GX Frequently Asked Questions

Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!news!uhog.mit.edu!news.mathworks.com!newshost.marcam.com!zip.eecs.umich.edu!madd0118
From: madd0118@gmi.edu (Keith Maddock)
Newsgroups: comp.sys.hp48,comp.answers,news.answers
Subject: comp.sys.hp48 FAQ : 2 of 4 : Hardware, Programs, and Programming
Supersedes: <HP48_FAQ_v320_2_060195@gmi.edu>
Followup-To: comp.sys.hp48
Date: 20 June 1995 22:25:40 GMT
Organization: GMI Engineering & Mgt. Institute, Flint, MI
Lines: 1901
Approved: news-answers-request@MIT.EDU
Expires: 30 August 1995 22:25:42 GMI
Message-ID: <HP48_FAQ_v321_2_062095@gmi.edu>
Reply-To: madd0118@nova.gmi.edu
NNTP-Posting-Host: prizm.gmi.edu
Summary: Answers to Frequently Asked Questions about HP48 calculators
Keywords: FAQ, HP48
X-Newsreader: TIN [version 1.2 PL0]
Xref: senator-bedfellow.mit.edu comp.sys.hp48:35835 comp.answers:12630 news.answers:46728

Archive-name: hp/hp48-faq/part2
Last-modified: 06/20/1995
Version: 3.21
Posting-Freqency: every 14 days or so

        *********************************************************
             HP 48 S/SX/G/GX  Frequently Asked Questions List
        *********************************************************
    PART 2 of 4: Hardware, Programs, and Programming: Sections IV - VI
                           
       Currently Maintained by: Keith Maddock (madd0118@nova.gmi.edu)
                  Originally Compiled by: Darryl Okahata

Key: ! =new Q/A  + =revised answer 

PART 2:    
IV. Questions about cards, data transfers, batteries, hardware
    4.1 Can I upgrade my S or G to more than 32K ram?
    4.2 How can I get/build a cable for my HP48?
    4.3 Why doesn't the I/R port work farther than a few inches?
    4.4 Can my HP48 talk to my HP100LX via Infrared?
    4.5 I downloaded a program to my HP, and when I ran it, it put a string 
        on the stack like "HPHP48-.......".  What's wrong? 
    4.6 Why does XRECV not work sometimes? (GX)
    4.7 What do the funny symbols \->, \GS+, etc., mean?
    4.8 What are the pinouts for the HP 48 serial connector?
    4.9 Is there any information on interfacing to the HP 48?
    4.10 How can I transfer programs/data from my HP-28S to my HP 48?
    4.11 Can I use rechargeable batteries with the HP 48?
    4.12 How can I tell, from within a program, if the battery is low?
    4.13 My RAM card was plugged into the calculator when I changed the RAM
         card battery, yet I lost all the information on the card.  What
         happened?
    4.14 Why do I get an "Invalid card data" error when I merge a RAM card?
    4.15 I've heard that other manufacturer's RAM cards will work with the
         HP 48.  Is this true?  Will it work?
    4.16 Why does the HP 48SX display flicker slightly?
    4.17 I broke the LCD screen is there an easy way to get another?
!   4.18 Can I use my Amateur Radio with my HP48?

V. Questions about programs
    5.1 Where can I get programs and information for the HP 48SX?
    5.2 What are the Goodies Disks and where do I get them?
    5.3 How do I get access to the HP Calculator BBS?
    5.4 What are files that end with ".zip", ".Z" or ".z"?
    5.5 What is a "ship" file?
!   5.6 What is \->ASC or ASC\-> and where can I get it?
    5.7 What is the HYDE library, and how do I get rid of it?
    5.8 What is the Minehunt game, and how do I use it? 

VI. Questions about programing and advanced user functions
    6.1 I've heard the names "RPL", "Saturn", "STAR", "Voyager", "GL", etc..  
        What do they mean
    6.2 Is there a C compiler for the HP48?
    6.3 Why do SysRPL programs run faster than UserRPL programs?
    6.4 How do I know what library ID number to use for my program?
    6.5 What information is there on the internals of the HP 48?
    6.6 Are there any viruses for the HP48?
    6.7 How do I store fields of variable length string data in a compact,
        rapidly accessible manner that does not require the overhead of
        storing strings in lists?
    6.8 What is "Vectored Enter", and how do I use it?
    6.9 What is "WSLOG"?
    6.10 What are SYSEVALs?
    6.11 What are some useful SYSEVALs?
    6.12 What are LIBEVALs?
    6.13 What are some useful LIBEVALs?
    6.14 What is the format of a GROB object?
!   6.15 What is the AUR and what information does it contain?
!   6.16 What is the syntax for the INFORM, CHOOSE, and MSGBOX commands
         on the G/GX?



 
******************************************************************

IV.  Questions about cards, data transfers, batteries, hardware

******************************************************************

4.1 Can I upgrade my S or G to more than 32K ram?

    It is possible to do this by opening up the case and adding
    some memory chips.  There is a zipfile containing instructions
    and schematics available for FTP:

    ftp.cis.com: /pub/hp48g/uploads/48gs256k.zip

    WARNING:  It is possible to ruin your HP in the process of
    performing this upgrade.  Do not attempt it unless you are
    adept at working with small electonics.  The FAQ maintainer and
    the authors of the instructions take no responisibility for
    anything you do to your HP... 

******************************************************************

4.2 How can I get/build a cable for my HP48?

    Some places that sell the HP48 also sell the cable required for
    interfacing with a PC.  Unfortunately, most don't.  
     
    For information on how to build your own cable, see appendix H.
    
    If you want to buy one, there are a few options.  Places
    like Educalc and ElekTek (see q/a #1.3) sell them for around $20-$25.
    
    There are a few netters that make cables for sale also.  Contact:
    Chris Edmunds <cedmunds@sdl.usu.edu>
    Paul Christenson <PJC130@psuvm.psu.edu> 
    Joel Kolstad <kolstadj@CSOS.ORST.EDU>   
    Ofer Asif <oasif@herbie.unl.edu> 
                          
    If you live in a larger city, you can look in the Yellow Pages
    for a listing of HP authorized dealers who either have the
    cables in stock or can order them in about the same time a 
    mail order place can, but for a lower price..

******************************************************************

4.3 Why doesn't the I/R port work farther than a few inches?

    It turns out that it is the receiver that is "crippled".  The
    transmit range is somewhere around several feet, and some people
    have actually written programs to make the HP 48 emulate some
    remote controls (see appendix I for suggested programs).

   NOTE:  There are currently two stories going around as to WHY.  I 
    will present both of them in the interest showing all sides of the 
    story, but I personally lean to #1 (due to the source), but people 
    will bet their life on #2.. YMMV (Your Mileage May Vary!) 
    
#1  The head of the HP48 design team, Dr. William Wickes himself, alluded 
    during the Chicago Handheld Conference that the IR was intentionally 
    crippled due to the concerns of certain individuals in academia that 
    students could literally 'beam' information from one 48 to another 
    during examinations. (from Rick Grevelle)

#2  The reason the ir reception distance is so short is battery capacity.  
    The Infrared Transmitter is semaphore: It is only turned on when it 
    needs to be on, and the transmission protocol is defined to minimize 
    the ON time.  The receiver, by contrast, must be on continually when 
    a transmission is in process, or when a transmission is expected. If 
    you set your '48 to Server mode, that receiver is drawing power. If 
    you tweek the control bits to activate the receiver for any other 
    reason, it is drawing power. 
    The intantaneous peak power drawn by the transmitter is much higher 
    than that of the receiver.  But in the long run, the receiver will 
    draw more energy from the batteries.  Increasing the receiver 
    sensitivity costs even more power. 
        
******************************************************************

4.4 Can my HP48 talk to my HP100LX via Infrared?

    Yes, it can, although slowly.  Set the HP100LX at 2400 baud, and put 
    it in server mode (under the Kermit Commands menu).  THen you can 
    send stuff from your HP48 to your HP100LX

******************************************************************

4.5 I downloaded a program to my HP, and when I ran it, it put a string 
    on the stack like "HPHP48-.......".  What's wrong? 

    Some versions of kermit distinguish between ASCII and binary files,
    and so you have to worry about the transfer modes at *BOTH* ends of
    the connection (the HP 48SX end and the computer end).  For example,
    when receiving ASCII files, Unix kermit must translate CR/LF pairs
    into LF.  If the HP 48SX is transmitting a binary file, but the Unix
    kermit is expecting ASCII, any CR/LF pairs in the binary file will get
    translated to LF, corrupting the binary file.  Unfortunately, you
    cannot "uncorrupt" the corrupted binary file by simply reversing the
    transfer and expecting kermit to translate LF to CR/LF.  This is
    because the binary file may contain occurrences of LF that were not
    originally part of a CR/LF sequence.

    When a binary file gets corrupted, it will display on the stack as a 
    string, starting with the characters "HPHP48-", and continuing on with 
    a bunch of garbage.  Thanks to two programs, these strings can be 
    reconverted to binary files right on the HP48.  These programs are: 
    FIXIT, by Joe Horn and Mika Heiskanen, or OBJFIX, written by our 
    friends at HP.  These are included in appendix F in ASC form (ASC is 
    in appendix A)
         The major difference between FIXIT and OBJFIX  is the way they 
    operate.  I have never personally had any problems with either.  
    FIXIT takes the bad "HPHP48-" string from level 1 of the stack, and 
    replaces it with the correct binary object.  OBJFIX takes the name of 
    the variable in which the "HPHP48-" string is stored from level 1 of 
    the stack, and puts the correct binary object directly in the 
    variable where the bad string was stored.  It's up to you which you 
    prefer.  I would suggest reading the docs of both (included in 
    appendix F) before using either of them. 

    There is also a quick fix availabe from Dan Kirkland:

    ----- begin ----- 

    SYSEVAL fix for "HPHP48-X!@#$%^&*( 
    by Dan Kirkland, 08 Dec 1993

    Here is a simple SYSEVAL program that will return a pointer to
    the object in those data transfer strings that start with
    "HPHP48-

    BYTES: # 8FEh  53
 
    << "12" SWAP + # 402Bh SYSEVAL # 62B9Ch SYSEVAL >>

    That's all!  (Simple huh!) 
    Name?  Whatever you want!!
    Works on all 48s (S/SX, G/GX)
    ----- End --------

******************************************************************

4.6 Why does XRECV not work sometimes? (GX)

    Pre-Rev R. G Series 48's had a bug that would sometimes cause XRECV 
    to fail if there was not twice the amount of room free for the 
    incoming file. FXRECV, a fix for this bug, is available on the Horn 9 
    disk in the directory \hp as FXRECV.  There is more info about this 
    bug there as well. 

******************************************************************

4.7 What do the funny symbols \->, \GS+, etc., mean?

    These are the ASCII representation of the special HP 48 graphical
    characters.  See the section "Character Translations" in the manual 
    for a table of symbols <--> ASCII representations. 

SX: Chapter 33 (Volume II if 2 volumes) 

GX: Page 27-16 HP 48G Series User's Guide

******************************************************************

4.8 What are the pinouts for the HP 48 serial connector?

    Looking at the pins of the HP 48 (the following diagram is showing
    the pins on the HP 48, as you look *AT* the calculator):
                   _________
                  | o o o o |
                   \_______/
                    ^ ^ ^ ^
                    | | | \------ 4 Signal GND
                    | | \-------- 3 RX (input to the HP 48)
                    | \---------- 2 TX (output from the HP 48)
                    \------------ 1 SHIELD

    Stated another way:

        HP48                    IBM 9 PIN               IBM 25 PIN
        (From the outside
         edge -> inward)
        SHIELD-------------------  SHIELD----------------  SHIELD
        TX (Output)<-------------2 RX (Input)------------3 RX (Input)
        RX (Input)-------------->3 TX (Output)---------->2 TX (Output)
        SGND---------------------5 GND-------------------7 GND

    This information is also on page 27-7 of the G/GX manual.

******************************************************************

4.9 Is there any information on interfacing to the HP 48?

    HP has made available an UNSUPPORTED document called the "HP 48 I/O
    Technical Interfacing Guide", which contains information on the
    wired and serial I/O hardware.

    Look in the various HP 48 archives for a copy.

******************************************************************

4.10 How can I transfer programs/data from my HP-28S to my HP 48?
        
    You use a program called "INPRT", which is avaliable on GD #9.  Any
    previous version will crash the GX.  The new version's checksum is
    #EDF3h, and the old, SX-only version's checksum is #2280h.

    For each program that you want to transfer, you use the HP 28S to
    print it to the I/R output; INPRT, running on the HP 48, reads the
    I/R output of the HP 28S and converts it into a program.

*****************************************************************

4.11 Can I use rechargeable batteries with the HP 48?

    The Rayovac "Renewal" batteries have proven themselves to be reliable
    in the HP48, but there are some problems with ni-cad batteries. 
    You'll have to decide if using rechargeable batteries 
    is worth putting up with the problems:
      
      * You'll have to change batteries more often with rechargeable
        batteries.  Alkaline batteries can deliver power for a longer
        period of time, compared to rechargeable batteries.

      * Once the low-battery indicator comes on, you'll have to change
        the rechargeable batteries pretty quickly.  With rechargeable
        batteries, you have only a few minutes before the calculator
        dies (it's been said that you have up to 15 minutes or so).
        With alkaline batteries, you have an amount of time that is
        supposedly measured in hours. 

      * Ni-Cad batteries lose their charge with time, even if you are
        not using them.  Even if a Ni-Cad battery is just sitting unused
        on a shelf, it slowly loses its charge.  Alkaline batteries keep
        their charge for a very long time.

******************************************************************

4.12 How can I tell, from within a program, if the battery is low?


    The following 48 program reports the status of the ALERT
    annunciator.  The ALERT annunciator is activated by alarms or low
    battery.

    This program is provided free of charge "as is" and has no warranty.
    No one is liable for any consequential damages.
    Preston

%%HP:T(3)A(D)F(.);
\<<
RCLF
8 STWS #FFh #0h +
#10Bh
#6595Ah SYSEVAL
#8h AND #0h >
SWAP STOF
\>>

******************************************************************

4.13 My RAM card was plugged into the calculator when I changed the RAM
    card battery, yet I lost all the information on the card.  What
    happened?

    You forgot to turn ON the calculator before changing the battery.  
    The HP only supplies power to the RAM card while the HP is turned on.  
    While the calculator is turned off, no power is supplied by the 
    calculator, and all power comes from the RAM card battery.  If you 
    then take out the battery from the RAM card while the calculator is 
    turned OFF, the RAM card has no source of power, and you will lose 
    all of the contents in the RAM card. 

******************************************************************

4.14 Why do I get an "Invalid card data" error when I merge a RAM card?

    This message is usually seen when you plug a brand-new RAM card into
    an HP 48.  In this case, this message is normal and is harmless.  It
    just means that there was no (valid) data on the card.

GX: This message can appear when a RAM card contains ports you have 
    never used.  Press purple/left shift-LIBRARY. Hit NXT, then the 
    PINIT softkey.  This will initialize all available ram ports.  It 
    does not affect data already stored on the card.

    If you see this message under any other conditions, it could be one of
    the following:

     1. You took the battery out of the RAM card while the card was out
        of the calculator, therefore erasing the memory.

     2. You took the battery out of the RAM card while the card was in
        the calculator *BUT* the calculator was turned off.  Note that
        the calculator supplies power to the RAM card ONLY when the
        calculator is turned *ON*. Again the memory on the card is 
        gone.

     3. The RAM card battery is dead.

     4. There is a problem with either the calculator, the RAM card, or
        both.
    
    If the battery is operational, then try to store something on the 
    card.  If you still get the error message, then backup all your 
    info to a computer or another 48, and do a hardware reset. (see 
    #13)

******************************************************************

4.15 I've heard that other manufacturer's RAM cards will work with the
    HP 48.  Is this true?  Will it work?

    While some cards may work, there is a chance that you may severely 
    damage your HP 48.  You should only use cards specifically designed 
    for the HP 48.  Naturally, HP sells such cards, and some third 
    parties also make cards that will work in an HP 48.  Some cards 
    work with both the S/SX and the G/GX.  Some, however only work on 
    the S/SX, or only on the G/GX.  Make sure that the card is designed 
    to work for your version before using it.
    
SX: The S/SX can only naturally support up to 128k per port.  HP sells 
    32K and 128K RAM cards.   However, TDS, using software "bank 
    switches" produces 256K and 512K RAM cards.  These bank switching 
    cards do not work in the G/GX series.  CMT is also a makes 128K 
    cards, which work in all HP 48 calculators.
    
GX: While you cannot use the TDS 256K and 512K cards, Sparcom has come 
    out with 256K and 512K cards for the G/GX only.  HP also sells 1MB 
    RAM cards that work for G/GX only.  The G/GX is able to accept a 
    4MB RAM card, but none are on the market at this time.
    
    For more info on using non-HP 48 RAM cards in the S/SX series, see 
    appendix B near the end of this file. 
    
******************************************************************

4.16 Why does the HP 48SX display flicker slightly?

    Display flicker is usually caused by fluorescent lights.  The rapid
    pulsing of the fluorescent lights (60Hz in the U.S.), which is
    normally unnoticeable, interacts with the rapid pulsing/scanning of
    the HP 48 LCD display (64 Hz refresh rate), which is also normally
    unnoticeable.  The 60Hz fluorescent lights alias with the display
    refresh (64Hz) to produce a 4Hz "flicker".  It's normal and
    harmless.

    Outside the U.S., power is supplied at a 50Hz rate, not 60Hz.  This
    means that the display "flickers" at a 14Hz rate, which is still
    noticeable.

******************************************************************

4.17 I broke the LCD screen is there an easy way to get another?
    
    Unfortunately, as far as I am aware, you cannot get a replacement, the 
    cheapest alternative is to send the calc in for "standard service" at 
    HP, which is slightly cheaper than a new calculator.  Opening a 48 is 
    quite difficult anyway.  

******************************************************************

4.18 Can I use my Amateur Radio with my HP48?

    Yes, however you need to have a few things, the first being an 
    amatuer radio license.  The next thing you need is a terminal node
    controller.  If you are able to, get a terminal node controller 
    that supports XON and XOFF software flow control.  This is good to 
    have because the HP48 only has a 256 character buffer.  When the 
    buffer is full, the HP48 sends the "buffer full" signal and
    a terminal node controller with software flow control can quit 
    sending data until the HP48 can keep new data in the buffer.  
    If you don't have a terminal node controller with software flow 
    control, you can still use it, but you may lose some data.

    The next thing you will want is some software to use with the 
    terminal node controller.  You could make your own software 
    using user-rpl commands such as BUFLEN, SRECV, and XMIT.  However, 
    there is a plethora of software available.  All you need is software 
    then can send and recieve data from the serial port.  Here are a few
    programs that you might want to try:

    Program                 Location
    -------                 --------
    term2                   ftp.cis.com

    hp48pack                Send mail to "info@arrl.org" with 
                            "get hp48pack" in the body of the message. 

    dterm                   ftp.cis.com/pub/hp48g/utilities/dterm.zip
        
    There is also a site that has a lot of hp48 programs relating to
    ham radio.  Ftp to "oak.oakland.edu" and go into the 
    "/pub3/hamradio/hp48" directory.  Please tell someone if you 
    find great software, it can be added to this list. 


******************************************************************
V.  Questions about programs


******************************************************************

5.1 Where can I get programs and information for the HP 48SX?
    
    See Appendix I for more info.

******************************************************************

5.2 What are the Goodies Disks and where do I get them?
    
    See Appendix 4 of Appendix I for more info.

******************************************************************

5.3 How do I get access to the HP Calculator BBS?

    You can access the HP Calculator BBS via a modem (note that this is
    a long distance call for most people):

        (503)-750-4448          2400 baud, 8N1
        (503)-750-3277          9600 baud, 8N1

    For those people who have access to the Internet, you can also
    access the BBS via telnet to hpcvbbs.external.hp.com [15.255.72.16].

    See Appendix I for more BBS sites.

******************************************************************

5.4 What are files that end with ".zip", ".Z" or ".z"?

    Files that end with ".zip" are PKZIP archives, which originated in
    the MSDOS world.  One program that can extract the files in ".zip"
    archives is the Info Zip "unzip" program.  An MSDOS binary can be
    found as:

          wuarchive.wustl.edu:/systems/hp/hp48/Posting/unz50p1.exe

    Sources for the unzip program can be found as:

          wuarchive.wustl.edu:/systems/hp/hp48/Posting/unz50p1.zip

    For binaries for other machines, see the file:

          wuarchive.wustl.edu:/systems/hp/hp48/Posting/README

    Files that end with ".Z" have been compressed using the Unix
    "compress" command.  To uncompress these files, you must use the
    "uncompress" command on Unix.  

    Files that end with ".z" have *probably* been compressed using the
    new "gzip" compression command.  To uncompress these files, you must
    use either the "gunzip" or "gzip -d" command.  These commands are
    not a standard part of Unix, and so you'll probably have to get the
    sources via anonymous ftp from prep.ai.mit.edu (as /pub/gnu/gzip*).
    Again, versions are supposedly available for non-Unix platforms.

******************************************************************

5.5 What is a "ship" file?

    In the past, programs for the HP 48 posted on comp.sources.hp48 were 
    posted in the "ship" format.  This format made it easier for the 
    comp.sources.hp48 moderator to distribute programs, but makes it 
    difficult for users to extract and use these programs.   Many people 
    still use ship. 

    To extract programs distributed in the "ship" format, you need the
    following:

     1. A copy of the "ship" program, compiled for your PC, Macintosh,
        Amiga, Unix workstation, or whatever.  The sources to "ship" can 
        be found at:

        ftp.cis.com: /pub/hp48g/dos/unship.zip

        This zip file also includes the dos executable.
    
        Binaries for MSDOS machines, Amigas, and some Unix workstations
        can be also be found on wuarchive.wustl.edu, in the directory
        "/systems/hp/hp48/Posting/ship_executables".

     2. A copy of the latest Info Zip "unzip" program, or a .ZIP
        unarchiver that understands the new PKUNZIP V2.04g format.  Note
        that you *CANNOT* use old unzip programs, as old unzip programs
        do not understand the new compression formats.  An MSDOS binary
        can be found as:

          wuarchive.wustl.edu:/systems/hp/hp48/Posting/unz50p1.exe

        Sources for the unzip program can be found as:

          wuarchive.wustl.edu:/systems/hp/hp48/Posting/unz50p1.zip

        For binaries for other machines, see the file:

          wuarchive.wustl.edu:/systems/hp/hp48/Posting/README

    Once you have a copy of the "ship" and "unzip" programs, you use
    "ship" to convert the ship-encoded file into a .ZIP file, and you
    use the "unzip" program to extract the HP 48 files from the .ZIP
    file.

******************************************************************
    
5.6 What is \->ASC or ASC\-> and where can I get it?
    
    These functions were written by William Wickes to facilitate
    transferring HP 48 binary objects in an ASCII format (useful when
    transferring objects via electronic mail or bulletin boards).  Some
    HP 48 objects, like libraries, cannot normally be converted into
    ASCII, unlike program objects, and these functions make it possible to
    do so.
    
    The \->ASC function converts the object in level 1 into an ASCII
    string, which can then be uploaded to a computer for mailing.
    
    The ASC\-> function converts the string object in level 1 back into an
    object.  A checksum is used to ensure that the decoding is correct.
    
    A copy of these programs are given in Appendix A, near the end of this
    file.

******************************************************************

5.7 What is the HYDE library, and how do I get rid of it?

    The HYDE library is a library that changes the messages on your HP48.
It works on all versions of the HP48 and is available on Goodies Disc #2.
The program (HYDE.TXT) is in the DNICKEL directory needs to be converted
with ASC->. The instructions (HYDE.DOC) for the program are in the HORN2
directory.  The library is 3679.5 bytes, small enough to keep on your HP48
so you can install it on a friend's when he/she is not looking. :-)

    Here are a few examples of the changed messages:

        Invalid Syntax          =>      Makes no sense to me!

        ____ Error:                     ____ foul-up:
        Too few arguements      =>      Gimme some args, man!

        Empty Stack             =>      The well has run dry!

        Awaiting server Command =>      So tell me what to do.

        Connecting              =>      Anybody out there?
    
    To install the library:

     1. Download the library to your HP48
       
     2. Go to HOME.

     3. Recall the library to the stack and purge the download variable.

     4. Press 0, the STO.

     5. Put :0:998 on the stack.

     6. Type ATTACH

     7. Turn your HP48 off, then back on.

     8. Push Right-shift then the Library button.

     9. Press STRA.

     10. Press HYDE.


    Getting rid of the HYDE library can be fun.  Here's how to do it:

     1. Go the HOME directory.

     2. Press left-shift (orange) LIBRARY.  The calculator is now
        displaying a menu of libraries attached to the HOME directory.

     3. Press the menu key that says "STRA".  You are now accessing the
        HYDE library.

     4. Press the menu key that says "JEKY".  You have now disabled the
        HYDE library and restored the old (standard) set of messages.

     5. Make sure that a pointer to the library is not on the stack.  The
        easiest way to do this is to clear the stack using CLR.

     6. Detach the library using:

          :0:998 DETACH

     7. Purge the library using:

          :0:998 PURGE

        When you execute the PURGE, the screen will "jump" or "be messed
        up" for a brief moment.  Don't worry about it -- it doesn't
        hurt.

******************************************************************

5.8 What is the Minehunt game, and how do I use it? 

   The Minehunt game is a game built in to the G/GX, and included on 
   the HP EQ library card.  

GX: It is located in the UTILS menu of the left-shift(purple) EQ LIB menu. 
    (Left-Shift {EQ LIB], {UTILS}, {MINEHUNT}).  See page 25-14 of the 
    manual for a game explanation and picture.

SX: It is located in the UTILS library. 

   You can save a game by pressing the STO button. This creates a variable 
   with the name MHpar. If you are in the directory containing that 
   variable, you will resume your old game when you run MINEHUNT.

   To select the number of mines for your next game just store a number 
   in a variable, Nmines (it's case sensitive), and you'll get that 
   many mines.  If you store a negative number, you'll get the absolute 
   value of that many mines, AND all mines will be visible.

   You can also move diagonally if you use the numbers as arrows:
   1 is down+left, 2 is down, 3 is down+right, 4 is left, 6 is right,
   7 is up+left, 8 is up, and 9 is up+right.

******************************************************************

VI.  Questions about programming and advanced user functions

******************************************************************
  
6.1 I've heard the names "RPL", "Saturn", "STAR", "Voyager", "GL", etc..  
    What do they mean?

    ASAP
        This is a simple Saturn assembler, written in the Perl language.

    Chip8, Chip48, Schip, Schip8
        This is a machine-code program that was inspired by the chip8
        video game interpreter for the RCA CDP1802 microprocessor
        several years back.  Chip8 allows you to write a simple
        graphics-based video game for the HP 48SX.  Among the games
        written are "clones" of breakout, pacman, and pong, to name a
        few (about half?).

        Chip48, Schip and Schip8 are two different names for an enhanced
        version of chip8 specifically designed for the HP 48SX.  People
        have written programs to assemble Schip assembly language into a
        form directly usable by Schip on an HP 48.  Schip interpreters are 
        available for both G and S series.

    HYDE
        This is the "HYDE" library, whose only purpose is to change the
        error messages in the HP 48SX to make it "user unfriendly".

    GL
        GL (Game Language) is a language for the programmer who wants 
        almost the speed of assembly, but who doesn't want to spend a lot 
        of time and effort to learn all the tricks of assembly programming 
        on the HP48. GL has an assembly-like syntax, and there is an 
        assembler for PC and one for the HP48 itself. Since GL is an 
        interpreter, the GL library (3 KB in size) must be installed on the 
        HP48 to run GL programs. The instruction set is powerful, with 
        sprites and pixel based graphics, scrolling, sound, keyboard 
        control, and more. There are 256 1-byte registers which can be used 
        in pairs as 2-byte words. A GL program can be up to 64 KB in size. 
        GL was inspired by S-CHIP, but it is much better in all aspects. It 
        is suitable for many applications, not only games, that require 
        high speed. Of course it works on both the HP48S/SX and the G/GX. 
        GL is written by Erik Bryntse. 
        
    ML
        Machine Language.  This is usually used in reference to HP 48 
        assembly language programming.

    MLDL
        Machine Language Development Library.  This is a library that 
        allows you to debug machine language programs with only an HP 
        48. 

    PDL
        "Program Development Link".  This is an MSDOS program, sold by
        Hewlett-Packard, that allows you to write and develop HP 48
        applications from your IBM PC clone.  Programs are written on
        your PC, transferred to the HP 48, and tested from your *PC*
        (and *not* the HP 48).

        
    RPL
        RPL is the name of the language used to program the HP 48 and
        HP-28 series calculators.  RPL stands for "Reverse Polish Lisp".
        It's interesting to note that an HP Journal article incorrectly
        described RPL as "ROM-based Procedural Language".

    SASS
        SASS is a simple Saturn assembler, written in C/yacc (BSD Unix &
        Bison).  It uses Alonzo Gariepy's mnemonics.

    Saturn
        "Saturn" is the internal code name for the processor used in the
        HP 48, HP-28 series, and many other calculators (just about all
        HP calculators since the HP 18/28 series).

    STAR
        This is the "Saturn Macro Assembler" (how "STAR" comes from
        this, I don't know), an assembler that mostly uses Alonzo
        Gariepy's mnemonics.  It's written in C and runs on many
        different machines (PCs, Amigas, Unices, etc.).  STAR is
        available via anonymous ftp from ftp.ai.mit.edu in
        "/pub/star-1.04.4.tar.Z".  [Note: Rumor has it that this is 
        no longer available at this site.  If you know of a more 
        recent site, email the maintainer please.]  It's also 
        available from various bulletin boards (the HP handhelds 
        forum on CompuServe also has a copy).  The latest version 
        is "1.04.4".

    SWING
        SWING is a library program that displays a graphical tree
        structure of the directory hierarchy in your HP 48SX, and allows
        you to move from directory to directory using the arrow keys (it
        is supposedly based upon an old PD VMS utility).

    System RPL
        This is the name for the custom "operating system/language" used
        to program the CPU used in the HP 48 calculator.  System RPL
        is a superset of the normal user RPL commands; in addition to
        the normal, user-accessible RPL commands, system RPL includes
        many lower-level functions.  System RPL is a language one step
        higher than assembly language.

        HP has released a system development toolkit (for the IBM PC)
        containing a system RPL compiler, assembler, and loader,
        complete with a couple hundred pages of documentation.  This
        toolkit, while copyrighted, is, for the most part, freely
        copyable.  If you can find a BBS or archive site that has it,
        you can download all of the system RPL files and documentation.

        The HP development toolkit only runs on the MS-DOS operating 
        system. Alex Ramos has written a portable system RPL compiler 
        which runs primarily on Unix systems, and can emulate most of the 
        features available on the HP kit. The program is called RPL#+ (in 
        an analogy to 'C++'). RPL#+ is available from Ramos's email 
        server: send a message to ramos@engr.latech.edu with a Subject 
        line that reads: 
        "send hp48/rpp199c.zip" 
        without the quotes, and a daemon program will reply. 
        The program currently runs fine on Sun/OS 4.x, but bugs have been
        reported on other systems, including Linux (bugfixes welcome).

    USRLIB
        USRLIB is a program that takes the contents of an HP 48
        directory and turns it into a library object.  It currently runs
        under MSDOS.

    Voyager
        Voyager is an "interactive disassembler" for IBM PC clones that
        disassembles HP 48SX RPL and machine code.  You download a copy
        of the RAM *and* ROM in your HP 48SX to your PC, and run
        Voyager.  Using Voyager, you can then view the disassembled or
        unthreaded code.  Unfortunately (or fortunately), Voyager uses
        the HP mnemonics, and not Alonzo Gariepy's mnemonics.  Voyager
        is available from the HP BBS (I think), via anonymous ftp from
        the HP BBS (hpcvbbs.cv.hp.com [15.255.72.16]), and from various
        bulletin boards (the HP handhelds forum in CompuServe also has a
        copy).  The latest version is "1.07".

******************************************************************

6.2 Is there a C compiler for the HP48?
    
    Yes. Alex Ramos has written a GNU C back-end for the Saturn
    processor.  Location: ftp.engr.latech.edu:/pub/alex/hp48/ (look
    around for latest version). 

******************************************************************

6.3 Why do SysRPL programs run faster than UserRPL programs?

    SysRPL is the built in language, custom designed for the Saturn 
    processor used the HP48 family. UserRPL is a "subset" of SysRPL.  The 
    main reason for the speed difference is the fact that UserRPL commands 
    have built in argument and error checking.  In SysRPL, the programmer 
    is responsible for all error checking to avoid memory clears.
    
******************************************************************

6.4 How do I know what library ID number to use for my program?

[Note: While this document says 48SX, it is also valid for GX]

HP 48SX Library ID Numbers
Paul Swadener, HP Developer Support.
03 Sep 1993

The HP 48 will become confused if two or more libraries currently in
the machine have the same ID numbers. To help third party developer
efforts, HP maintains a list of HP 48 Allocated Library ID Numbers.

Below are the "rules." The penalty suffered from not following these
rules is that your library may not work if another library is in the
machine with the same number.

a. Don't use any number in the range 000h through 300h. These are
   reserved for HP's use.

b. Don't use any number in the range 301h through 5A0h unless you have
   been assigned that number by HP. These numbers are reserved for
   developers who are in the business of distributing their software,
   that is, Independent Software Developers.

   To apply for the allocation of an ID# contact Paul Swadener,
   Hewlett-Packard Company, 1000 NE Circle Blvd., Corvallis, OR 97330,
   fax number 503-750-2192, internet address
   paul_swadener@hp6400.desk.hp.com. You must be a registered
   developer and supply the name/nature of your product, and current
   shipping address and phone/fax/internet add./etc.

c. Use a number in the range 5A1h through 600h for experimental work
   and software. HP does not track the use of these numbers. 
 
d. Use a number in the range 601h through 6F6h for your personal
   applications, those which you will share, if at all, only to a
   known set of other users for personal uses. HP does not track the
   use of these numbers.

e. Don't use any number in the range 6F7 through 6FF, as these numbers
   were allocated before the formal allocation process in b. was
   instituted.

f. Don't use any number above 700h. These are also reserved for use by
   HP.

Hope this helps clear up how library numbers work.
 
----- end ----- 

******************************************************************

6.5 What information is there on the internals of the HP 48?

    The most important documents are part of the "System RPL" development
    tools, a completely unsupported set of IBM PC tools created by HP
    Corvallis (the creators of the HP 48).  The tools, which run on
    MSDOS machines only, contain documentation on:

        * System RPL (which includes information on HP 48SX display
          graphics, keyboard control, etc.).
        * Saturn assembly language ("Saturn" is the name of the CPU in
          the HP 48), including information on a Saturn assembler.
        * A system RPL compiler.
        * A Saturn object file linker.

    The completely unsupported system RPL development tools and
    documentation are available to customers free of charge to help them
    in HP 48 application development, subject to certain legal terms,
    which are given with the tools (they're too long and detailed to
    give here).

    You can get a copy in one of the following ways:

        * Anonymous ftp to hpcvbbs.external.hp.com [15.255.72.16].
        * Get Goodies Disk #4. For info, see Appendix I.

******************************************************************

6.6 Are there any viruses for the HP48?

    There are several, and most are French.  In the United States, a 
    virus called the "Michigan virus" erupted a couple of years ago.  
    There is a program on Goodies Disk #8 that checks for the Michigan 
    Virus.  Currently, viruses do not pose an appreciable threat on HP48's 

******************************************************************

6.7 How do I store fields of variable length string data in a compact,
    rapidly accessible manner that does not require the overhead of
    storing strings in lists?

    See Appendix E, "Compact Data Storage", near the end of this file.

******************************************************************

6.8 What is "Vectored Enter", and how do I use it?

    [NOTE: This works in the G/GX series as well]
    
    From: billw@hpcvra.CV.HP.COM (William C Wickes)

    The HP 48SX manuals do not document a very powerful feature that we call
    "Vectored ENTER," that allows you in effect to redefine or bypass the
    command line parser and to have a shot at the stack etc. after the command
    line has been executed.

    Keys that execute an automatic ENTER perform a two-step process:

    1.  The command line is parsed and evaluated.
    2.  The key definition is executed.

    When flags -62 and -63 are both set, the system extends this process as
    follows:

    1.  The current path is searched for a global variable named *aENTER
    (here "*a" is the Greek alpha character--character 140).  If present,
    the command line is entered as a string object and *aENTER is
    executed.  If absent, the command line is parsed and evaluated
    normally.

    2.  The key definition is executed.

    3.  The current path is searched for a global variable named *bENTER
    ("*b" is Greek beta--character 223).
    If present, then a string representing the key definition is put on the
    stack, and *bENTER is executed.  The string is the key definition
    object's name if it is a command, XLIB name, global or local name, or
    an empty string for other object types; its primary purpose is to implement
    things like the TRACE mode on other calcs, where you can print a running
    record of what you do.

    A simple example of the use of *aENTER is to create a more convenient
    binary calculator, where *aENTER slaps a "#" on the front of the command
    line so you don't have to bother when entering numbers.

******************************************************************

6.9 What is "WSLOG"?

    It is an undocumented feature which stands for "Warm Start LOG".
    Type in WSLOG in caps, and calc will list the time and cause of the
    last four warm starts.  This feature helps HP tech to fix your baby,
    in case it crashes.

    0 - log cleared by <ON> <SPC> then <ON>
    1 - low battery condition, auto deep sleep mode invoked to save battery
    2 - hardware failed during IR (time out)
    3 - run through address 0
    4 - system time corrupt
    5 - deep sleep mode wake up (alarm?)
    6 - unused
    7 - CMOS test word in ram was corrupted
    8 - abnormality was detected about device config
    9 - corrupt alarm list
    A - unused
    B - card module pulled
    C - hardware reset
    D - system RPL error handler not found in run stream
    E - corrupt config table
    F - system RAM card pulled

******************************************************************

6.10 What are SYSEVALs?

    SYSEVALs are addresses that point directly to a location in the HP48's
    ROM. Many SYSEVAL hex strings are System-RPL commands.  Because there is
    no arguement checking, it *VERY* easy to clear your HP48's memory.
 
    In the file SYMBOLS.GX, HP designates three types of entries.  The first
    type is "supported."  This means that a particular entry will work on ALL
    versions of the HP48 and HP supports the use of this entry.

    The second type of entry is "unsupported."  This means that HP does not
    support the use of this entry and it will not be the same on all versions
    of the HP48.

    The third type is "unsupported-static."  This is an entry to HP does not
    support the use of, but it is the same for all versions.

******************************************************************

6.11 What are some useful SYSEVALs?

    For a complete list of supported entry points, see the file
    ftp.cis.com: /pub/hp48g/uploads/48entry.txt

    In System-RPL, different HP object types are refered to by symbols.
    These symbols are used to construct stack diagrams, which tell the
    user how to use System-RPL commands.  Here are some of the symbols:

    Symbol  Type                        Example
    ------  --------------------        -----------------
    $       string                      "ABCDEFG"
    id      Global Name                 'A'
    arry    Array                       [[ 1 2 ] [ 3 4 ]]
    grob    HP48 Graphics Object        Graphic 131x64
    #       Binary Number               <1h>
    symb    Symbolic Object             'A^2+B^2'

    To interpret the stack diagram:
        Everything on the left of the -> arrow is the input.  That needs
        to be on the stack before executing the syseval.  The symbols 
        show you which kinds of data to put on the stack.  Once you 
        execute the syseval (see next paragraph), the HP will return 
        the data back that is indicated on the right side of the arrow.

    To use the following entries, do the following:
        1. Make sure (triple check) that the appropriate arguements are
           on the stack.
        2. Push Left-shift /, you should get a # on the command line.
        3. Enter the hex string exactly as shown in the hex string column.
        4. Put an small case h at the end of the hex string.
        5. Press enter.
        6. Type SYSEVAL.


Hex String      Sys-RPL Name        Catergory           Stack Diagram
----------      ------------        ---------           -------------

15777           NULLID              Supported           ( -> '' )
30794           VERSTRING               "               ( -> "HPHP48-?" )
3A328           MakeStdLabel            "               ( $ -> grob )
3A3EC           MakeDirLabel            "                     "
3A38A           MakeBoxLabel            "                     "
3A44E           MakeInvLabel            "                     "
3A1FC           DispMenu.1              "               ( -> )
05F42           GARBAGE                 "               ( -> )
41F65           WaitForKey              "               ( -> #KeyCode #Plane )
353AB           SYMB>IDS            Unsupported-static  ( symb -> list )
40D25           LockAlpha           Supported           ( -> )
40D39           UnlockAlpha             "                  "
3AA0A           1A/LockA                "                  "
44C31           DoNewMatrix             "               ( -> arry )
44FE7           DoOldMatrix             "               ( arry -> arry' T/F )
1314D           TOADISP                 "               ( -> )
13135           TOGDISP                 "                  "
39531           ClrDA1IsStat            "                  "
130AC           RECLAIMDISP             "                  "
4E347           TURNMENUON              "                  "
05B15           $>ID                    "               ( $ -> id )
05BE9           ID>$                    "               ( id -> $ )
3A1E8           DispMenu                "               ( -> )
39BAD           DispStack           Unsupported-static     "


******************************************************************

6.12 What are LIBEVALs?

[This answer was copied from Joe Horn's "libeval.doc" from GD #9]

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?

******************************************************************

6.13 What are some useful LIBEVALs? (GX)

Function                                                 GX
-----------------------------------------------------+----------
                                                     |
Creates an XLIB name from two bints                  |  #7E50h
Displays message box with grob                       | #B1000h
CMD  last command window                             | #B2000h
CHARS application                                    | #B2001h
MODES application input form                         | #B41C1h
flag browser  (returns t/f to level 1, just drop it) | #B41CFh
MEMORY application  (aka variable browser)           | #B41D7h
SOLVE application choose box                         | #B4000h
solve equation input form                            | #B4001h
solve difeq input form                               | #B4017h
solve polynomial input form                          | #B402Ch
solve linear systems of equations input form         | #B4033h
solve TVM input form                                 | #B4038h
PLOT input form                                      | #B4045h
SYMBOLIC application choose box                      | #B4113h
integrate input form                                 | #B4114h
differentiate input form                             | #B4122h
Taylor polynomial expansion input form               | #B412Bh
Isolate a variable input form                        | #B412Dh
solve quadratic input form                           | #B4130h
manipulate expression input form                     | #B4131h
TIME application choose box                          | #B4137h
Set alarm input form                                 | #B4138h
Set time and date input form                         | #B415Bh
Alarm browser   (aka alarm catalog)                  | #B416Eh
STAT application choose box                          | #B4175h
single-var stat input form                           | #B4176h
frequencies input form                               | #B417Dh
fit data input form                                  | #B417Fh
summary stat input form                              | #B418Fh
I/O application choose box                           | #B4192h
Send to HP48 input form                              | #B4193h
Print input form                                     | #B4197h
Transfer input form                                  | #B41A8h
Get from HP48  (immediate)                           | #B50FFh
recalls the contents of the reserve variable Mpar    | #E4012h


******************************************************************

6.14 What is the format of a GROB object?

[NOTE: I received two very good answers to this question, and each
       cater to a different kind of user, so I will include them both.]

ANSWER A: The "easy" way:
-------------------------------------------------
First, add pixels to the right-hand edge to make the horizontal dimension a
multiple of 8, then separate the object horizontally into groups of four
pixels.  Suppose, for example, you want to make this into a 22x8 GROB:

                ---------****---------
                --------**--**--------
                -------**----**-------
                ********------********
                ********------********
                -------**----**-------
                --------**--**--------
                ---------****---------

You would break it up like this:
 
            ---- ---- -*** *--- ---- ----
            ---- ---- **-- **-- ---- ----
            ---- ---* *--- -**- ---- ----
            **** **** ---- --** **** **--
            **** **** ---- --** **** **--
            ---- ---* *--- -**- ---- ----
            ---- ---- **-- **-- ---- ----
            ---- ---- -*** *--- ---- ----

Notice, I've added two columns of pixels to make it 24x8.  Now, each group of
four can be represented by a hexadecimal digit.

        ---- 0          --*- 4          ---* 8          --** C
        *--- 1          *-*- 5          *--* 9          *-** D
        -*-- 2          -**- 6          -*-* A          -*** E
        **-- 3          ***- 7          **-* B          **** F

Now, replace each group of four pixels with its corresponding hexadecimal
digit: 00E100  003300  081600  FF0CF3  FF0CF3  081600  003300  00E100.

So, your final grob is:

GROB 22 8 00E100003300081600FF0CF3FF0CF308160000330000E100 

-------------------------------------------------

ANSWER B: The "technical" way:
-------------------------------------------------

NOTE 1: Every HP object format is described in RPLMAN.DOC, see this
        file for more info.

NOTE 2: All HP objects are (of course) nibble based.  When viewing them
        on the PC, which is byte based, the low order nib is always read
        and written first.

NOTE 3: HP objects begin with a 5 nib prolog which identifies the object
        type (and other things).  This is the prolog for a grob object..

        02B1E pr HP:DOGROB
        02B1E @  Graphic prolog (/U GROB)

NOTE 4: Every 5 nib sub field of an object, such as prolog, length, etc.,
        is read in reverse order (low nib first).  The grob prolog would
        appear E1B20, or 1E 2B x0 in a hex dump on a PC.  The least
        significant nibble of the next field begins right at the x in x0.

NOTE 5: It is customary to always work with HP objects on the PC with the
        HPHP48-E header (substitute your favorite rom version letter)
        preceding the prolog.  This gives no hassles when downloading
        via Kermit or Xmodem.


PC hex dump of a grob object.. ( remember each 5 nib field is reverse order )

1_  "HPHP48-E" 8 byte ascii string with msb off
2_  5 nib prolog, 02B1E (hex)
3_  5 nib length field, includes length of body AND length and height fields!
    does not include 5 nib prolog.  So, the total #nibs the grob object
    takes in HP memory is this number + 5.  Important!
4_  5 nib height field  ( yes, it is height then width )
5_  5 nib width field
6_  body (described below)


The grob object looking at it using command line EDIT on the HP..

GROB <width (dec)> <height (dec)> < body >
The body is exactly the same looking at it on a PC hex dump or on the
command line EDIT.  Just remember to read low nibble first for hex dump.


The grob body
-------------

Because of hardware restrictions, the number of nibs required to represent
one horizontal line must be even (byte aligned).  So, use this method
to calculate the number of nibs in one line..   (pascal example)

  nibs:= width div 4;
  if nibs mod 4 <> 0 then nibs:= nibs + 1;
  if odd(nibs) then nibs:= nibs + 1;

Then to get the #nibs in the entire body, multiply it by height.
! Remember, the length field must be this total body length + 15 !

For example, a 131 wide grob requires 34 nibs for one horizontal line,
where 5 of the bits are unused.  The first nib in the second line begins
at nib 35 for this grob, etc.
If the grob is 64 lines, then the body is 2176 nibs.
Add 5 for the prolog, 5 for the length field, 5 for height, and 5 for width.
Total object size (on the HP) is 2196 nibs, or 1098 bytes.
The length field should contain 2196 minus 5 for prolog = 2191 (0088F hex)

Note that for each nib, the right-most bit is the left-most pixel on the
screen.  This is nearly always the case for graphic memory.

******************************************************************

6.15 What is the AUR and what information does it contain?

                                  text written by
                                  Jarno Peschier
                                jpeschie@cs.ruu.nl

     In this  text I  will try  to answer  a number  of frequently  asked
     questions about the HP 48G Series Advanced  User's Reference Manual.
     In the remainder  of this text  I will use  the common  abbreviation
     AUR when referring to this book.

     The questions I will try to answer are:

          - What is the AUR?
          - What information does the AUR contain?
          - Do I need the AUR?
          - Why didn't HP supply the AUR with every HP48?
          - Where can I get the AUR?
          - Does the AUR contain any SYSEVALs and/or LIBEVALs?
          - Does the AUR say anything about SysRPL and/or ML?

     QUESTION: What is the AUR?

     ANSWER: The  AUR is  just what  it's name  tells you  it is:  it's a
     reference manual  for the  HP 48G Series.  It has  the same  outside
     appearance as the  HP 48G Series User Guide (the manual you get with
     your HP48G  or  HP48GX  when you  buy  it),  except that  it's  much
     thicker  (just under  4 cm).  The AUR  contains about  650  pages of
     useful information about your calculator.

     QUESTION: What information does the AUR contain?

     ANSWER: The  AUR  contains  information about  UserRPL  programming,
     quite  a lot  of programming examples, a  complete command reference
     for all  the (UserRPL)  commands the  G Series  knows and  reference
     lists about  all equations, error  and status  messages, units, etc.
     Of course it has an extensive index at the back of the book.

     Chapter 1: Programming

     Contains:  Understanding Programming,  Entering and  Executing  Pro-
     grams, Viewing  and Editing  Programs, Creating Programs  on a  Com-
     puter, Using  Local Variables,  Using Tests  and Conditional  Struc-
     tures,  Using  Loop  Structures,  Using  Flags,  Using  Subroutines,
     Single-Stepping  through a Program, Trapping Errors, Input, Stopping
     a Program for Keystroke  Input, Output, Using  Menus with  Programs,
     Turning Off the HP 48 from a Program.

     Chapter 2: Programming Examples

     Contains: Fibonacci Numbers, Displaying a Binary  Integer, Median of
     Statistics Data,  Expanding and  Collecting Completely,  Minimum and
     Maximum Array Elements,  Applying a Program  to an Array, Converting
     Between   Number  Bases,  Verifying  Program  Arguments,  Converting
     Procedures from  Algebraic to  RPN, Bessel  Functions, Animation  of
     Successive Taylor's Polynomials,  Programmatic Use of Statistics and
     Plotting,  Trace Mode, Inverse-Function  Solver, Animating a Graphi-
     cal Image.

     Chapter 3: Command Reference

     This  chapter  contains  one  entry for  every  command  (except for
     RULES) from ABS  to ZVOL and  + to  ->. Each entry  contains: a  de-
     scription of  what the command does  (with stack  diagrams), ways in
     which you  can access it from  the keyboard (with  submenu you need,
     or  if you  can only  type  it in  in  Alpha-mode), which  flags the
     command is  affected by,  remarks and  a list  of related  commands.
     Often a command  has one or more example  programs too. This chapter
     is the bulk of the whole book; it's 424 pages thick.

     Chapter 4: Equation Reference

     This chapter contains  one entry for  every section in the  built in
     Equation  Library (EQLIB).  Each  entry  contains: a  table  of used
     variables  and then for  every set of  equations an  entry with some
     more info about the equation  set, the picture that goes with it (if
     any),  all the equations and one or more sets of example numbers and
     solutions. The  end of  the chapter  has a  list of references  from
     which all the equations were taken.

     Appendix A: Error and Status Messages

     This chapter  contains two  tables with  all possible  messages. The
     first has  them sorted  alphabetically and  shows  the message,  the
     meaning and the  ERRN number in hex. The  second has them  sorted on
     ERRN number (and thus on category)  and only contains the number  in
     hex and the message itself.

     Appendix B: Table of Units

     This  chapter contains  a  table with  all  units the  HP 48G Series
     knows. It contains  the unit (both the name  you use on the calcula-
     tor  as well  as the full  name) and  the value it  represents in SI
     units.

     Appendix C: System Flags

     This  chapter contains  a table  with all  the system  flags  of the
     HP 48G Series. The table  contains the number followed by a descrip-
     tion of it's use  and the results you  get when the flag  is set  or
     clear.

     Appendix D: Reserved Variables

     This  chapter contains  a table with  all the  reserved variables of
     the  HP 48G Series  (ALRMDAT,  CST,  "der"-names, EQ,  EXPR,  IOPAR,
     MHpar, Mpar,  n1/n2/...,  Nmines,  PPAR,  PRTPAR,  s1/s2/...,  VPAR,
     ZPAR, SigmaDAT  and SigmaPAR) with  complete information about  what
     they are used for and  about all possible parameters that can be put
     into them.

     Appendix E: New Commands

     This chapter  lists all  the commands  that are  new  to the  HP 48G
     Series, with  a brief description  of what the  commands do. A  list
     like this can be found elsewhere in the HP48 FAQ list as well.

     Appendix F: Technical Reference

     Contains:  Object sizes,  Mathematical simplification  rules used by
     the HP 48, Symbolic differentiation patterns used by  the HP 48, The
     EquationWriter's expansion  rules,  References used  as sources  for
     constants and  equations  in the  HP 48  (other  than those  in  the
     Equation Library).

     Appendix G: Parallel Processing with Lists

     This  chapter  contains  info  on  parallel  processing  that  makes
     UserRPL look even more like a  real functional programming  language
     by letting  (almost) all the commands  function on  lists of parame-
     ters as  well (i.e.  adding map  capabilities to  all internal  com-
     mands).

     QUESTION: Do I need the AUR?

     ANSWER:  Yes, you  do. I  my  humble opinion  the  AUR is  just "The
     Manual,  Part II" and *every* owner of a HP48G or HP48GX should have
     it, especially if  you are (going to be)  programming in UserRPL for
     any reason. A lot  of the frequently asked questions that pop  up on
     comp.sys.hp48 are simply questions  that are meant to be answered by
     the AUR.

     QUESTION: Why didn't HP supply the AUR with every HP48?

     ANSWER: Since you're reading this FAQ,  you're probably gifted:  you
     are  not an average HP48  user. The set of  "average users" probably
     consists mostly  of people that simply  never program  their HP48 in
     any way  ("Wow, can  it do  that too?!").  In this  case, they  will
     never take one look at the AUR ever  again, and since this is  quite
     a thick book  it would be a waste  of money, trees, the environment,
     transportation  costs, etc. to supply the AUR  in every box. This is
     probably why  HP made it  an extra accessory  for those people  that
     "really need" it. I think...

     QUESTION: Where can I get the AUR?

     ANSWER:  You should be able to buy (or order)  it from the same shop
     where you  purchased your calculator. The  HP part  number is 00048-
     90136.  The book does  not seem to  have an  ISBN number; it's  a HP
     part, not a book.. <grin>

     QUESTION: Does the AUR contain any SYSEVALs and/or LIBEVALs?

     ANSWER: Yes,  it contains exactly one.  The example  for the SYSEVAL
     command tells  you that  #30794h SYSEVAL  gives you  the version  of
     your HP48. My HP48GX rev. P gives "HPHP48-P".

     QUESTION: Does the AUR say anything about SysRPL and/or ML?

     ANSWER: No, it doesn't.

******************************************************************

6.16 What is the syntax for the INFORM, CHOOSE, and MSGBOX commands
         on the G/GX?

Based on a posting on HPCVBBS by Cary McCallister (sysop).
Revised by Joe Horn.

                                  +--------+
                                  | INFORM |
                                  +--------+

                          Create a Custom Input Form

INPUT:

5: "title"
4: { fields }
3: <format>
2: { reset_values }
1: { initial_values }

OUTPUT:

Either: 2: { new_values }
        1: 1

or:     1: 0

PURPOSE:

INFORM creates full-screen custom input forms, similar to those of the
built-in applications.

ARGUMENTS:

"title"
is displayed in font 1 (small) at the top center of the screen.  It
may contain any number of characters, including 0, but, at most, 31
characters will be displayed. Strings longer than 31 character will be
truncated to 30 characters and displayed with a trailing ellipsis.
Line feed characters are displayed as boxes.

{ fields }
is a list of the form { field1 field2 ... fieldn } where each field is
any one of these forms:

     1.    "label"
     2.    { "label" "help" }
     3.    { "label" "help" type1 type2 ... typen }
     4.    { }

The "label" is a string of arbitrary text from 0 to 26 characters long
(longer strings will be truncated to 25 characters with a trailing
ellipsis).  The "help" is displayed immediately above the menu area as
a helpful prompt for the user.  The object type specifications list
the one or more object types allowed in the field, in the form the
TYPE command returns.  If unspecified, the default help text is blank
and the field will accept all object types.  If a field specification
is an empty list, no field is produced; instead, the field to the
immediate left (if any) is expanded to fill the omitted field's space.
This allows further customization of form layout; for example, to have
two fields in one row and three fields in the next.

<format>
may be any one of the following objects:

     1.    { }
     2.    columns
     3.    { columns }
     4.    { columns widths }

<columns> is the number of columns that the display will be divided
into. E.g., if <columns> is 2 and there are two fields, they will be
displayed side by side rather than one above the other.  <widths> is
the tab width between the left edge of each title and its field; this
makes vertical allignment of fields possible.  Titles longer than one
tab width will cause the tab to be repeated automatically.  If
unspecified, the default column count is one and the default tab stop
width is three.

{ reset_values }
is a list of values one per input field which replace the values of
all fields when the {RESET} key is pressed and "Reset all" is
selected.  This list must either be empty or have exactly one item per
field corresponding to the { fields } list above.  If empty, then all
fields are deemed unspecified (i.e., blank).  Each reset value must
match the type require by the form field. Selected fields may be
marked as unspecified by using NOVAL as the reset value.

{ initial_values }
is a list of values one per input field which specify the start-up
values of all fields when the INFORM command is invoked. This list
must either be empty or have exactly one item per field corresponding
to the { fields } list above.  If empty, then all fields are deemed
unspecified (i.e., blank).  Each initial value must match the type
require by the form field.  Selected fields may be marked as
unspecified by using NOVAL as the initial value.

RESULTS:

INFORM returns the new field values { new_values } as a list to level
2 and the real value 1 to level 1 if the user completes the input form
by pressing {OK} or [ENTER].  The list will contain one item per
field.  Each item will either be the last input value for the
corresponding field, or NOVAL if the field was unspecified.

INFORM returns the real value 0 to level 1 if the user terminates the
input form by pressing {CANCL} or [CANCEL].

REMARKS:

NOVAL is basically a command (an XLIB name) that does nothing when
evaluated. It can, however, be compared via ==, SAME and POS.

                              +--------+
                              | CHOOSE |
                              +--------+

                   Create a User-Defined Choose-Box

INPUT:

3: "title"
2: { items }
1: <initial_item_number>

OUTPUT:

Either: 2: { chosen_item }
        1: 1

or:     1: 0

PURPOSE:

CHOOSE creates a user-defined "choose-box": a displayed box containing
items from which the user can choose one.

CHOOSE displays a standard choose box (normal, not maximized;
single-pick, not multi-pick) with an optional title line.

ARGUMENTS:

"title"
if any, is displayed in font 1 (small) in the top center of the
box.  It may contain any number of characters, including 0, but, at
most, 22 characters will be displayed. Strings longer than 22
character will be truncated to 21 characters and displayed with a
trailing ellipsis.  Line feed characters are displayed as boxes.  If
there are more than four items such that the scroll arrows are
displayed, the maximum number of title characters is reduced to 21.
The title text is displayed in the title area in character font 1 (the
menu font).  If the title string is empty, no title area will be
created in the choose box, and the whole box will be devoted to the
items.

{ items }
is a list of arbitrary objects.  Each item occupies one line in the
choose box and is displayed in its command line form.  Only the first
14 characters of the displayed object will be shown (13 if the scroll
arrows are present).  If an item contains more than 14 (13)
characters, it will be truncated to 13 (12) and the final character
will be replaced by an ellipsis.  If every item is a list of exactly
two objects, the first object will be displayed and the second
returned if the item is selected.  If the number of items exceeds 4
with a title and 5 without, scroll arrows will be displayed, and
moving the highlight past the top or bottom of the box will scroll
through the undisplayed items.

<initial_item_number>
specifies the initial field to be highlighted when the display first
comes up (ordinarily 1).  A value of 0 indicates that no field is to
be highlighted and that the {CANCL} key is to be omitted from the
menu, making the choose box act as an informational display without
user selection.

RESULTS:

CHOOSE returns the chosen item (or the second object in a two-element
item list) and the real number 1 if the user completes the choose box
by pressing {OK} or [ENTER].  CHOOSE returns the real number 0 if the
user terminates the choose box by pressing {CANCL} or [CANCEL].

                              +--------+
                              | MSGBOX |
                              +--------+

                     Create a simple Message Box

INPUT:

1: "Message_string"

OUTPUT:

None

PURPOSE:

MSGBOX creates a simple pop-up message box over the current display,
with a 3D shadow to make it easy to recognize, and containing any
arbitrary text.

ARGUMENTS:

"Message_string"
is any string of characters.  The text is displayed in font 2 (medium
size), left justified, with a maximum line length of 15 characters.
Longer lines are broken into multiple lines automatically, at word
breaks when possible, up to a maximum of 5 lines.  Line feeds may be
included to force line breaks.  The minimum number of lines is 2, so
single-line messages will have a blank line at the bottom of the box.

RESULTS:

None.  MSGBOX is exited when the user presses CANCEL, ENTER, or OK,
but nothing is returned to the stack.                         

-------------------------------------------------------------------
Here are some examples from Jarno Peschier:

Some examples of INFORM, CHOOSE and MSGBOX on the HP48GX. Just
download the entire directory to your calculator and try the programs,
change them, modify them and do everything else with them you can
think of. ;-)

SIMPLE:
This program will demonstrate a simple INFORM input screen with 3 fields
(one without type restrictions, one for real or complex numbers and one
for strings) with some additional layout. MSGBOX and CHOOSE (with the
third parameter equal 0) are used to show what the results of the INFORM
command are. The list the INFORM command returns is left on stack so
you can see what it looks like.

ANGLE:
This program will demonstrate the use of CHOOSE. It lets you choose
between the three possible angle modes (DEG, RAD, GRAD) and when you
choose one of them, the corresponding mode is set by evaluating a tiny
program containing the right command.

ISOLATE:
This program will demonstrate the use of INFORM in ways that it is used
in the calculator itself. It is a very simple shell around the ISOL
command (isolation of a variable from an algabraic). It remembers it's
settings in a variable called IPAR and the next time the program is
run this will be the default values of the INFORM command, so you can
isolate for a different variable using the same algabraic you used
before, without retyping it. MSGBOX is used for error messages.

TYPELIST:
This program will again demonstrate the use of CHOOSE. It extracts the
names of all the internal types of the HP48GX from ROM and shows them in
a CHOOSE-box (alphabetically sorted by name). If you choose one of them,
its TYPE number is shown in a MSGBOX.

MATHQUIZ:
This final program will demonstrate the use of INFORM with variable
field descriptions and default/reset values. It's will show you 8 fields
that are simple math questions for you to solve (addition and subtraction).
You can enter all the results and then you will see if your answers were
correct (in a MSGBOX). You must fill all the fields. Hint: you can cheat
by resetting a field (or all fields). ;-)

=== CUT HERE ===
%%HP: T(3)A(D)F(.);
DIR
  SIMPLE
    \<<
      IF
"AN EXAMPLE OF INFORM"
{ { } { } { } {
"OBJECT:"
"ALL OBJECTS ARE ALLOWED HERE"
} { } { "NUM:"
"ENTER A (COMPLEX) NUMBER"
0 1 } { "NAME:"
"ENTER YOUR FULL NAME"
2 } { } { } } { 3 1
} {
        \<< 440 1
BEEP
        \>> (0,1)
"JARNO PESCHIER" }
{ NOVAL 0 "N.N." }
INFORM
      THEN DUP
"YOU ENTERED:" SWAP
0 CHOOSE DROP
"The list that INFORM produced is still on the stack."
      ELSE
"You cancelled the INFORM."
      END MSGBOX
    \>>
  ANGLE
    \<<
      IF
"ANGLE MEASURE" { {
"Degrees" DEG } {
"Radians" RAD } {
"Grads" GRAD } } 1
CHOOSE
      THEN EVAL
      END
    \>>
  ISOLATE
    \<<
      IF
"A VERY SIMPLE VARIABLE ISOLATOR"
{ { } { "EXPR:"
"ENTER THE EXPRESSION"
9 } { "VARIABLE:"
"ENTER VARIABLE TO ISOLATE"
6 } } { } { }
        IF 'IPAR'
VTYPE 5 \=/
        THEN { }
        ELSE 'IPAR'
RCL
        END INFORM
      THEN DUP
'IPAR' STO
        IF DUP
NOVAL POS
        THEN DROP
"You must enter an expression and a variable!"
MSGBOX
        ELSE OBJ\->
DROP
          IFERR
ISOL
          THEN
DROP2 "Error: "
ERRM + MSGBOX
          END
        END
      END
    \>>
  TYPELIST
    \<<
      IF
"ALL HP48 TYPES (IN ROM)"
0 27
        FOR msg
          IFERR msg
263 + DOERR
          THEN ERRM
          END msg 2
\->LIST
        NEXT 28
\->LIST SORT 1 CHOOSE
      THEN
"That one has type number "
SWAP + "." + MSGBOX
      END
    \>>
  MATHQUIZ
    \<<
      IF
"A SIMPLE MATH QUIZ"
1 8
        FOR i "'"
RAND 100 * IP +
          IF RAND
75 <
          THEN "+"
          ELSE "-"
          END +
RAND 100 * IP + "'"
+ "ENTER RESULT #"
i + 0 3 \->LIST
        NEXT 8
\->LIST DUP
        \<< \-> X
          \<< X HEAD
2 OVER SIZE 1 - SUB
"=" + X 1 ROT PUT
          \>>
        \>> DOLIST
SWAP
        \<< \-> X
          \<< X HEAD
OBJ\-> EVAL
          \>>
        \>> DOLIST 3
ROLLD { 2 5 } 4
PICK { } INFORM
      THEN
        IF DUP
NOVAL POS
        THEN DROP2
"You didn't fill all the blanks."
        ELSE
          IF SAME
          THEN
"All answers were correct!"
          ELSE
"Not all answers were correct."
          END
        END MSGBOX
      ELSE DROP
      END
    \>>
END
=== CUT HERE ===

******************************************************************


END PART 2 OF 4

            



--
Keith Maddock--madd0118@nova.gmi.edu--HomePage:http://www.gmi.edu/~madd0118
"Of course I'm crazy, but that doesn't mean I'm wrong. I'm mad but not ill"
GMI Engineering & Mgt Inst: So2,ME-Auto, Flint, MI/Freightliner Corp,PDX,OR
comp.sys.hp48 FAQ Maintainer (GX-R), Eagle Scout, Delta Tau Delta EI-B, :-)

The entire AOH site is optimized to look best in Firefox® 3 on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986- AOH
We do not send spam. If you have received spam bearing an artofhacking.com email address, please forward it with full headers to abuse@artofhacking.com.