home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / hp / hp48-faq / part3 < prev    next >
Encoding:
Internet Message Format  |  1999-05-17  |  95.4 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!news.kodak.com!news-nysernet-16.sprintlink.net!news-east1.sprintlink.net!news-peer1.sprintlink.net!news-in-east1.sprintlink.net!news.sprintlink.net!news1.bellglobal.com!torn!cyclone.bc.net!news.UVic.CA!aschoorl
  2. From: aschoorl@engr.uvic.ca (Andre Schoorl)
  3. Newsgroups: comp.sys.hp48,comp.sources.hp48,comp.answers,news.answers
  4. Subject: comp.sys.hp48 FAQ : 3 of 4 - Appendices
  5. Followup-To: comp.sys.hp48
  6. Date: 16 May 1999 22:00:03 GMT
  7. Organization: University of Victoria, Victoria, BC, Canada
  8. Lines: 2451
  9. Approved: news-answers-request@MIT.EDU
  10. Expires: 13 June 1999 22:00:03 GMT
  11. Message-ID: <HP48_FAQ_v459_p3_5_16_1999@uvaix3e1.comp.UVic.CA>
  12. Reply-To: aschoorl@engr.uvic.ca
  13. NNTP-Posting-Host: cognac.uvic.ca
  14. X-Trace: uvaix7e1.comp.UVic.CA 926888485 192296 142.104.113.129 (16 May 1999 21:01:25 GMT)
  15. X-Complaints-To: abuse@UVic.CA
  16. NNTP-Posting-Date: 16 May 1999 21:01:25 GMT
  17. Summary: Answers to Frequently Asked Questions about HP48 calculators
  18. Keywords: FAQ, HP48
  19. X-Url: http://www.engr.uvic.ca/~aschoorl/faq/
  20. User-Agent: slrn/0.9.5.4 (UNIX)
  21. Xref: senator-bedfellow.mit.edu comp.sys.hp48:90217 comp.sources.hp48:727 comp.answers:36187 news.answers:158059
  22.  
  23. Archive-name: hp/hp48-faq/part3
  24. Last-modified: 5/16/1999
  25. Version: 4.59
  26. Posting-Frequency: Every 14 days or so
  27.  
  28. -----BEGIN PGP SIGNED MESSAGE-----
  29. Hash: SHA1
  30.  
  31. post72
  32.   9.1.  ASC Functions
  33.  
  34.   Note: Although this document mentions SX only, ASC\-> and \->ASC work
  35.   on both the SX and GX.
  36.  
  37.   From: Bill Wickes
  38.  
  39.   ASCII Encoding HP48 SX Objects
  40.  
  41.   Sending an HP48 SX object via electronic mail can be difficult if the
  42.   object does not have an ASCII form, such as is the case for library
  43.   objects.  There are various encoding schemes available on different
  44.   computer systems, but these require that the sender and receiver have
  45.   similar computers, or at least compatible encode/decode schemes.  The
  46.   programs listed below perform the encoding and decoding on the HP48 SX
  47.   itself, which has the advantage of being completely independent of any
  48.   computer.
  49.  
  50.   The programs are nominally called \->ASC and ASC\->.  The former takes
  51.   an object from the stack and converts it to a string, in which each
  52.   nibble of the object and its checksum is converted to a character 0-9
  53.   or A-F.  (The object must be in RAM, otherwise a "ROM Object" error is
  54.   returned.)  For sake of easy inclusion in e-mail letters, the string
  55.   is broken up by linefeed characters after every 64 characters.
  56.  
  57.   ASC\-> is the inverse of \->ASC: it takes a string created by \->ASC
  58.   and converts it back into an object.  When you transmit the encoded
  59.   strings, be sure not to change the string; ASC\-> uses the checksum
  60.   encoded in the string to verify that the decoding is correct.  An
  61.   "Invalid String" error is returned if the result object does not match
  62.   the original object encoded by \->ASC.  When you upload a string to
  63.   your computer, use HP48 translate mode 3 so that the HP48 will convert
  64.   any CR/LF's back to LF's when the string is later downloaded.
  65.  
  66.   Two versions of ASC\-> are included here.  The first (P1) is in HP48
  67.   user language, using SYSEVALs to execute system objects.  P2 is a
  68.   string that the setup program uses P1 to decode into an executable
  69.   ASC\-> - then P1 is discarded.  The second version is more compact
  70.   than the first, and also uneditable and therefore safer (but it can't
  71.   be transmitted in ASCII form, which helps to make the point of this
  72.   exercise).
  73.  
  74.   Here are the programs, contained in a directory (if you have problems
  75.   with this and you are using the HTML version of the FAQ, you may wish
  76.   to try the plain text version or download a binary copy of the
  77.   program):
  78.  
  79.  
  80.   %%HP: T(3)A(D)F(.);
  81.   DIR
  82.   P1              @ ASC\-> Version 1.
  83.   \<<
  84.     IF DUP TYPE 2 \=/
  85.     THEN "Not A String" DOERR
  86.     END RCWS \-> ws
  87.     \<< 16 STWS
  88.       #0 NEWOB SWAP DUP SIZE
  89.       IF DUP 4 <
  90.       THEN DROP SWAP DROP "Invalid String" DOERR
  91.       END
  92.       DUP 65 / IP - 4 - # 18CEAh SYSEVAL
  93.       "" OVER # 61C1Ch SYSEVAL
  94.       SWAP # 6641F8000AF02DCCh
  95.       # 130480679BF8CC0h # 518Ah SYSEVAL
  96.       # 19610313418D7EA4h # 518Ah SYSEVAL
  97.       # 7134147114103123h # 518Ah SYSEVAL
  98.       # 5F6A971131607414h # 518Ah SYSEVAL
  99.       # 12EA1717EA3F130Ch # 518Ah SYSEVAL
  100.       # 280826B3012808F4h # 518Ah SYSEVAL
  101.       # 6B7028080BEE9091h # 518Ah SYSEVAL
  102.       # BE5DC1710610C512h # 518Ah SYSEVAL
  103.       # 705D00003431A078h # 518Ah SYSEVAL
  104.       # 3D8FA26058961431h # 518Ah SYSEVAL
  105.       # 312B0514h # 518Ah SYSEVAL
  106.       # 18F23h SYSEVAL
  107.       DUP BYTES DROP 4 ROLL
  108.       IF ==
  109.       THEN SWAP DROP
  110.       ELSE DROP "Invalid String" DOERR
  111.       END ws STWS
  112.     \>>
  113.   \>>
  114.  
  115.   P2      @ ASC\->  Version 2.  To be converted by ASC\-> version 1.
  116.  
  117.   "D9D20D29512BF81D0040D9D20E4A209000000007566074726636508813011920
  118.   140007FE30B9F060ED3071040CA1304EC3039916D9D2085230B9F06C2A201200
  119.   094E66716C696460235472796E676933A1B21300ED30FD5502C230C1C1632230
  120.   CCD20FA0008F14660CC8FB97608403104AE7D814313016913213014117414317
  121.   414706131179A6F5C031F3AE7171AE214F8082103B6280821909EEB0808207B6
  122.   215C0160171CD5EB870A13430000D50713416985062AF8D341508813044950B9
  123.   F06BBF06EFC36B9F0644230C2A201200094E66716C696460235472796E676933
  124.   A1B2130B21300373"
  125.  
  126.   P3      @\->ASC.     To be converted by ASC\->.
  127.   "D9D20D2951881304495032230FD5502C230A752688130ADB467FE30322306AC3
  128.   0CB916E0E30CBD30F6E30C1C1632230CCD20DC0008F14660CC8FB97608403104
  129.   AE7D8143130169174147061741431311534AC6B4415141534946908D9B026155
  130.   4A6F53131F3AE731A014C161AE215F08082103A6280821939EEC08082170A621
  131.   4C161170CD56B870A18503430000D5071351796A9F8D2D02639916D9D2085230
  132.   C2A209100025F4D402F426A6563647933A1B2130A2116B213033C0"
  133.  
  134.   SETUP   @Automatic setup program
  135.   \<< P2 P1 'ASC\->' STO
  136.       P3 ASC\-> '\->ASC' STO
  137.       { P1 P2 P3 SETUP } PURGE
  138.   \>>
  139.  
  140.   END
  141.  
  142.  
  143.   Installation instructions:
  144.  
  145.   1. Save the above text into a text file named CONV (for example).  Be
  146.      sure that you leave the strings exactly as entered above, with no
  147.      extra spaces or other invisible characters at the beginnings or
  148.      ends of the lines.
  149.  
  150.   2. Set the HP48 SX into ASCII transfer mode.
  151.  
  152.   3. Using Kermit, download CONV text file to the 48, verify its
  153.      checksum (6C8Ah).
  154.  
  155.   4. Execute CONV to make it the current directory.
  156.  
  157.   5. Execute SETUP.
  158.  
  159.   6. The directory CONV now contains ASC\-> and \->ASC, ready to use.
  160.  
  161.   To archive the decoded versions of ASC\-> and \->ASC back on your
  162.   computer, be sure to set the HP48 SX in binary transfer mode before
  163.   uploading.
  164.  
  165.   Disclaimers:
  166.  
  167.   o  Use the programs at your own risk.  Any time you delve into the
  168.      SYSEVAL world, there are increased dangers.  Archive your 48 memory
  169.      before experimenting with these programs!  Also, verify the
  170.      checksums of objects defined above to make sure they have been
  171.      downloaded correctly, before executing ASC\->.
  172.  
  173.   o  I will not answer questions about how the programs work.  This is
  174.      not because of any great secrecy, but rather because it's hard to
  175.      give any answer that doesn't lead to more questions, and more, and
  176.      more...
  177.  
  178.   o  48 hackers are welcome to mine any nuggets they can from the
  179.      programs, and from the fact that \->ASC is a convenient way to
  180.      decompile an object.
  181.  
  182.  
  183.   9.2.  OBJFIX
  184.  
  185.   When a binary object received by Kermit on the HP-48 is left as a
  186.   string beginning with HPHP48, OBJFIX will extract the HP-48 object if
  187.   the only problem is that extra bytes got appended to the end.
  188.  
  189.   OBJFIX takes a variable name in stack level 1 and modifies the
  190.   contents of the variable if no other problems are detected.
  191.  
  192.   Note: This is like FIXIT by Horn and Heiskanen on Goodies Disk 8, but
  193.   this one is by HP and so I suppose it's more reliable.  Although it
  194.   fails the test cases included with FIXIT, that may be because they
  195.   were artificially contrived cases.  Try both on real-world downloads
  196.   that need fixing.  Which do you like better?
  197.  
  198.   OBJFIX.ASC
  199.  
  200.  
  201.        %%HP: T(3)A(D)F(.);
  202.        "D9D202BA81D9F81B2040D9D20F2A26DA91629C8145126489162C23072C80CCD2
  203.        0BD0008FB9760147108134164142C2818F24D534501008B2F41643150D73B840
  204.        58405438314A161966D2BF6BF6A6F5BE16314213114334CF8208A6F58F235A04
  205.        55136D7D4EA494D231A1CA101110131CA130DBE284F8FC0760D41198F29960D4
  206.        130142119EA1408F5E0108D341503223072D70B2130B21301460"
  207.  
  208.  
  209.   9.3.  FIXIT
  210.  
  211.   From: Joe Horn and Mika Heiskanen
  212.  
  213.  
  214.      PURPOSE:
  215.         Converts a badly uploaded string into the original object.
  216.  
  217.      THEORY:
  218.         A lot of folks upload HP48 objects poorly, such that when you
  219.         download them, you just get strings full of garbage that look
  220.         something like this:
  221.  
  222.  
  223.           "HPHP48-E#c&r$a%p@!*!..."     [looks familiar, eh?]
  224.  
  225.  
  226.      That's because they uploaded it using XMODEM, or managed to screw
  227.      it up some other way.  The following FIXIT program takes such a
  228.      string and extracts the actual HP48 object that they originally
  229.      intended to upload (if at all possible).
  230.  
  231.      Such object extraction can be done by hand, but it's too dangerous.
  232.      FIXIT minimizes the danger of Memory Clear.  It checks whether the
  233.      extracted object is a valid one, and if not, drops it from the
  234.      stack before the HP48 attempts to display it.  All of the many bad
  235.      downloads I've archived over the years are fixed by FIXIT, whereas
  236.      about half of them cause a Memory Clear when extracted manually.
  237.      No guarantees, however.  Use at your own risk.
  238.  
  239.      The actual extraction is done by a "Code object" written by Mika
  240.      Heiskanen.  The User RPL "shell" around this code object is what
  241.      minimizes the danger of Memory Clear; it was written by Joe Horn.
  242.  
  243.      INSTRUCTIONS:
  244.         BACKUP YOUR MEMORY, just in case the string contains a logic
  245.         bomb.
  246.  
  247.         Place the bad download on the stack (see "HPHP48-...") and run
  248.         FIXIT.
  249.  
  250.         Possible results:
  251.  
  252.      o  No error: the object was extracted successfully and is on level
  253.         1.
  254.  
  255.      o  "Bad Argument Type" error: you didn't have a string on level 1.
  256.  
  257.      o  "Bad Argument Value" error: the string wasn't of the proper
  258.         form; it must be an "HPHP48-..." downloaded string.
  259.  
  260.      o  "Invalid Definition" error: the object was mangled in
  261.         transmission so badly that its end was lost; the object cannot
  262.         be extracted.
  263.  
  264.      o  "Undefined Result" error: there is no HP48 object in the string.
  265.  
  266.      o  "Recover Memory? YES/NO": the string contained a bomb, and FIXIT
  267.         detonated it.  Press YES to sift through the shrapnel and rubble
  268.         in a feeble attempt to resurrect the dead.  Press NO to bury
  269.         them.
  270.  
  271.      EXAMPLES:
  272.         To do the following examples, download the FIXIT directory to
  273.         your HP48 and get into it.
  274.  
  275.      o  Press HI.  See "HPHP48-E...", a badly uploaded download.  Before
  276.         pressing FIXIT to fix it, try doing what we all used to do:
  277.         press EDIT to see if we can recognize anything (usually a futile
  278.         attempt).  We see:
  279.  
  280.         "HPHP48-E...  << Melancholy Baby >>"
  281.  
  282.         But looks can be deceiving; press ON to exit the editor, and
  283.         then press FIXIT to extract the intended upload:
  284.  
  285.         << Happy Camper >>
  286.  
  287.      o  Press WTAV; see another garbage download.  But EDIT refuses; the
  288.         string contains null characters.  Press FIXIT; see successfully
  289.         extracted directory.
  290.  
  291.      o  Press BAD1.  Notice that it looks exactly like WTAV.  (Press
  292.         WTAV, compare, then DROP).  But its ending is all messed up;
  293.         manually extracting WTAV from BAD1 can cause Memory Clear.
  294.         Press FIXIT and see "Error: Invalid Definition" indicating that
  295.         the object inside BAD1 is so mangled that its end cannot be
  296.         located.
  297.  
  298.      o  Press BAD2.  Looks like WTAV again.  But its body is messed up;
  299.         manually extracting it would create an External object that
  300.         could cause Memory Clear if evaluated.  Press FIXIT and see
  301.         "Error: Undefined Result" indicating that there is nothing
  302.         recognizable inside BAD2.
  303.  
  304.   FIXIT.ASC
  305.  
  306.  
  307.        %%HP: T(3)A(D)F(.);
  308.        "69A20FF7CE20000000402414442340C2A203B000840584054383D25403A20FF7
  309.        2500000000403535947440D9D20E16329C2A2DBBF13013216DF1406A1C42328D
  310.        BF193632B213034000407545146540D9D20E163292CF1EFFB1DBBF1EBFB150FA
  311.        193632B2130003030303034C000402414441340C2A203B000840584054383D25
  312.        469A20FF72500000000403535947440D9D20E16329C2A2DBBF13013216DF1406
  313.        A1C42328DBF193632B213034000407545146540D9D20E163292CF1EFFB1DBBF1
  314.        EBFB150FA193632B2131313131313134C000407545146540C2A203B000840584
  315.        054383D25469A20FF72500000000403535947440D9D20E16329C2A2DBBF13013
  316.        216DF1406A1C42328DBF193632B213034000407545146540D9D20E163292CF1E
  317.        FFB1DBBF1EBFB150FA193632B2130003030303034C00020849420C2A20570008
  318.        40584054383D254D9D20E163284E2050841607079784E20603416D6075627936
  319.        32B2130A0BA02D456C616E63686F6C697022416269702BB28000506494859445
  320.        50D9D20E16323CE2278BF168BC1ED2A2167E1AFE22D9D203CE2278BF19C2A274
  321.        3A2C58C1C2A2031000840584054383D2167E1AFE22D9D2078BF18B9C1DBBF1AA
  322.        F028DBF1CCD201200014713717917F137145142164808C5BF22D9D2033920200
  323.        0000000005150933A1B21305DF22B21305BF22D9D20339202000000000004150
  324.        933A1B21305DF223CE2278BF168BC1D8DC1167E1AFE22D9D203FBF1339202000
  325.        000000002770933A1B21305DF223CE2278BF19D1A1DBBF18DBF1E0CF1D5CE1AF
  326.        E22D9D208DBF1339202000000000000030933A1B21305DF22CB2A193632B2130
  327.        B21303D4F"
  328.  
  329.  
  330.   9.4.  LASTX
  331.  
  332.   The LASTX function is useful in calculations where a number occurs
  333.   more than once.  By recovering a number using LASTX, you do not have
  334.   to key that number into the calculator again.  Note however that LASTX
  335.   uses the built in last argument feature, so if you use LASTX you will
  336.   lose the contents of your LASTARG.
  337.  
  338.   For example, calculate:
  339.  
  340.  
  341.         96.704 + 52.394706
  342.        --------------------
  343.              52.394706
  344.  
  345.        Keystrokes:                     Stack:
  346.        -----------------              --------------------
  347.        96.704 ENTER                    96.704
  348.  
  349.        52.304706 +                     149.098706
  350.  
  351.        LASTX                           149.098706
  352.                                        52.304706
  353.  
  354.        /                               2.84568265351
  355.  
  356.        @ This is a version of LASTX for the HP48
  357.        @
  358.        %%HP: T(3)A(D)F(.);
  359.        \<< DEPTH \-> n
  360.          \<< LASTARG DEPTH n
  361.        - DUP \-> s
  362.            \<< ROLLD s 1 -
  363.        DROPN
  364.            \>>
  365.          \>>
  366.        \>>
  367.  
  368.  
  369.   9.5.  Compact Data Storage
  370.  
  371.   From: Jim Donnelly
  372.  
  373.   A simple length-encoding technique can be put to use for a free-
  374.   format, very compact multi-field data storage system.  Two tiny
  375.   programs, SUBNUM and STRCON are here to help the process, and are
  376.   listed near the end of this note.  At the end of the note is a
  377.   directory that may be downloaded into the HP48 that contains the
  378.   examples.
  379.  
  380.   The principle is to store starting indices in the beginning of a
  381.   string that point to fields stored subsequently in the string.  The
  382.   indices are stored in field order, with an additional index at the end
  383.   to accommodate the last field.  There are several small points worth
  384.   mentioning:
  385.  
  386.  
  387.   o  Fields may be 0-length using this technique.
  388.  
  389.   o  The execution time is uniform across all fields.
  390.  
  391.   o  This technique saves about 4 bytes per field after the first field,
  392.      because the string prologue and length are omitted for fields 2 ->
  393.      n.
  394.  
  395.  
  396.      EXAMPLE:
  397.  
  398.  
  399.                     Indices  |          Fields
  400.      Character               |     1 11111111 12222222222
  401.      Position :   1  2  3  4 |567890 12345678 90123456789
  402.                  +--+--+--+--+------+--------+-----------+
  403.      String :    | 5|11|19|30|Field1| Field2 |  Field 3  |
  404.                  +--+--+--+--+------+--------+-----------+
  405.  
  406.  
  407.      This is a string that contains 3 fields, and therefore 4 index
  408.      entries.  The first field begins at character 5, the second field
  409.      begins at character 11, and the third field begins at character 19.
  410.      To keep the pattern consistent, notice that the index for field 4
  411.      is 30, which is one more than the length of the 29 character data
  412.      string.
  413.  
  414.      To extract the second field, place the string on the stack, use
  415.      SUBNUM on character 2 to extract the starting position, use SUBNUM
  416.      on character 3 to extract the (ending position +1), subtract 1 from
  417.      the (ending position+1), then do a SUB to get the field data.
  418.      NOTE: The index for field 1 is stored as char. data 5, NOT the
  419.      string "5"!  To place the field index for field 1 in the string,
  420.      you would execute "data" 1 5 CHR REPL.
  421.  
  422.      PROGRAM:
  423.         The following program accepts an encoded data string in level 2
  424.         and a field number in level 1:
  425.  
  426.  
  427.           DECODE   "data"  field#  -->  "field"
  428.  
  429.           <<  --> f
  430.             <<
  431.               DUP f SUBNUM                ; "data" start -->
  432.               OVER f 1 + SUBNUM           ; "data" start end+1 -->
  433.               1 -                         ; "data" start end -->
  434.               SUB                         ; "field" -->
  435.             >>
  436.           >>
  437.  
  438.  
  439.      DATA ENCODING:
  440.         The following program expects a series of 'n' strings on the
  441.         stack and encodes them into a data string suitable for reading
  442.         by the first example above.
  443.  
  444.         The programs SUBNUM and STRCON are used to assemble the indices.
  445.  
  446.  
  447.      ENCODE      field n  ...  field 1   n   -->  "data"
  448.  
  449.      << DUP 2 + DUP 1 - STRCON --> n  data
  450.        <<
  451.          1 n
  452.          FOR i
  453.            data i SUBNUM OVER SIZE   ; ... field index fieldsize
  454.            + data SWAP               ; ... field "data" index'
  455.            i 1 + SWAP CHR REPL       ; ... field "data"'
  456.            SWAP + 'data' STO         ; ...
  457.          NEXT
  458.          data                        ; "data"
  459.        >>
  460.      >>
  461.  
  462.  
  463.      In this example, four strings are encoded:
  464.  
  465.  
  466.           Input:  5: "String"
  467.                   4: "Str"
  468.                   3: "STR"
  469.                   2: "STRING"
  470.                   1:         4
  471.  
  472.  
  473.      Output: "xxxxxSTRINGSTRStrString"      (23 character string) (The
  474.      first five characters have codes 6, 12, 15, 18, and 24)
  475.  
  476.      VARIATION:
  477.         The technique above has a practical limit of storing up to 254
  478.         characters of data in a string.  To overcome this, just allocate
  479.         two bytes for each field position.  The code to extract the
  480.         starting index for becomes a little more busy.  In this case,
  481.         the index is stored as two characters in hex.
  482.  
  483.  
  484.                          Indices  |          Fields
  485.           Character               | 11111 11111222 22222223333
  486.           Position :   12 34 56 78|901234 56789012 34567890123
  487.                       +--+--+--+--+------+--------+-----------+
  488.           String :    |09|0F|17|21|Field1| Field2 |  Field 3  |
  489.                       +--+--+--+--+------+--------+-----------+
  490.  
  491.  
  492.           <<  --> f
  493.             <<
  494.                DUP f 2 * 1 -           ; "data" "data" indx1 -->
  495.                SUBNUM 16 *             ; "data" 16*start_left_byte  -->
  496.                OVER f 2 * SUBNUM +     ; "data" start
  497.                OVER f 2 * 1 + SUBNUM   ; "data" start end_left_byte -->
  498.                16 * 3PICK f 1 + 2 *
  499.                SUBNUM + 1 -            ; "data" start end -->
  500.                SUB                     ; "field"  -->
  501.             >>
  502.           >>
  503.  
  504.  
  505.      TWO VERY TINY HELPFUL PROGRAMS:
  506.  
  507.  
  508.           SUBNUM          "string"  position  -->  code
  509.  
  510.           << DUP SUB NUM >>
  511.  
  512.  
  513.           STRCON          code  count  -->  "repeated string"
  514.  
  515.           << -->  code count
  516.             << "" code CHR 'code' STO
  517.                1 count START code + NEXT
  518.             >>
  519.           >>
  520.  
  521.  
  522.      Alternative Solution to the Problem:
  523.         From: Matjaz Vencelj <vencelj@fmf.uni-lj.si>
  524.  
  525.         Jim allocates two bytes for each index entry (to handle longer
  526.         strings), but on the other side obviously only uses values
  527.         00...FF for index dublets, which just doesn't make sense.  He's
  528.         at a 16*16 = 255 chars limit again!
  529.  
  530.         I have put together a working set of commands which support up
  531.         to 65K strings, using two-byte indexing.
  532.  
  533.         The encoder (Encode) is User-RPL program which calls the binary
  534.         N2C which converts the level 1 real into a 2 character string:
  535.  
  536.  
  537.           @*** Encode ***
  538.           %%HP: T(3)A(R)F(.);
  539.           \<<
  540.             IF DUP TYPE 0 = THEN 514 DOERR END
  541.             \-> N
  542.               \<<
  543.               N 1 + 2 * #18CEAh SYSEVAL #45676h SYSEVAL
  544.               1 N FOR I I 2 * 1 - OVER SIZE 1 + N2C REPL SWAP + NEXT
  545.               N 2 * 1 + OVER SIZE 1 + N2C REPL
  546.               \>>
  547.           \>>
  548.  
  549.  
  550.           @*** N2C, cksum=#8919h ***
  551.           %%HP: T(3)A(R)F(.);
  552.           "D9D202BA812BF819FF30D9D20AEC8111920001007FE3057A50C57463223057A5
  553.           0EE250B2130B21307206"
  554.  
  555.  
  556.      ASCII download them with translate code 3, then call program
  557.      'Encode' with data strings in levels 2..n+1 and a real n in level 1
  558.      indicating the number of strings.
  559.  
  560.      The string decoder (Decode), which is usually speed-critical, is
  561.      the following \->ASC encoded binary:
  562.  
  563.  
  564.           @*** Decode, cksum=#38E1h ***
  565.           %%HP: T(3)A(R)F(.);
  566.           "D9D20D8A81D9F811192013000D9D20AEC8113D26CA130F6E30CA130E0E305080
  567.           311920001002CE30CAF0650803CBD30CAF06FED30F6E30CA130E0E3050803119
  568.           20001002CE30CAF0650803CBD30E0E3033750B2130B21309534"
  569.  
  570.  
  571.      It takes a `database' string on level 2 and a real (record
  572.      position) on level 1, then comes back with the appropriate
  573.      substring (record).
  574.  
  575.  
  576.   9.6.  HP82240B Printer Codes
  577.  
  578.   From: Jarno Peschier
  579.  
  580.  
  581.      Size of physical row
  582.         One printed row is either 24 normal characters, 12 expanded
  583.         characters or 168 pixels wide.  This means that one normal
  584.         character has a width of 7 pixels. Any printed data "falling off
  585.         the row" will be truncated and ignored by the printer.
  586.  
  587.  
  588.      Reset
  589.  
  590.  
  591.           ESC 255d
  592.  
  593.  
  594.      This resets the printer to the following state: Roman8 character
  595.      set (watch out: the power-up character set is ECMA94), both
  596.      expanded and underline printing off, buffer cleared.
  597.  
  598.  
  599.      Self test
  600.  
  601.  
  602.           ESC 254d
  603.  
  604.  
  605.      This causes the printer to print a selftest pattern.  This mainly
  606.      consists of a printout of the Roman8 character set.
  607.  
  608.  
  609.      Expanded printing
  610.  
  611.  
  612.           ESC 253d
  613.  
  614.  
  615.      This turns expanded printing on.  This means that from this code on
  616.      all characters that are printed will be printed at twice the normal
  617.      character width because each column of pixels is printed twice.
  618.      Has no effect if expanded printing is already on.
  619.  
  620.  
  621.           ESC 252d
  622.  
  623.  
  624.      This turns expanded printing off.  This means that from this code
  625.      on all characters that are printed at normal character width again.
  626.      Has no effect if expanded printing is already off.
  627.  
  628.  
  629.      Underlined printing
  630.  
  631.  
  632.           ESC 251d
  633.  
  634.  
  635.      This turns underlined printing on.  This means that from this code
  636.      on all characters that are printed will be underlined because the
  637.      bottom-most pixel in each columns of pixels is now always on. Has
  638.      no effect if underlined printing is already on.
  639.  
  640.  
  641.           ESC 250d
  642.  
  643.  
  644.      This turns underlined printing off.  This means that from this code
  645.      on all characters that are printed will not be underlined anymore.
  646.      The bottom-most pixel in each columns of pixels is printed as it is
  647.      defined for the printed character.  Has no effect if underlined
  648.      printing is already off.
  649.  
  650.  
  651.      Character sets
  652.  
  653.  
  654.           ESC 249d
  655.  
  656.  
  657.      This switches the printer to use the ECMA94 character set.  This
  658.      set is 100% identical to the character set used in HP48 calcula-
  659.      tors.  This is the power up default of the printer.  Has no effect
  660.      if ECMA94 is the current character set already.
  661.  
  662.  
  663.           ESC 248d
  664.  
  665.  
  666.      This switches the printer to use the Roman8 character set.  This
  667.      set is different than the character set used in HP48 calculators in
  668.      the 128 last characters.  As far as I know this set is used by
  669.      older printers like the HP82240A and by HP28 calculators (hence the
  670.      need for the OLDPRT command in HP48 calculators if you are printing
  671.      to a HP82240A).  This character set is turned on if you reset the
  672.      printer with the reset code.  Has no effect if Roman8 is the cur-
  673.      rent character set already.
  674.  
  675.  
  676.      Graphics
  677.  
  678.  
  679.           ESC n data (with n between 1 and 247)
  680.  
  681.  
  682.      This causes the printer to print graphics specified by the speci-
  683.      fied data (one byte per pixel column).  The value n specifies the
  684.      number of bytes of data that follow the printer code that will be
  685.      interpreted as graphics data.  Any data after pixel column 168 will
  686.      be truncated and ignored.
  687.  
  688.  
  689.   10.  Appendix B: GX Specific Information
  690.  
  691.   10.1.  What's new in the HP48 G/GX?
  692.  
  693.   From: Joe Horn
  694.  
  695.  
  696.      AUTOMATIC LIST PROCESSING
  697.         Almost all commands that did not accept list(s) as their
  698.         arguments can do so now.  Here are just a few examples:
  699.  
  700.  
  701.           { 1 2 3 } SF sets flags 1, 2, and 3
  702.           { 1 2 3 } SQ  -->  { 1 4 9 }
  703.           { 2 4 } 10 /  -->  { .2 .4 }
  704.           10 { 2 4 } /  -->  { 5 2.5 }
  705.           { 10 12 } { 2 4 } /  -->  { 5 3 }
  706.           { .1 .2 .5 } ->Q  -->  { '1/10' '1/5' '1/2' }
  707.           { freq freq ...} { dur dur ... } BEEP can play a song with no
  708.             audible hiccup between tones.
  709.  
  710.  
  711.      Since + has always been used to concatenate lists, a new ADD func-
  712.      tion exists to add the elements of two lists, like this:
  713.  
  714.  
  715.           { 1 2 3 } { 4 5 6 } ADD returns { 5 7 9 }, whereas
  716.           { 1 2 3 } { 4 5 6 }  +  returns { 1 2 3 4 5 6 } as it did
  717.             before.
  718.  
  719.  
  720.      The only commands which do not have automatic list processing are:
  721.  
  722.      o  those which never get a Bad Argument Type error (like DUP),
  723.  
  724.      o  meta-object commands (like ROLL),
  725.  
  726.      o  program branch structures (like FOR), and
  727.  
  728.      o  commands that specifically work on lists (like GET).
  729.  
  730.         Sometimes the results are non-obvious, for example:
  731.  
  732.  
  733.           5  { A B C }  STO           -->  A=5, B=5, C=5
  734.           { 5 6 7 }  'A'  STO         -->  A={ 5 6 7 }  (same as on SX)
  735.           { 5 6 7 }  { A B C }  STO   -->  A=5, B=6, C=7
  736.  
  737.  
  738.      List processing is only recursive for ->Q and ->Qpi.
  739.  
  740.      PORTS AND MEMORY
  741.         The HP48 G, like the 48 S, only has 32K RAM.  The GX, unlike the
  742.         SX, has 128K RAM built-in.  Card slot 1 can contain another 128K
  743.         (maximum), but card slot 2 can contain up to 4 megabytes of RAM.
  744.  
  745.         Only port 1 can be merged in the GX.  Card slot 2, which is
  746.         intended for large-capacity RAM cards, is permanently "free",
  747.         and is automatically divided up into 128K "ports", each of which
  748.         becomes Port 2, Port 3, Port 4, etc.  Up to 4 Megabytes can be
  749.         plugged into slot 2, which would then become Port 2 through Port
  750.         33. (Although the FREE and MERGE commands were kept for HP48 SX
  751.         compatibility, GX users will prefer the new FREE1 and MERGE1
  752.         commands).  Therefore the maximum amount of merged main memory
  753.         is 256K (unlike the SX which allowed up to 288K) after MERGE1;
  754.         the maximum amount of fully online free independent memory is
  755.         4224K after FREE1.
  756.  
  757.      LOCAL VARIABLES
  758.         Variable names prefixed with a <- (backarrow character) are
  759.         compiled as local (temporary) variable name objects even if
  760.         they're not explicitly after FOR or ->.  This allows programs to
  761.         share values through local variables, which is much faster than
  762.         sharing values through global variables, and they get purged
  763.         automatically.
  764.  
  765.      SPEED
  766.         CPU clock speed is double the S/SX's, but throughput is
  767.         estimated to be only 40% faster, primarily due to the fact that
  768.         all RAM & ROM is now bankswitched (on the S/SX only a 32K
  769.         portion of the ROM required bank switching), and it still has
  770.         the same 4-bit bus bottleneck.
  771.  
  772.      IMPROVED COMMANDS:
  773.  
  774.      o  AXES can now also specify the spacing of the tick marks.
  775.  
  776.      o  DEPND can now also specify the initial values and tolerance for
  777.         the new DIFFEQ plot type.
  778.  
  779.      o  REPL and SUB now work on arrays.
  780.  
  781.      HP SOLVE EQUATION LIBRARY CARD COMMANDS:
  782.  
  783.      o  AMORT, amortization calculations
  784.  
  785.      o  CONLIB, starts Constants Library catalog
  786.  
  787.      o  CONST, returns value of a named CONLIB constant
  788.  
  789.      o  DARCY, calculates Darcy friction factor
  790.  
  791.  
  792.      o  EQNLIB, starts Equation Library catalog
  793.  
  794.      o  F0lambda, calculates black-body power fraction
  795.  
  796.      o  FANNING, calculates Fanning friction factor
  797.  
  798.      o  LIBEVAL is a generalized form of the EQ card's ELSYSEVAL; it
  799.         executes any XLIB by its library number
  800.  
  801.      o  MCALC, marks an MSOLVR variable as "not user-defined"
  802.  
  803.      o  MINEHUNT, starts the "Minehunt" video game
  804.  
  805.      o  MINIT, initializes Mpar from 'EQ' for MSOLVR
  806.  
  807.      o  MITM, customizes title & menu of MSOLVR's screen
  808.  
  809.      o  MROOT, solve for variable(s) in MSOLVR
  810.  
  811.      o  MSOLVR, shows Multiple Equation Solver menu
  812.  
  813.      o  MUSER, marks an MSOLVR variable as "user-defined"
  814.  
  815.      o  SIDENS, density of silicon as function of temperature
  816.  
  817.      o  SOLVEQN, starts solver for specified EqLib equation(s)
  818.  
  819.      o  TDELTA, subtracts temperatures like "-" ought to but doesn't
  820.  
  821.      o  TINC, adds temperatures like "+" ought to but doesn't
  822.  
  823.      o  TVM, shows the financial calculator (Time Value of Money) menu
  824.  
  825.      o  TVMBEG, sets payments-at-beginning-of-periods mode
  826.  
  827.      o  TVMEND, sets payments-at-end-of-periods mode
  828.  
  829.      o  TVMROOT, solves for a TVM variable
  830.  
  831.      o  ZFACTOR, calculates gas compressibility factor Z
  832.  
  833.         Note: The EQ Card's Periodic Table and Tetris game are not in
  834.         the HP48 G/GX, but the EQ Card can be used in the GX if those
  835.         applications are needed. Tetris was not included because no
  836.         agreement on royalty was reached.  The Periodic Table is
  837.         available separately as freeware on HPCVBBS.
  838.  
  839.      NEW ARRAY COMMANDS:
  840.  
  841.      o  COL+, inserts a column vector into a matrix or a number into a
  842.         vector (like INSCOL/PUTCOL in Donnelly's Tool Library)
  843.  
  844.      o  COL-, deletes a column from a matrix or number from a vector
  845.         (identical to DELCOL in Donnelly's Tool Library)
  846.  
  847.      o  COL->, combines multiple column vectors into a matrix
  848.  
  849.      o  ->COL, breaks a matrix into multiple column vectors (like
  850.         repeated GETCOL in Donnelly's Tool Library)
  851.  
  852.      o  COND, column norm condition number of a square matrix
  853.  
  854.      o  CSWP, swaps two columns in a matrix (like EXCOL in Donnelly's
  855.         Tool Library)
  856.  
  857.  
  858.      o  ->DIAG, returns vector of major diagonal elements of a matrix
  859.  
  860.      o  DIAG->, creates matrix with specified diagonal elements
  861.  
  862.      o  EGV, eigenvalues and right eigenvectors of a square matrix
  863.  
  864.      o  EGVL, eigenvalues of a square matrix
  865.  
  866.      o  FFT, discrete Fourier transform
  867.  
  868.      o  IFFT, inverse discrete Fourier transform
  869.  
  870.      o  LQ, returns the LQ factorization of a matrix
  871.  
  872.      o  LSQ, minimum norm least-squares solution to an ill-determined
  873.         system of linear equations
  874.  
  875.      o  LU, returns the Crout LU decomposition of a square matrix
  876.  
  877.      o  PCOEF, returns polynomial with given roots (inverse of PROOT)
  878.  
  879.      o  PEVAL, evaluates polynomial at x
  880.  
  881.      o  PROOT, finds all roots of polynomial (inverse of PCOEF)
  882.  
  883.      o  QR, returns QR factorization of a matrix
  884.  
  885.      o  RANK, rank of a rectangular matrix (uses flag -54)
  886.  
  887.      o  RANM, creates matrix with random elements
  888.  
  889.      o  RCI, multiplies elements in one row of a matrix by a scalar
  890.  
  891.      o  RCIJ, does RCI then adds the result to a row
  892.  
  893.      o  ROW+, inserts a row vector into a matrix or a number into a
  894.         vector (like INSROW/PUTROW in Donnelly's Tool Library)
  895.  
  896.      o  ROW-, deletes a row from a matrix or number from a vector
  897.         (identical to DELROW in Donnelly's Tool Library)
  898.  
  899.      o  ROW->, combines multiple row vectors into a matrix
  900.  
  901.      o  ->ROW, breaks a matrix into multiple row vectors (like repeated
  902.         GETROW in Donnelly's Tool Library)
  903.  
  904.      o  RSWP, swaps two rows in a matrix (identical to EXROW in
  905.         Donnelly's Tool Library)
  906.  
  907.      o  SCHUR, computes the Schur decomposition of a square matrix
  908.  
  909.      o  SNRM, spectral norm of an array
  910.  
  911.      o  SRAD, spectral radius of a square matrix
  912.  
  913.      o  SVD, singular value decomposition of a matrix
  914.  
  915.      o  SVL, computes the singular values of a matrix
  916.  
  917.      o  TRACE, sum of diagonal elements of a square matrix
  918.  
  919.      GRAPHICS and PLOTTING COMMANDS:
  920.  
  921.      o  ANIMATE, displays grobs on the stack sequentially.  You can use
  922.         the defaults, or specify your own delay between frames (can be
  923.         very fast), the number of times to repeat the sequence, and even
  924.         the pixel coordinates.  It's just like a ROLL REPL loop...
  925.         except very fast.  Note: Charlie Patton converted 17 seconds of
  926.         the Apollo moon-walk video into HP48 GROBs and ran them with
  927.         ANIMATE, and it looked very good!
  928.  
  929.      o  ATICK, specifies tick spacing on plot axes
  930.  
  931.      o  EYEPT, specifies the eye-point coordinates in a perspective plot
  932.  
  933.      o  GRIDMAP, selects the new "gridmap" plot type
  934.  
  935.      o  PARSURFACE, selects the new "parametric surface" plot type
  936.  
  937.      o  PCONTOUR, selects the new "pcontour" plot type
  938.  
  939.      o  PICTURE, same as GRAPH command
  940.  
  941.      o  SLOPEFIELD, selects the new "slopefield" plot type
  942.  
  943.      o  WIREFRAME, selects the new "wireframe" plot type
  944.  
  945.      o  XVOL, sets the width of the 3D plotting volume
  946.  
  947.      o  XXRNG, sets the width of the 3D target mapping range for gridmap
  948.         and parametric surface plots
  949.  
  950.      o  YSLICE, selects the new "yslice" plot type
  951.  
  952.      o  YVOL, sets the depth of the 3D plotting volume
  953.  
  954.      o  YYRNG, sets the depth of the 3D target mapping range for gridmap
  955.         and parametric surface plots
  956.  
  957.      o  ZVOL, sets the height of the 3D plotting volume
  958.  
  959.      USER-INTERFACE COMMANDS:
  960.  
  961.      o  CHOOSE, displays a point-and-click menu "dialog box"
  962.  
  963.      o  INFORM, formatted multi-line input with named fields (nice!!)
  964.  
  965.      o  MSGBOX, displays text in a centred box with shadow, then WAITs
  966.  
  967.      o  NOVAL, placeholder for unspecified values in INFORM argument
  968.         list
  969.  
  970.      LIST PROCESSING COMMANDS:
  971.  
  972.      o  ADD, adds lists element-wise (see section above)
  973.  
  974.      o  DOLIST, evals an object on multiple lists
  975.  
  976.      o  DOSUBS, evals a program or command taking arguments from a list
  977.  
  978.      o  ENDSUBS, returns the number of loops the current DOSUBS will do
  979.  
  980.      o  HEAD, first element in a list or first char in a string
  981.         (identical to CAR in Donnelly's Tool Library)
  982.  
  983.      o  DeltaLIST, list of first finite differences of list objects
  984.  
  985.      o  SigmaLIST, sum of the elements in a list
  986.  
  987.      o  PiLIST, product of the elements in a list
  988.  
  989.  
  990.      o  NSUB, returns the current list pointer value during a DOSUBS
  991.  
  992.      o  REVLIST, reverses the order of the objects in a list (like
  993.         REVERSE in Donnelly's Tool Library)
  994.  
  995.      o  SEQ, list of results from repeated execution of an object (like
  996.         a FOR/STEP loop but the results go into a list)
  997.  
  998.      o  SORT, sorts elements in a list into ascending order, or sorts a
  999.         list of lists using each list's first element as the key (can be
  1000.         done with LSORT/QSORT in Donnelly's Tool Library)
  1001.  
  1002.      o  STREAM, executes an object on first two elements of a list, then
  1003.         again on the result and the 3rd element, etc.  Allows easy
  1004.         creation of things similar to SigmaLIST and PiList.
  1005.  
  1006.      o  TAIL, returns a decapitated list or string (see HEAD above)
  1007.         (identical to CDR in Donnelly's Tool Library)
  1008.  
  1009.      SYSTEM COMMANDS:
  1010.  
  1011.      o  CLTEACH, clears the 'EXAMPLES' directory created by TEACH
  1012.  
  1013.      o  CYLIN, sets polar/cylindrical coordinate mode
  1014.  
  1015.      o  FREE1, like 1 FREE (see section above)
  1016.  
  1017.      o  MERGE1, like 1 MERGE (see section above)
  1018.  
  1019.      o  PINIT, port initialize, esp. important for 4-Meg RAM card users
  1020.  
  1021.      o  RECT, sets rectangular coordinate mode
  1022.  
  1023.      o  SPHERE, sets polar/spherical coordinate mode
  1024.  
  1025.      o  TEACH, loads the Owner's Manual examples into a dir in HOME
  1026.  
  1027.      o  VERSION, returns the operating system ROM version string and a
  1028.         copyright notice, like this:
  1029.  
  1030.  
  1031.           2: "Version HP48-R"      <-- means version "R"
  1032.           1: "Copyright HP 1993"
  1033.  
  1034.  
  1035.      o  XRECV, X-Modem protocol receive (binary mode only)
  1036.  
  1037.      o  XSEND, X-Modem protocol send (binary mode only)
  1038.  
  1039.      MATH COMMANDS:
  1040.  
  1041.      o  LININ, tests whether an equation is linear in a given variable
  1042.  
  1043.      o  NDIST, normal probability density
  1044.  
  1045.      o  PCOV, population covariance of SigmaDAT
  1046.  
  1047.      o  PSDEV, population standard deviation of SigmaDAT
  1048.  
  1049.      o  PVAR, population variance of SigmaDAT
  1050.  
  1051.      o  RKF, solves initial value problem using Runge-Kutta-Fehlberg
  1052.  
  1053.  
  1054.      o  RKFERR, change in solution and absolute error using RKF
  1055.  
  1056.      o  RKFSTEP, next solution step with given error tolerance using RKF
  1057.  
  1058.      o  RRK, solves initial value problem using Rosenbrock & RKF
  1059.  
  1060.      o  RRKSTEP, next solution step with given error tolerance using RRK
  1061.  
  1062.      o  RSBERR, change in solution and absolute error using Rosenbrock
  1063.  
  1064.      MENU NUMBERS and KEY CODES
  1065.         Many menu numbers have changed, so software that uses # MENU or
  1066.         # TMENU may not work the same as in the HP48 S/SX.
  1067.         (Specifically, only menu numbers 0-3, 28, 30, and 42-59 are the
  1068.         same). Likewise, almost all of the shifted keycodes correspond
  1069.         to new commands and menus, which programmers must take into
  1070.         account; for example, the "RAD" key on the S/SX had the keycode
  1071.         82.2, but it's 21.2 on the G/GX.  The left-shift key, which was
  1072.         orange on the S/SX, is now purple [officially "lavender"], and
  1073.         the right-shift key which was blue on the S/SX is now green
  1074.         [officially "teal"] on the G/GX.  Also, the digit-key menus can
  1075.         be activated by both shift keys; left-shift gives the softkey
  1076.         menus like in the S/SX, but the right-shift gives the new user-
  1077.         friendly full-screen menus.  The unshifted keys remain identical
  1078.         to the S/SX, except for a cosmetic colour change to match the
  1079.         very dark green of the calculator case.
  1080.  
  1081.      MANUALS
  1082.         The G/GX comes with two manuals, a "Quick Start Guide" for
  1083.         beginners, and a cost-cutting, slimmer owner's manual called the
  1084.         "User's Guide" which has only 21 pages about programming, since
  1085.         HP figures that the huge majority of all 48 owners never program
  1086.         it anyway.  The power users can buy the optional "Advanced Users
  1087.         Reference Manual" (similar to the S/SX's "Programmer's Reference
  1088.         Manual") which covers programming and the many commands that are
  1089.         not mentioned in the User's Guide.  There is no "Quick Reference
  1090.         Guide" like the S/SX came with, although the case still has a
  1091.         pocket for one.
  1092.  
  1093.         Jim Donnelly has marketed a nice pocket guide, but it's too wide
  1094.         to fit in the case's pocket.  The User's Guide is not spiral
  1095.         bound, but is made to open fully and last a long time, since
  1096.         it's not just glued but has sewn signatures like real books, and
  1097.         is printed on quality paper.
  1098.  
  1099.         Another possibility is "The HP 48G/GX Pocket Guide" by Chris
  1100.         Coffin and Thomas Dick (Grapevine Publications).  It's 80 pages
  1101.         long, contains a complete command reference (with input/output
  1102.         stack diagrams), alpha keyboard description, system flag
  1103.         description, as well as examples of how to use various
  1104.         calculator features.  This guide is designed to fit nicely in
  1105.         the pocket of the HP case.
  1106.  
  1107.      FLAGS
  1108.         Some previously "unused" flags are now used.  They are:
  1109.  
  1110.  
  1111.      -14 Clear = end-of-period payment mode (for TVM calculations)
  1112.          Set   = beginning-of-period payment mode
  1113.  
  1114.      -27 Clear = display symbolic complex numbers in coordinate form
  1115.                  e.g. '(X,Y)'
  1116.          Set   = display symbolic complex numbers using 'i'
  1117.                  e.g. 'X+Y*i'
  1118.  
  1119.      -28 Clear = plot multiple equations like the S/SX does (serially)
  1120.          Set   = plot multiple equations simultaneously
  1121.  
  1122.      -29 Clear = include axes in plots (like the S/SX does)
  1123.          Set   = omit axes from 2D and statistics plots
  1124.  
  1125.      -30 is no longer used (it never did anything useful anyhow)
  1126.  
  1127.      -54 Clear = tiny matrix elements get rounded to zero
  1128.          Set   = leaves matrix elements alone
  1129.  
  1130.  
  1131.      The default setting of all these flags is Clear (as in the S/SX).
  1132.  
  1133.      FLAG BROWSER
  1134.         There is a System Flag browser which shows the flag number,
  1135.         shows whether it's set or clear, lets you toggle it, and shows
  1136.         in English what the current setting means.
  1137.  
  1138.      CHARACTER BROWSER
  1139.         While programming, if you want to type any character at all,
  1140.         press CHARS and a screenful of ASCII characters is displayed
  1141.         that you can browse with the arrow keys, and not only does the
  1142.         screen also show the ASCII code (NUM value) and even the
  1143.         shortcut keyboard key sequence (if any) for each character, but
  1144.         if you press ECHO, it will be "typed" into your program.
  1145.         There's no need any more for the alpha keyboard table.
  1146.  
  1147.      DIRECTORY MAINTENANCE
  1148.         Press right-shift VAR to launch a Variable Browser which is a
  1149.         complete memory manager.  You can tag multiple objects and copy,
  1150.         move, or delete them all with a single keystroke; there's even a
  1151.         Mark All and an Unmark All, like a real computer.  It's slow,
  1152.         however, and has been obsoleted by the very fast PCT library.
  1153.  
  1154.      FRACTIONAL UNIT POWERS
  1155.         The S/SX only handled integer powers of units correctly, but the
  1156.         G/GX can use any real number as a unit power.
  1157.  
  1158.      NAME PLATE
  1159.         The case has a rectangular indentation in the back like the HP
  1160.         95LX and 100LX, and it comes with an adhesive metal nameplate
  1161.         that you can get engraved with your name.
  1162.  
  1163.      XLIB NAMES
  1164.         All of the new commands in the GX are XLIB names, and therefore
  1165.         take 5.5 bytes in programs.  The commands common to the SX and
  1166.         GX take 2.5 bytes each, as they did in the SX.
  1167.  
  1168.      INPUT FORMS and CHOOSE BOXES
  1169.         Many operations have two menu types: the old SX style, and a new
  1170.         "drop-down" menu and "input forms" that have the feel of
  1171.         computer dialog boxes.  Especially useful for the HP48 beginner.
  1172.  
  1173.      ENHANCED PRECISION
  1174.         The internal precision of at least some of the matrix routines
  1175.         has been improved; INV gets better answers on square matrices
  1176.         than the SX did.  HP has not released information about which
  1177.         routines were improved, how, and by how much.
  1178.  
  1179.      IMPROVED DISPLAY
  1180.         The LCD introduced with revision M of the G/GX is easier to read
  1181.         since it has higher contrast between on/off pixels.  It has a
  1182.         slower cycle response time, however, making it difficult to use
  1183.         for rapid-motion video games or any other rapid animation.
  1184.  
  1185.  
  1186.   10.2.  Examples of INFORM, CHOOSE, and MSGBOX
  1187.  
  1188.   From: Jarno Peschier
  1189.  
  1190.   Some examples of INFORM, CHOOSE and MSGBOX on the HP48 GX. Just
  1191.   download the entire directory to your calculator and try the programs,
  1192.   change them, modify them and do everything else with them you can
  1193.   think of.
  1194.  
  1195.      SIMPLE:
  1196.         This program will demonstrate a simple INFORM input screen with
  1197.         3 fields (one without type restrictions, one for real or complex
  1198.         numbers and one for strings) with some additional layout. MSGBOX
  1199.         and CHOOSE (with the third parameter equal 0) are used to show
  1200.         what the results of the INFORM command are. The list the INFORM
  1201.         command returns is left on stack so you can see what it looks
  1202.         like.
  1203.  
  1204.      ANGLE:
  1205.         This program will demonstrate the use of CHOOSE. It lets you
  1206.         choose between the three possible angle modes (DEG, RAD, GRAD)
  1207.         and when you choose one of them, the corresponding mode is set
  1208.         by evaluating a tiny program containing the right command.
  1209.  
  1210.      ISOLATE:
  1211.         This program will demonstrate the use of INFORM in ways that it
  1212.         is used in the calculator itself. It is a very simple shell
  1213.         around the ISOL command (isolation of a variable from an
  1214.         algebraic). It remembers it's settings in a variable called IPAR
  1215.         and the next time the program is run this will be the default
  1216.         values of the INFORM command, so you can isolate for a different
  1217.         variable using the same algebraic you used before, without
  1218.         retyping it. MSGBOX is used for error messages.
  1219.  
  1220.      TYPELIST:
  1221.         This program will again demonstrate the use of CHOOSE. It
  1222.         extracts the names of all the internal types of the HP48 GX from
  1223.         ROM and shows them in a CHOOSE-box (alphabetically sorted by
  1224.         name). If you choose one of them, its TYPE number is shown in a
  1225.         MSGBOX.
  1226.  
  1227.      MATHQUIZ:
  1228.         This final program will demonstrate the use of INFORM with
  1229.         variable field descriptions and default/reset values. It's will
  1230.         show you 8 fields that are simple math questions for you to
  1231.         solve (addition and subtraction).  You can enter all the results
  1232.         and then you will see if your answers were correct (in a
  1233.         MSGBOX). You must fill all the fields. Hint: you can cheat by
  1234.         resetting a field (or all fields).
  1235.  
  1236.  
  1237.      %%HP: T(3)A(D)F(.);
  1238.      DIR
  1239.        SIMPLE
  1240.          \<<
  1241.            IF
  1242.      "AN EXAMPLE OF INFORM"
  1243.      { { } { } { } {
  1244.      "OBJECT:"
  1245.      "ALL OBJECTS ARE ALLOWED HERE"
  1246.      } { } { "NUM:"
  1247.      "ENTER A (COMPLEX) NUMBER"
  1248.      0 1 } { "NAME:"
  1249.      "ENTER YOUR FULL NAME"
  1250.      2 } { } { } } { 3 1
  1251.      } {
  1252.              \<< 440 1
  1253.      BEEP
  1254.              \>> (0,1)
  1255.      "JARNO PESCHIER" }
  1256.      { NOVAL 0 "N.N." }
  1257.      INFORM
  1258.            THEN DUP
  1259.      "YOU ENTERED:" SWAP
  1260.      0 CHOOSE DROP
  1261.      "The list that INFORM produced is still on the stack."
  1262.            ELSE
  1263.      "You cancelled the INFORM."
  1264.            END MSGBOX
  1265.          \>>
  1266.        ANGLE
  1267.          \<<
  1268.            IF
  1269.      "ANGLE MEASURE" { {
  1270.      "Degrees" DEG } {
  1271.      "Radians" RAD } {
  1272.      "Grads" GRAD } } 1
  1273.      CHOOSE
  1274.            THEN EVAL
  1275.            END
  1276.          \>>
  1277.        ISOLATE
  1278.          \<<
  1279.            IF
  1280.      "A VERY SIMPLE VARIABLE ISOLATOR"
  1281.      { { } { "EXPR:"
  1282.      "ENTER THE EXPRESSION"
  1283.      9 } { "VARIABLE:"
  1284.      "ENTER VARIABLE TO ISOLATE"
  1285.      6 } } { } { }
  1286.              IF 'IPAR'
  1287.      VTYPE 5 \=/
  1288.              THEN { }
  1289.              ELSE 'IPAR'
  1290.      RCL
  1291.              END INFORM
  1292.            THEN DUP 'IPAR' STO
  1293.              IF DUP
  1294.      NOVAL POS
  1295.              THEN DROP
  1296.      "You must enter an expression and a variable!"
  1297.      MSGBOX
  1298.              ELSE OBJ\->
  1299.      DROP
  1300.                IFERR
  1301.      ISOL
  1302.                THEN
  1303.      DROP2 "Error: "
  1304.      ERRM + MSGBOX
  1305.                END
  1306.              END
  1307.            END
  1308.          \>>
  1309.        TYPELIST
  1310.          \<<
  1311.            IF
  1312.      "ALL HP48 TYPES (IN ROM)"
  1313.      0 27
  1314.              FOR msg
  1315.                IFERR msg
  1316.      263 + DOERR
  1317.                THEN ERRM
  1318.                END msg 2
  1319.      \->LIST
  1320.              NEXT 28
  1321.      \->LIST SORT 1 CHOOSE
  1322.            THEN
  1323.      "That one has type number "
  1324.      SWAP + "." + MSGBOX
  1325.            END
  1326.          \>>
  1327.        MATHQUIZ
  1328.          \<<
  1329.            IF
  1330.      "A SIMPLE MATH QUIZ"
  1331.      1 8
  1332.              FOR i "'"
  1333.      RAND 100 * IP +
  1334.                IF RAND
  1335.      0.75 <
  1336.                THEN "+"
  1337.                ELSE "-"
  1338.                END +
  1339.      RAND 100 * IP + "'"
  1340.      + "ENTER RESULT #"
  1341.      i + 0 3 \->LIST
  1342.              NEXT 8
  1343.      \->LIST DUP
  1344.              \<< \-> X
  1345.                \<< X HEAD
  1346.      2 OVER SIZE 1 - SUB
  1347.      "=" + X 1 ROT PUT
  1348.                \>>
  1349.              \>> DOLIST
  1350.      SWAP
  1351.              \<< \-> X
  1352.                \<< X HEAD
  1353.      OBJ\-> EVAL
  1354.                \>>
  1355.              \>> DOLIST 3
  1356.      ROLLD { 2 5 } 4
  1357.      PICK { } INFORM
  1358.            THEN
  1359.              IF DUP
  1360.      NOVAL POS
  1361.              THEN DROP2
  1362.      "You didn't fill all the blanks."
  1363.              ELSE
  1364.                IF SAME
  1365.                THEN
  1366.      "All answers were correct!"
  1367.                ELSE
  1368.      "Not all answers were correct."
  1369.                END
  1370.              END MSGBOX
  1371.            ELSE DROP
  1372.            END
  1373.          \>>
  1374.      END
  1375.  
  1376.  
  1377.   10.3.  Some useful LIBEVALs
  1378.  
  1379.   From: Joe Horn
  1380.  
  1381.   Note well: backup memory before using any of the following!  LIBEVAL
  1382.   can clear memory if used incorrectly.  Warning to the clueless:
  1383.   LIBEVAL, NOT SYSEVAL!!!  If you don't know what a "bint" is, don't use
  1384.   the ones that mention bints.
  1385.  
  1386.   Example usage: "OUT OF RANGE Try Again" #B0091h LIBEVAL.  Try it!
  1387.  
  1388.  
  1389.        -----------------------------------------------------+----------
  1390.        Function                                             | LIBEVAL
  1391.        -----------------------------------------------------+----------
  1392.        Displays message box with grob                       | #B1000h
  1393.        CMD  last command window                             | #B2000h
  1394.        CHARS application                                    | #B2001h
  1395.        MODES application input form                         | #B41C1h
  1396.        flag browser  (returns t/f to level 1, just drop it) | #B41CFh
  1397.        MEMORY application  (aka variable browser)           | #B41D7h
  1398.        SOLVE application choose box                         | #B4000h
  1399.        solve equation input form                            | #B4001h
  1400.        solve difeq input form                               | #B4017h
  1401.        solve polynomial input form                          | #B402Ch
  1402.        solve linear systems of equations input form         | #B4033h
  1403.        solve TVM input form                                 | #B4038h
  1404.        PLOT input form                                      | #B4045h
  1405.        SYMBOLIC application choose box                      | #B4113h
  1406.        integrate input form                                 | #B4114h
  1407.        differentiate input form                             | #B4122h
  1408.        Taylor polynomial expansion input form               | #B412Bh
  1409.        Isolate a variable input form                        | #B412Dh
  1410.        solve quadratic input form                           | #B4130h
  1411.        manipulate expression input form                     | #B4131h
  1412.        TIME application choose box                          | #B4137h
  1413.        Set alarm input form                                 | #B4138h
  1414.        Set time and date input form                         | #B415Bh
  1415.        Alarm browser   (aka alarm catalog)                  | #B416Eh
  1416.        STAT application choose box                          | #B4175h
  1417.        single-var stat input form                           | #B4176h
  1418.        frequencies input form                               | #B417Dh
  1419.        fit data input form                                  | #B417Fh
  1420.        summary stat input form                              | #B418Fh
  1421.        I/O application choose box                           | #B4192h
  1422.        Send to HP48 input form                              | #B4193h
  1423.        Print input form                                     | #B4197h
  1424.        Transfer input form                                  | #B41A8h
  1425.        Get from HP48  (immediate)                           | #B50FFh
  1426.        recalls the contents of the reserve variable Mpar    | #E4012h
  1427.        -----------------------------------------------------+----------
  1428.  
  1429.  
  1430.        LIBEVAL : stack diagram / what it does
  1431.        -------   -----------------------------------------------------------
  1432.        #B0091h : $ --> makes a message box with an alert symbol in it
  1433.        #E0044h : $ --> displays a title line, top center (follow with
  1434.                  1 FREEZE if you want it to stay there after program ends)
  1435.        #B2000h : launches the Last Command choose-box
  1436.        #B2001h : launches the CHARS application; returns nothing if user does
  1437.                  not press ECHO
  1438.        #B2002h : launches the CHARS application; returns "" if user does not
  1439.                  press ECHO
  1440.        #B41CFh : launches Flag Browser; leaves a True or False on stack, so
  1441.                  follow this LIBEVAL with a DROP.
  1442.        #B50A3h : --> current time as hour, min, sec separately, plus an XLIB
  1443.                  that represents AM/PM/24-hr (just DROP it)
  1444.        #B50A4h : hh.mmss --> hh mm ss xlib (the xlib represents AM,PM, or
  1445.                  24-hr mode; just DROP it)
  1446.        #B50A6h : --> current date as month, day, year (always that order, and
  1447.                  a two-digit year)
  1448.        #B50A7h : mm.ddyyyy (or dd.mmyyyy) --> month, day, yr
  1449.        #B50A9h : #month #yr --> #days_in_that_month (inputs and output are
  1450.                  bints; year is two digits, interpreted as between 1991 &
  1451.                  2090 only)
  1452.        #B50AAh : #yr --> %0.00yyyy (input is two-digit bint interpreted as
  1453.                  between 1991 and 2090; output is a real number)
  1454.        #B50ABh : #mon #day #yr --> #day_of_week (inputs & output are bints;
  1455.                  year is two digits interpreted as between 1991 & 2090;
  1456.                  Sunday is #7; if you're in DMY mode, then the input order is
  1457.                  #day #mon #yr)
  1458.        #B50B2h : --> { 1 2 3 ... 59 } (not very fast)
  1459.        #B50B3h : --> { 1 2 3 ... 10 } (very fast)
  1460.        #B50B4h : --> { 0 1 2 ... 23 } (very fast)
  1461.        #B50B9h : --> { " 1 January" " 2 February" ... "12 December" }
  1462.        #B50D5h : --> number of alarms currently set (as a bint)
  1463.        #E3063h : hxs --> grob (this is an RLL packed-grob uncompressor, used
  1464.                  by EQ LIB and MINEHUNT; for example, try this:
  1465.                  #E202Bh LIBEVAL 3 GET #E3063h LIBEVAL PICT STO PICTURE)
  1466.        #E202Bh : the first of the packed EQ LIB grobs (see above)
  1467.        #E2069h : the last of the packed EQ LIB grobs (see above)
  1468.        #E7039h : MINEHUNT packed grob (left screen border)
  1469.        #E703Ah : MINEHUNT packed grob (right screen border)
  1470.        #E801Eh : obj --> obj T/F (tests whether object is in temporary memory
  1471.                  or not; returns System-RPL True or False)
  1472.  
  1473.  
  1474.   11.  Appendix C: Details of Bugs
  1475.  
  1476.   11.1.  The EquationWriter Bug
  1477.  
  1478.   From: Joe Horn
  1479.  
  1480.  
  1481.      Rev E Behaviour
  1482.         Clear flag -53 first (the Precedence Flag).
  1483.  
  1484.         On a Rev E, put '((1+2)/(3+4))^5' on the stack and press down-
  1485.         arrow.  You'll see:
  1486.  
  1487.  
  1488.                  5
  1489.           / 1+2 \
  1490.           | --- |                         (A)
  1491.           \ 3+4 /
  1492.  
  1493.      which is as it should be.  But now press [orange-shift] [+]; see
  1494.      the message "Implicit () off" momentarily; press [left-arrow] (not
  1495.      backspace), then press the [EXIT] softkey.  The expression gets
  1496.      mangled into this:
  1497.  
  1498.  
  1499.               1+2
  1500.           -----------                       (B)
  1501.                 (5)
  1502.            (3+4)
  1503.  
  1504.  
  1505.      which is not equal to expression (A) above!  Bug, yes?  Press ON to
  1506.      abort the process.
  1507.  
  1508.      Now set flag -53, then repeat the above procedure.  First you see:
  1509.  
  1510.  
  1511.                  5
  1512.           / 1+2 \
  1513.           | --- |                         (C)
  1514.           \ 3+4 /
  1515.  
  1516.  
  1517.      which is the same as (A) above; but continuing as before, you see:
  1518.  
  1519.  
  1520.                    (5)
  1521.           /  1+2  \
  1522.           | ----- |                       (D)
  1523.           \ (3+4) /
  1524.  
  1525.  
  1526.      which is equal to the original.  Thus the bug can be worked around
  1527.      by keeping flag -53 set (not a pleasant solution).
  1528.  
  1529.      Rev J Behaviour
  1530.         Major difference: after pressing down-arrow, Rev J goes directly
  1531.         into graphic mode, so you have to press ON and then EXIT to get
  1532.         into the equation editor (which Rev E goes directly into).  But
  1533.         that's petty cash compared to the following big change.
  1534.  
  1535.         The same sequence of operations, first with flag -53 clear, then
  1536.         set, exactly as detailed above, yields these four displays in a
  1537.         Rev J:
  1538.  
  1539.  
  1540.                    5
  1541.           / (1+2) \
  1542.           | ----- |                       (A')
  1543.           \  3+4  /
  1544.  
  1545.  
  1546.      (notice the extra parentheses?) and then:
  1547.  
  1548.  
  1549.               5
  1550.      / (1+2) \
  1551.      | ----- |                       (B')
  1552.      \ (3+4) /
  1553.  
  1554.  
  1555.      which is equal to (A'); nothing at all like expression (B) above!
  1556.      and then:
  1557.  
  1558.  
  1559.                    5
  1560.           / (1+2) \
  1561.           | ----- |                       (C')
  1562.           \  3+4  /
  1563.  
  1564.  
  1565.      which is the same as (A') above; and then:
  1566.  
  1567.  
  1568.                    5
  1569.           / (1+2) \
  1570.           | ----- |                       (D')
  1571.           \ (3+4) /
  1572.  
  1573.  
  1574.      which is also equal to (A').  No bug in Rev J.
  1575.  
  1576.   SUMMARY: Rev A-E have a bug in the EquationWriter that can mangle
  1577.   expressions if flag -53 is clear (the default) and if "Explicit Paren-
  1578.   theses" mode is toggled.  This bug has been fixed in Rev J.
  1579.  
  1580.   Unfortunately (as you can see above) Rev J always puts parentheses
  1581.   around polynomial numerators.  It is therefore impossible to use the
  1582.   ->GROB command on a Rev J to create a GROB that looks like expression
  1583.   (A) above; the simplest that can be had is expression (A').
  1584.  
  1585.   Another minor change, while I'm at it: Rev A-E don't change the menu
  1586.   when you press REPL; Rev J automatically flips to the appropriate
  1587.   RULES menu.
  1588.  
  1589.  
  1590.   11.2.  Rotation Rate to Angular Frequency Conversion Bug
  1591.  
  1592.  
  1593.      About the Bug:
  1594.         From: Wlodek Mier-Jedrzejowicz <wacm@doc.ic.ac.uk>
  1595.  
  1596.         There is a rotation rate conversion bug in the HP48 G/GX which I
  1597.         have not seen reported here before, so after discussion with the
  1598.         folks at Corvallis I am posting this description. Warning: it is
  1599.         159 lines long!
  1600.  
  1601.         First - an example. Put the unit object 60_rpm in level 2 and
  1602.         the unit object 1_r/s in level 1, then execute the command
  1603.         CONVERT.  You are asking the HP48 to convert a rotation rate of
  1604.         60 revolutions per minute into an angular frequency in radians
  1605.         per second. 60 rpm is 1 revolution per second, or 2pi radians
  1606.         per second.  No HP48 G/GX will give this answer!  Not everyone
  1607.         uses rpm or is even aware of the existence of this unit - it is
  1608.         one of the extra units in the UTILS menu of the Equation Library
  1609.         - so here is a second example - add 2pi radians per second to
  1610.         one Hertz.  Put 6.2832_r/s in level 1, 1_Hz in level 1, and add.
  1611.         You are adding an angular frequency of two pi (one cycle) per
  1612.         second to a rotation rate of one per second, so the result
  1613.         should be a frequency of two Hertz.  On an HP48 S/SX that is the
  1614.         answer.  On an HP48 G/GX it is not.
  1615.  
  1616.         When units are converted, by CONVERT, or during arithmetic on
  1617.         unit objects, the level 2 object is first turned into "base
  1618.         units", and then the result is converted into the units of the
  1619.         level 1 object.  On the HP48 S/SX, the "base unit" of angles is
  1620.         one rotation (or a "unit circle" or a revolution or a cycle).
  1621.         So, the angle unit of rpm (a revolution) or of Hz (a cycle if Hz
  1622.         is treated as a rotation rate) is already in base units -
  1623.         conversions to angles involving rpm and Hz automatically work
  1624.         correctly.  On the HP48 G/GX, the "base unit" of angles is the
  1625.         current angle mode (DEG, RAD or GRAD) - so any conversion from
  1626.         rpm or Hz (or any formula which works in cycles, rotations,
  1627.         revolutions, unit circles) to angles should be preceeded by a
  1628.         conversion from the unit circle to the current angle.
  1629.         Apparently no-one noticed this would be necessary, because it
  1630.         all worked automatically on the HP48 S/SX.
  1631.  
  1632.         So, when you convert 60_rpm to units of _r/s, an HP48 G/GX
  1633.         converts not 60 rotations but 60 "base angle units" per minute
  1634.         to radians/second. In RAD mode, you get 1 radian per second. In
  1635.         DEG mode you get 1 degree per second, and in GRAD mode you get 1
  1636.         grad per second (in each case expressed in radians). That's
  1637.         three different answers, none of which is correct! Exactly the
  1638.         same happens if you convert 1_Hz to angles per second, and the
  1639.         inverse mistake is made if you convert angles per time to cycles
  1640.         or rotations divided by time.
  1641.  
  1642.         I first learned of this bug from a member of HPCC (the British
  1643.         club for users of HP handhelds), Peter Embrey. He describes his
  1644.         troubles in articles in the first two 1994 issues of our club
  1645.         journal, DATAFILE (in Volume 13 number 1 pages 12 to 14 and
  1646.         V13n2p6). He was calculating the energy stored by a flywheel -
  1647.         given by the formula (1/2)*I*omega^2 and after a time he decided
  1648.         the answers had to be much too big when he CONVERTed from
  1649.         kg*m^2*(r/s)^2 to W*h on an HP48 GX.  It turns out that (r/s)
  1650.         are the correct units to get the right answer, but the GX was
  1651.         converting to degrees per second as it was in DEG mode, so his
  1652.         answer was too large by a factor of (360/2pi)^2 - a factor of
  1653.         about 3,300. In this case, his HP48 SX was not much better,
  1654.         since it converted from radians to unit circles. The way to get
  1655.         the correct answer is to use an HP48 G or GX in RAD mode - or to
  1656.         divide out the radians from the formula before using CONVERT.
  1657.         This is not yet a bug, but needs as much care as does use of
  1658.         temperature units on the HP48. But when Peter tried to deal with
  1659.         the problem by working in rpm, he came upon the bug described
  1660.         above. My thanks to Peter for putting me on the trail!
  1661.  
  1662.         Apparently this bug not been reported before - at least my
  1663.         friends in HP tell me that it was not on their list of known
  1664.         problems until I told them of it. (This means it is not fixed in
  1665.         the new revision R.) Why not - does everyone know about it and
  1666.         work around it without thinking to tell anyone else? Or does no-
  1667.         one use their HP48 to do calculations on rotating bodies - or do
  1668.         most people do calculations with rotating bodies in such a way
  1669.         that they do not encounter this problem? Could there be hundreds
  1670.         of students and engineers out there calculating and designing
  1671.         things on their HP48 G/GX and getting wildly inaccurate results?
  1672.         Has anyone built a disk drive or a jet engine which rotates far
  1673.         too fast and will disintegrate because of this? No, of course
  1674.         not, all engineers know that any design calculation absolutely
  1675.         must be repeated on two entirely separate calculators or
  1676.         computer programs! :-| Maybe some students have lost marks in
  1677.         exams because of this though - but please, this is not intended
  1678.         to restart the discussion as to whether calculators should be
  1679.         allowed in exams!
  1680.  
  1681.         I want to underline again that apparently no-one has reported
  1682.         this before - which must mean that few people have been affected
  1683.         by it. It is therefore not a good reason to throw away your HP48
  1684.         G/GX or get on a high horse and demand that HP replace your HP48
  1685.         G/GX - but I think it is important that people be warned so they
  1686.         can take appropriate avoiding action. The rest of this message
  1687.         goes into more detail - if you never worry about rotation
  1688.         calculations then you can safely ignore the rest - though you
  1689.         might find it interesting, so don't stop yet :-)
  1690.  
  1691.         One way to avoid this would be to add a new unit to the HP48 -
  1692.         call it what you like - the "cycle" or "rotation" or
  1693.         "revolution" or "unit circle". As I wrote above, this is already
  1694.         implied in the HP48 S/SX; to see this on an HP48 S/SX, put 360
  1695.         degrees in level 1 and execute UBASE - the result is 1, meaning
  1696.         that 360 degrees are equivalent to one base unit of angle
  1697.         measurement, but that there is no named HP48 unit corresponding
  1698.         to this. In contrast, UBASE on an HP48 G/GX considers the base
  1699.         unit of angle measurement to be the radian, even though CONVERT
  1700.         behaves as though the base unit is the current angle mode. There
  1701.         appear to be two different norms for base angle units on the
  1702.         HP48 G/GX!
  1703.  
  1704.         The whole subject gets very little mention in HP's manuals. In
  1705.         the original HP48 SX manual (two volumes, spiral bound), the
  1706.         section on "Dimensionless Units of Angle" in chapter 13, on page
  1707.         198, warns the reader about the danger of using dimensionless
  1708.         units and states how angle units and scalars are treated. In the
  1709.         later HP48 S and HP48 SX manual (one volume), the same warning
  1710.         is given in "Converting Dimensionless Units of Angle", on page
  1711.         13-12. The HP48 G Series User's Manual, in "Converting Angular
  1712.         Units" on page 10-7, says that conversion will interpret a
  1713.         scalar according to the current angle mode setting. (A scalar is
  1714.         a pure number with no units.)
  1715.  
  1716.         For a detailed description, look in the HP48 S/SX edition of
  1717.         "HP48 Insights Vol II", section 21.4.3. This book is written by
  1718.         Dr Bill Wickes, who was the design team leader of the HP48 SX,
  1719.         and who wrote the "Insights" books largely to provide the sort
  1720.         of explanations and details that get left out of manuals. A good
  1721.         explanation of angle units is exactly the sort of thing one can
  1722.         find there! He explains the pitfalls and unavoidable
  1723.         contradictions of working with angles in the HP48 units system
  1724.         and points out that the HP48 S/SX make the somewhat arbitrary
  1725.         choice of using 2pi as the base unit of angles, thereby making
  1726.         conversions between angles per time and Hertz work correctly.
  1727.  
  1728.         Maybe no-one on the HP48 G/GX team read this while they were
  1729.         making changes from the HP48 S/SX! Why did they change the base
  1730.         unit at all?  Most likely they were trying to deal with another
  1731.         contradiction: the units system lets you add pure numbers to
  1732.         angles, since both are dimensionless. If you add the number 1 in
  1733.         level 2 to the unit object 0_r in level 1 on an HP48 S/SX, the
  1734.         number 1 is treated as 1 base unit, or 2pi radians, and the
  1735.         result is 6.2832_r - but if you take the SIN of the number 1
  1736.         instead, it is not treated as 2pi, but as 1 unit of the current
  1737.         angle mode. The change made on the HP48 G/GX does resolve this
  1738.         contradiction, but at the cost of introducing the bug described
  1739.         above.
  1740.  
  1741.         As mentioned, a way to resolve the problems involved would be to
  1742.         add the angle unit "cycle" explicitly to the HP48 units system.
  1743.         Hz would then be treated as cycles per second when used in
  1744.         calculations involving rotations - rpm would be treated as
  1745.         cycles per minute, and conversions would go from cycles to the
  1746.         appropriate angle units. This suggestion was made by Peter
  1747.         Embrey in his articles, and the folks at HP accept that this is
  1748.         a good solution - but they have not implemented it yet. In the
  1749.         meantime, be very, very careful when converting between units of
  1750.         rotation rate and units of angular frequency. I would urge
  1751.         everyone who does not yet have a copy of Insights II to buy one
  1752.         and read the relevant section - maybe that will even entice Bill
  1753.         Wickes into publishing his long-awaited HP48 G/GX version of the
  1754.         book!
  1755.  
  1756.         I have not yet mentioned solid angles. In principle there should
  1757.         be no problem - on both the HP48 S/SX and the HP48 G/GX the base
  1758.         unit of solid angle is a "unit sphere", or 4pi steradians. On
  1759.         the HP48 S/SX you can add the pure number 1 to 0_sr and get
  1760.         12.5664_sr (4pi steradians). The HP48 G/GX manuals imply that
  1761.         exactly the same should happen, but on my (version L) HP48 GX
  1762.         this gives the error message "Inconsistent Units".  This is yet
  1763.         another undocumented difference between the Series S and Series
  1764.         G but at least it is no bug!
  1765.  
  1766.         Apologies for making this description so long, I hope most
  1767.         people will agree that a subject like this deserves a careful
  1768.         description! For my next trick - some details on the HP48 Random
  1769.         Number Generator.
  1770.  
  1771.  
  1772.      Addition Insight:
  1773.         From: Eric Haas <EHaas@ix.netcom.com>
  1774.  
  1775.         Note: The < symbol below is actually the angle character.
  1776.  
  1777.         The angular conversion bug is actually in the definition of the
  1778.         rpm unit.  If you put 1_rpm on the stack, and type UBASE, you
  1779.         get 1.66666666667E-2_1/s.  Notice that there is no angular unit
  1780.         in the definition. If the rpm unit is instead defined as 6_</s,
  1781.         all conversions to and from rpms will work just fine. As an easy
  1782.         work-around, define the unit RPM as 6_</s and use that instead
  1783.         of the built-in unit.
  1784.  
  1785.         If desired, one could also define the unit HZ as 60_rpm or
  1786.         360_</s.  However, as Hz is sometimes used to describe things
  1787.         other than rotation rates, such a definition would not be
  1788.         appropriate for all circumstances.
  1789.  
  1790.  
  1791.   12.  Appendix D: Hardware Additions
  1792.  
  1793.   12.1.  How to Make a Serial Cable
  1794.  
  1795.   From: Frank Vorstenbosch <prompt@xs4all.nl> Revised by: Andrew Chen
  1796.  
  1797.   Now that you have your HP, you probably want to tap the tremendous
  1798.   amount of programs out there.  But how do you do this?  You need an HP
  1799.   to PC link.  You can buy one, but they tend to be fairly costly.  Or
  1800.   you can build your own.  The process requires the following parts:
  1801.  
  1802.   Required Parts:
  1803.  
  1804.  
  1805.   o  Soldering iron and flux
  1806.  
  1807.   o  RS232-9 or RS232-25 shield (serial port shield)
  1808.  
  1809.   o  RS232-9 or RS232-25 female connector (serial port connector)
  1810.  
  1811.   o  4 pin HP connector, with sockets spaced 2 mm (NOT 0.1") apart
  1812.  
  1813.   o  Some copper wire
  1814.  
  1815.   Of the above list of parts, most are pretty easy to acquire, and you
  1816.   should be able to find them at your local electronics store.  However,
  1817.   the 4 pin (i.e. male) HP connector can be a bit harder to find.
  1818.  
  1819.   If you happen to have a broken floppy drive, hard drive, or CD-ROM
  1820.   audio cable lying around, look inside and see if you can find a
  1821.   connector there that will fit the HP48.  Do not use a 0.1" connector,
  1822.   as this will damage the pins on your calculator.
  1823.  
  1824.  
  1825.      HP Connector
  1826.         The HP connector part of the cable will be the most frustrating
  1827.         part of the link.  The reason is that you will probably not be
  1828.         able to find these at your local electronics store, but you
  1829.         should you should find everything else there.  Instead, you can
  1830.         either find the connector at used computer stores or you can
  1831.         create the link yourself.
  1832.  
  1833.  
  1834.         Easy Way
  1835.            Because the former is much easier, I will give you some tips
  1836.            on where one can find the connecter.  First, check your
  1837.            yellow pages and look under "computer".  You will find a lot
  1838.            of stores, but look specifically for "computer repair" or
  1839.            "computer parts".  Call these stores asking for a "CD-ROM
  1840.            audio cable".  If the store carries these cables, go to the
  1841.            store and ask to see the requested cable.
  1842.  
  1843.            What you should see is a cable with two ends, each with a 4
  1844.            socket connector.  One end should be spaced a bit larger than
  1845.            the other, and this one will not fit into the HP's pins
  1846.            (don't press too hard, or else you will bend the connector
  1847.            pins).  The other side should fit like a charm.  Don't be
  1848.            worried about that there are only 3 sockets.  This is fine
  1849.            because the empty one is a ground.  Once you have this cable,
  1850.            cut off the unusable end, and go to the PC connector section.
  1851.  
  1852.  
  1853.         Hard Way
  1854.            If are unable to find a place that carries CD-ROM audio
  1855.            cables, or you prefer to make your make, it is possible to
  1856.            build the connector yourself.  What you can do is buy IC
  1857.            sockets from a local electronics store.  You can usually find
  1858.            them in packs of 8 or more.  These IC sockets will be bound
  1859.            together in a hard plastic shell, which also places at
  1860.            unusable intervals.  Therefore, it is necessary to strip the
  1861.            IC sockets out of the hard plastic shell (don't worry too
  1862.            much about damaging them, the IC sockets are fairly durable
  1863.            and you have 8 of them).
  1864.  
  1865.            Next, solder a 'fork' from thin rigid metal wires, to hold
  1866.            the four IC pins spaced at exactly 2 mm while you glue them
  1867.            together with superglue.  Glue a plastic 'handle' to the four
  1868.            IC pins to be able to remove the connector from the HP48.
  1869.            You can also indicate the top side of the connector on this
  1870.            handle.
  1871.  
  1872.            Note that the hole in the HP48 in which the connector should
  1873.            go is not symmetrical; the pins are nearer to the top of the
  1874.            calculator than the bottom, and you can use this to make it
  1875.            difficult to insert the connector the wrong way up.
  1876.  
  1877.            With that done, you can proceed on to the PC side of the
  1878.            connector.
  1879.  
  1880.  
  1881.      PC Connector
  1882.         The PC side of the connector is much simpler than the HP side.
  1883.         All you have to do is make a standard serial connector with the
  1884.         parts you bought.  However, don't do it yet because you need to
  1885.         solder the wires from the HP connector into the back of the
  1886.         serial connector first.
  1887.  
  1888.  
  1889.      Making the Connections
  1890.         Now that you have the two sections done, you can begin making
  1891.         the connections for the actual link.  Starting with the HP side,
  1892.         put in the connector and mark the top as "UP".  If you have a
  1893.         CD-ROM audio cable with one socket missing, make sure that the
  1894.         empty socket connects to pin 1:
  1895.  
  1896.  
  1897.            Connector on HP48         Connector to HP48
  1898.                 ______                     ______
  1899.                 |....|                     |oooo|  <-- First is
  1900.                 \____/                     \____/       null
  1901.             pin 1   pin 4              pin 4   pin 1
  1902.  
  1903.  
  1904.      If you made the HP connector the hard way, you have to solder the
  1905.      ends of the IC sockets to long pieces of wire, which will
  1906.      eventually connect to the serial connector on the PC side of the
  1907.      cable.
  1908.  
  1909.      With these wires done, you must solder the individual wires into
  1910.      the proper places on the PC side.  Use this table of pin
  1911.      connections:
  1912.  
  1913.  
  1914.           HP to PC cable
  1915.  
  1916.           HP48 | RS232-9 | RS232-25
  1917.           -----+---------+----------
  1918.             1  | shield  |  shield
  1919.             2  |    2    |    3
  1920.             3  |    3    |    2
  1921.             4  |    5    |    7
  1922.  
  1923.  
  1924.      You can use either a 9 or a 25 pin female sub-D socket for the PC-
  1925.      side of the cable:
  1926.  
  1927.  
  1928.         9-pin RS232                 25-pin RS232
  1929.        connector (F)                connector (F)
  1930.  
  1931.      pin 5       pin 1    pin 13                     pin 1
  1932.        -------------         ---------------------------
  1933.        | o o o o o |         | o o o o o o o o o o o o |
  1934.         \ o o o o /           \ o o o o o o o o o o o /
  1935.          ---------             -----------------------
  1936.       pin 9     pin 6      pin 25                   pin 14
  1937.  
  1938.  
  1939.      Use flexible 4-wire cable to connect the four contacts of your HP48
  1940.      connector to the PC connector.  Pin 1 of the HP48 should be
  1941.      connected to the metal shield of the RS232 connector.  Usually it
  1942.      is not easy to solder this shield; first scratching the shield bare
  1943.      (it has some kind of coating) using a screwdriver or a file will
  1944.      help.  If this doesn't work, simply leave pin 1 of the HP48
  1945.      disconnected.  Note that pins 2 and 3 of the RS232 connector must
  1946.      be swapped when you use a 25-pin connector.
  1947.  
  1948.      Before connecting the completed cable to your HP48, check for
  1949.      short-circuits using an ohmmeter or multimeter set to ohms or
  1950.      "diode test".  The HP48 has a built in serial loop back test that
  1951.      can be used to test the serial cable (see the question regarding
  1952.      the ON-KEY combinations).
  1953.  
  1954.      After you are done, close the shield and connector, and put in all
  1955.      the screws.  You should now have a HP<-->PC link, which functions
  1956.      on COM (serial) ports.
  1957.  
  1958.  
  1959.      Using the Link
  1960.         With the link finished, it is now ready to be tested.  Download
  1961.         some programs (such as those in the Best Program List) that you
  1962.         wish to try.  At some point you should go to
  1963.         <http://www.columbia.edu/kermit/> to obtain the version of
  1964.         Kermit that suits you best.
  1965.  
  1966.         However, if you have an alternate communications program (for
  1967.         example, Windows 95 comes with HyperTerminal which you can use)
  1968.         you can delay downloading Kermit.  However, it is a highly
  1969.         recommended to obtain because certain programs for the HP48 use
  1970.         special features in Kermit (such as server mode) not available
  1971.         in other communications programs.
  1972.  
  1973.         With this done, you can begin the actual transfers.  Start your
  1974.         communications program, and set the port to COM1 (or whatever
  1975.         your link is plugged into).  In Kermit, you would type "SET PORT
  1976.         COM1" and in HyperTerminal you would set the dialog box with the
  1977.         choice of what modem you want to use to "Direct to COM1".
  1978.  
  1979.         Then change the speeds of the ports to 9600.  In Kermit, type
  1980.         "SET SPEED 9600" and in Hyperterminal click on Advanced.
  1981.  
  1982.         On the HP, go to I/O, and go to Transfer.  Set the calculator to
  1983.         Wire, 9600 baud, and Kermit (or X-Modem, if you using it
  1984.         instead). Then, get ready for to receive a file.  Note that X-
  1985.         Modem is much faster than Kermit in most situations, especially
  1986.         in long transfers.  However, it is not available built-in on the
  1987.         S/SX.
  1988.  
  1989.         On the PC start sending, and on the HP, start receiving.  You
  1990.         should see the transfer arrow on the upper right of the screen
  1991.         on the HP, and it should be flashing.  On the PC, you should see
  1992.         a progress indicator to show how much of the file has been
  1993.         transferred.
  1994.  
  1995.         When the transfer is finished, check that you received what you
  1996.         expected.  If it what you expected, your HP<-->PC link works!
  1997.  
  1998.  
  1999.      HP to HP Cable
  2000.         If you want to use 9600 bps communication between two HP48s,
  2001.         then make two HP48 connectors and simply connect the two,
  2002.         swapping pins two and three.
  2003.  
  2004.  
  2005.           HP to HP cable
  2006.  
  2007.           HP#1 | HP#2
  2008.           -----+-----
  2009.             1  |  1
  2010.             2  |  3
  2011.             3  |  2
  2012.             4  |  4
  2013.  
  2014.  
  2015.      Warranty, Disclaimer, etc...
  2016.         Although the serial interface of the HP48 is protected
  2017.         internally, it is possible to damage the calculator when a wrong
  2018.         connection is made.  I am not responsible for any errors in this
  2019.         file, or for any mistakes you may make.
  2020.  
  2021.   From: Deborah Lynn Williams
  2022.  
  2023.   I made an HP48 link out of four pieces of speaker wire and serial port
  2024.   plug.  The wiring of the plug is available above.  The connection to
  2025.   the HP plug is the difficult part.
  2026.  
  2027.   I took 4 pieces of stranded speaker wire and cut them so that the wire
  2028.   and the insulation were even.  I then took a paper clip and pushed it
  2029.   into the this open end, making a space between the wire and the
  2030.   insulation.  I then had to trim some of the strands that were sticking
  2031.   out.  I then just pushed this onto the pins in the HP48 port.  It
  2032.   isn't a very strong connection, but it works fine if you don't jostle
  2033.   it.
  2034.  
  2035.   The other ends of these speaker wires I connected to the serial plug.
  2036.   Just remember to label which wires go to which pin, or make them all
  2037.   different lengths.
  2038.  
  2039.   From: John Cutter
  2040.  
  2041.   Another cheap source for cables is the common serial mouse for PC-
  2042.   compatibles.  I had a cheap one on which the button gave out after 2
  2043.   weeks of use, so I opened it up.  It had a serial 9 pin cable that
  2044.   disappeared into the mouse.  Once open, there was a 4 pin 2 mm
  2045.   connector plugged into the mouse's circuit board.  All I had to do was
  2046.   reverse two pins inside the connector, and it's been working fine
  2047.   since.  I also noticed that Logitech mice have 6 pin 2 mm connectors,
  2048.   which could also be adapted.  No soldering or crimping here!
  2049.  
  2050.  
  2051.   12.2.  Using a modem with the HP48
  2052.  
  2053.   From: Diego Berge
  2054.  
  2055.   My purpose here is to explain in some detail the steps you need to
  2056.   follow to be able to transmit data via modem with the HP48.  Another
  2057.   related document is
  2058.   <http://www.freeweb.org/freeweb/enrico/hp2modem.htm> by Enrico Carta.
  2059.  
  2060.   In order to successfully connect your HP48 calculator to a modem, the
  2061.   first thing you need is a 'Null Modem Cable'.  A null modem cable is
  2062.   like a regular serial cable, except that two of its lines are crossed.
  2063.  
  2064.   You might wonder: So why is it different connecting to a PC than
  2065.   connecting to a modem?  Well, data communication devices can be
  2066.   classified in two groups: Devices which GENERATE or RECEIVE
  2067.   information, and devices which merely TRANSMIT information.  The
  2068.   former are called Data Terminal Equipment (DTE), PCs are an example of
  2069.   DTE; the later is called Data Communication Equipment (DCE), and are
  2070.   primarily modems.  Now, when PCs were designed, it seems like they
  2071.   didn't think somebody would ever want to hook two DTEs directly, as a
  2072.   result, in a typical PC all we have (besides the parallel printer
  2073.   port) is an RS-232 port, which is intended for connecting a DCE.  So
  2074.   when a machine wants to connect to a PC, its port must be that of a
  2075.   DCE, even if it otherwise acts as a DTE.  Within that class of hybrids
  2076.   fall HP48s, Psions, some (or most?) serial printers, mice, and a long
  2077.   etcetera.
  2078.  
  2079.   Remember, the RS-232 communication scheme is:
  2080.  
  2081.  
  2082.        DTE <--- DCE === DCE ---> DTE
  2083.  
  2084.  
  2085.   If you want to  link two DTE together, you must 'simulate' a DCE;
  2086.   that's what a Null Modem Cable is for.  It's called 'Null' because it
  2087.   (the modem) does not actually exist, and 'Modem' because it acts like
  2088.   if there was one.  To build a Null Modem Cable for the 48, assuming
  2089.   that you already have a regular cable, you'll need two MALE RS-232C
  2090.   connectors, at least one of which must be a DB-9 (9-pin), and a short
  2091.   piece of mouse cable or similar (some 3 inches should do) (If you
  2092.   don't have a regular cable, I recommend that you get one).  The wiring
  2093.   must be as shown here:
  2094.  
  2095.  
  2096.                 CONNECTOR 'A'                             CONNECTOR 'B'
  2097.                                                  pin#:      3   2   7     (DB-25)
  2098.        pin#:      2   3   5                      pin#:      2   3   5     (DB-9)
  2099.        name:     TX  RX  GND                     name:     TX  RX  GND
  2100.                   |   |   |                                 |   |   |
  2101.                   |   |   |                                 |   |   |
  2102.                   |   |   +---------------------------------|---|---+
  2103.                   |   |                                     |   |     ( <<< and
  2104.                   |   +------------------>>>----------------+   |      >>> show
  2105.                   |                                             |  direction of
  2106.                   +----------------------<<<--------------------+          data )
  2107.  
  2108.  
  2109.   The pin number should be embossed near the pin itself in the
  2110.   connector.
  2111.  
  2112.   Once the physical part is done, which in most cases will be the most
  2113.   critical, you're ready to try out your brand-new, state-of-the-art,
  2114.   $2.25 null modem cable.  Plug it between your regular HP48 cable and
  2115.   your modem, turn the modem on (please don't forget this part :), and
  2116.   on the 48 type in:
  2117.  
  2118.  
  2119.        [RightShift]+[""] [alpha] [alpha] AT [ENTER]
  2120.        13 [LeftShift]+[CHARS] [CHR] [+]
  2121.  
  2122.  
  2123.   In stack level 1 you should have (# is a little black square):
  2124.  
  2125.  
  2126.        1: "AT#"
  2127.  
  2128.  
  2129.   Now type:
  2130.  
  2131.  
  2132.        [LeftShift]+[I/O] [NXT] [SERIAL] [XMIT] [BUFLEN] [DROP] [SRECV]
  2133.  
  2134.  
  2135.   you should get:
  2136.  
  2137.  
  2138.        2: "AT###OK##"
  2139.        1: 1
  2140.  
  2141.  
  2142.   If this test goes wrong, try two or three more times.  If it still
  2143.   fails, check your cable(s), check that the 48 can transmit and receive
  2144.   to/from the PC, do the same with your modem.  And when everything else
  2145.   has failed anyway, connect your modem to the PC, crank up a terminal
  2146.   program (as Terminal / Hyperterminal, or Kermit's 'Connect' command),
  2147.   and type:
  2148.  
  2149.  
  2150.        AT&D0 [ENTER]
  2151.  
  2152.  
  2153.   the modem should respond:
  2154.  
  2155.  
  2156.        OK
  2157.  
  2158.  
  2159.   This tells the modem to ignore the DTR signal from the host, which the
  2160.   48 can't supply.  Try again with the calculator, if it works, go back
  2161.   to the terminal and type:
  2162.  
  2163.        AT&W0&Y0 [ENTER]
  2164.  
  2165.  
  2166.   to save the current modem configuration as default.  If it has not
  2167.   worked so far, I can't help you.
  2168.  
  2169.   Assuming you've got it to work, now all you have to do is learn a few
  2170.   modem commands to dial and, possibily, hang up.  In general, modem
  2171.   commands start with the two-character sequence 'AT' (no quotes) and
  2172.   end with a single <CR> character (dec 13), <LF> is optional.
  2173.  
  2174.   To dial a number use:
  2175.  
  2176.  
  2177.        ATDT12345<CR>
  2178.  
  2179.  
  2180.   where 12345 should be replaced by the actual number.  For example:
  2181.  
  2182.  
  2183.        [RightShift]+[""] [alpha] [alpha] ATDT0800890011 [ENTER]
  2184.        13 [LeftShift]+[CHARS] [CHR] [+] [LeftShift]+[I/O] [NXT] [SERIAL] [XMIT]
  2185.  
  2186.  
  2187.   dials the AT&T Direct access number for the UK.
  2188.  
  2189.   If your line is not connected to a digital switchboard, you may need
  2190.   to dial by pulses, then you should use instead:
  2191.  
  2192.  
  2193.        ATDP12345<CR>
  2194.  
  2195.  
  2196.   Next thing you'll probably ask is: 'How do I know that I'm connected?'
  2197.  
  2198.   If the modem has successfully established a connection, it should
  2199.   respond in most cases with a message like:
  2200.  
  2201.  
  2202.        CONNECT 9600/V34/LAPM/V42BIS/9600:TX/9600:RX
  2203.  
  2204.  
  2205.   or simply "1" if its not in the default verbose mode. Also, if the
  2206.   modem has a 'CD' indicator, it'll usually light up.  To find out via
  2207.   the calculator whether it's connected or a problem has occurred, use
  2208.   the following keystrokes:
  2209.  
  2210.  
  2211.        ( [LeftShift]+[I/O] [NXT] [SERIAL] )
  2212.        [BUFLEN] [DROP] [SRECV]
  2213.  
  2214.   repeatedly until a non-empty string appears in level 2.  Some common
  2215.   messages are:
  2216.  
  2217.  
  2218.        verbose:         non-verbose:
  2219.  
  2220.        CONNECT                    1
  2221.        NO CARRIER                 3
  2222.        ERROR                      4
  2223.        NO DIALTONE                6
  2224.        BUSY                       7
  2225.        NO ANSWER                  8
  2226.        DELAYED                   24
  2227.  
  2228.  
  2229.   Once you get the CONNECT message, you're ready to send any data you
  2230.   want to the remote host as you'd usually do.  I personally use Kermit
  2231.   this way when I'm not in the office or at home.
  2232.  
  2233.   Finally, when you're done you'll want to hang up the line.  The
  2234.   simplest way is turn the modem off, which I recommend.  But if you
  2235.   want to instruct the modem to hang up, the process usually is:
  2236.  
  2237.   (wait at least 1 sec without sending any data)
  2238.  
  2239.  
  2240.        [RightShift]+[""] [alpha] [alpha] +++ [ENTER]
  2241.        [LeftShift]+[I/O] [NXT] [SERIAL] [XMIT]
  2242.  
  2243.  
  2244.   (wait at least 1 sec without sending any data)
  2245.  
  2246.  
  2247.        [RightShift]+[""] [alpha] [alpha] ATH [ENTER]
  2248.        13 [LeftShift]+[CHARS] [CHR] [+] [LeftShift]+[I/O] [NXT] [SERIAL] [XMIT]
  2249.  
  2250.  
  2251.   Note, however, that this, as most of what I have said here about modem
  2252.   commands, might vary depending on each modem's particular brand, model
  2253.   and configuration.  You may need to read your modem's manual for more
  2254.   details.
  2255.  
  2256.   Disclaimer: As you'd expect, I take no responsibility for anything you
  2257.   may break, twist, cut, slice, burn, hurt, or otherwise damage while
  2258.   following these instructions.
  2259.  
  2260.  
  2261.   12.3.  Additional Information on the HP48 and RS-232
  2262.  
  2263.   From: John Meyers
  2264.  
  2265.   You can't connect the HP48 to anything else until you have first
  2266.   plugged in its cable, which finally brings the HP48's serial
  2267.   connections out to a DB9 connector.  At that point, the HP48,
  2268.   including its attached cable, is clearly configured as DCE (the same
  2269.   as a modem), so you need a "crossover" (such as a "null-modem
  2270.   adapter") to connect the HP48 to a modem.
  2271.   12.4.  Using Non-HP RAM Cards
  2272.  
  2273.   If you use RAM cards that are NOT designed for the HP48, it is
  2274.   possible to severely damage your HP48.  If you want to be safe, you
  2275.   should only use RAM cards designed for the HP48.
  2276.  
  2277.   Here is an edited discussion from comp.sys.handhelds.
  2278.  
  2279.  
  2280.   From steveh@hpcvra.cv.hp.com Fri Mar  1 17:00:00 1991
  2281.   From: steveh@hpcvra.cv.hp.com (Steve Harper)
  2282.   Date: Thu, 10 May 1990 22:46:09 GMT
  2283.   Subject: RE: HP48 SX Memory Card Pricing
  2284.   Organization: Hewlett-Packard Co., Corvallis, OR, USA
  2285.  
  2286.  
  2287.   There has been a substantial amount of comment regarding the memory
  2288.   cards for the HP48 SX and their prices.  My purpose in this response
  2289.   is not to attempt to justify any particular price, but rather to
  2290.   present the technical reasons why there is a substantial price
  2291.   difference between the memory cards and other types of expansion
  2292.   memory for PC's, for example, with which users are probably more
  2293.   familiar.
  2294.  
  2295.   Some users have correctly pointed out that the memory in the cards is
  2296.   static RAM rather than dynamic RAM commonly used in PC's.  Dynamic RAM
  2297.   uses one transistor and a capacitor for each bit of memory whereas
  2298.   static RAM requires either four transistors and two resistors, or six
  2299.   transistors.  The net result is that an equivalent amount of static
  2300.   RAM is much larger and therefore much more expensive than dynamic RAM.
  2301.   The advantage is that static RAM doesn't need to continually be
  2302.   running and drawing current (refresh cycles) to retain the contents of
  2303.   memory.
  2304.  
  2305.   In addition, the static memory used in the cards is not just any
  2306.   static memory, but is specially processed and/or selected for very low
  2307.   standby current.  This allows the backup battery in the card to keep
  2308.   memory alive for a very long time, rather than requiring the user to
  2309.   replace it every few months.  The special processing and/or special
  2310.   testing to select low current parts adds to the already higher cost of
  2311.   the static RAM chips.
  2312.  
  2313.   The standard molded plastic DIP package used for most integrated
  2314.   circuits, including memory chips, is relatively inexpensive because of
  2315.   its simplicity and the huge volumes.  Unfortunately, these packages
  2316.   are too large to put into a memory card.  Therefore, the card
  2317.   manufacturer mounts the individual silicon memory chips directly on a
  2318.   special thin PC board together with the memory support chips.  Because
  2319.   multiple chips are being placed in a single hybrid package in a
  2320.   special process which has lower volume, yields are lower and this
  2321.   again causes the cost to be higher.  Indeed, the yield becomes
  2322.   exponentially worse as the number of chips and interconnections
  2323.   increases in such a packaging process.
  2324.  
  2325.   In addition to the memory chips themselves, two more integrated
  2326.   circuits and several discrete components are required for power and
  2327.   logic control.  A bipolar technology chip senses the external voltage
  2328.   and switches the power to the chips from the internal keep-alive
  2329.   battery as needed.  A CMOS gate array chip protects the memory address
  2330.   and data lines from glitches/ESD when the card is not plugged in.
  2331.   This chip also generates the proper enabling signals when there are
  2332.   multiple memory chips in the card, as is presently the case with the
  2333.   128 Kbyte RAM card.  These chips must be designed for extremely low
  2334.   current, just as the memory chips are.
  2335.  
  2336.   In addition to the battery and the battery holder, the other
  2337.   mechanical parts are important, too.  The molded plastic frame holds
  2338.   the PC board and provides the foundation for the metal overlays and
  2339.   the shutter-and-springs assembly which protects the contacts from ESD
  2340.   and from contaminants.  The write-protect switch is also an important
  2341.   feature.  It is quite expensive for the manufacturer to make the tools
  2342.   necessary to fabricate each of these parts as well as the tools to
  2343.   assemble and test the complete card.  While the volume of memory cards
  2344.   is relatively low this tooling cost represents a significant part of
  2345.   the cost of each card.
  2346.  
  2347.   Admittedly, there are other alternatives, such as those presently used
  2348.   in PC's, to provide a memory expansion capability.  To provide that
  2349.   kind of expansion would require the calculator to be much larger than
  2350.   it is and possibly more expensive.  This is clearly very undesirable.
  2351.  
  2352.   Other features that were felt to be essential were the ability to
  2353.   distribute software applications and to share and archive/backup user-
  2354.   created programs and data.  Other expansion alternatives  do not
  2355.   provide these important benefits.  The I/O capabilities of the
  2356.   calculator provide these features only to a limited degree.
  2357.  
  2358.   One other item bears repeating here: Memory cards for use in the
  2359.   calculator will clearly indicate that they are for use with the HP48
  2360.   SX.  Other memory cards exist which are mechanically compatible with
  2361.   the HP48 S, but these cards cannot be relied upon to work electrically
  2362.   in the calculator.  The HP48 SX cards are designed for a lower supply
  2363.   voltage range.  Use of the other cards may cause memory loss, and
  2364.   under certain circumstances may even damage your calculator
  2365.   electrically.
  2366.  
  2367.  
  2368.   From steveh@hpcvra.cv.hp.com Fri Mar  1 17:00:00 1991
  2369.   From: steveh@hpcvra.cv.hp.com (Steve Harper)
  2370.   Date: Fri, 11 May 1990 16:52:07 GMT
  2371.   Subject: Re: Memory Card: Give Us True Facts!
  2372.   Organization: Hewlett-Packard Co., Corvallis, OR, USA
  2373.  
  2374.  
  2375.   My previous statement that under certain circumstances the calculator
  2376.   may even be damaged electrically is not a ploy.  If the calculator's
  2377.   internal power supply voltage happens to be near the low end of the
  2378.   range, say 4.1 V, and the voltage at which the card's voltage control
  2379.   chip shuts it down happens to be near the high end of its range, say
  2380.   4.2 V (this can and does occasionally occur for the non-HP48 SX
  2381.   cards), then the calculator will start to drive the memory address
  2382.   lines and the card will still have these clamped to ground (that's
  2383.   what it does to protect itself when there is not sufficient system
  2384.   voltage to run).  This unfortunate situation may simply trash your
  2385.   memory, or if the calculator tries to drive enough of the lines high
  2386.   at the same time, several hundred milliamps may flow...for awhile that
  2387.   is, until something gives up...  On the other hand, your calculator
  2388.   and a particular non-HP48 SX card may work just fine if those voltages
  2389.   happen to be at the other end of their ranges.  These voltages are
  2390.   also slightly temperature sensitive.  It may work in the classroom or
  2391.   office and not at the beach, or vice versa.  The voltage trip point of
  2392.   the HP48 SX cards has been set lower (a different voltage control
  2393.   chip) so that this cannot occur, regardless of part and temperature
  2394.   variations.
  2395.  
  2396.   One other item was brought to my attention yesterday by Preston Brown
  2397.   that I should have included in my original posting here.  While most
  2398.   of us recognize that comparing RAM cards to a handful of dynamic RAM
  2399.   chips to plug into your PC is apples and oranges, it may be more
  2400.   interesting to compare the HP48 SX cards with cards for other
  2401.   products, like the Atari Portfolio, the Poquet, the NEC Ultralite,
  2402.   etc.  I believe you will find that the prices on the HP48 SX cards are
  2403.   not at all out of line.
  2404.  
  2405.   Steve "I claim all disclaimers..."
  2406.  
  2407.  
  2408.   From prestonb@hpcvra.cv.hp.com Fri Mar  1 17:00:00 1991
  2409.   From: prestonb@hpcvra.cv.hp.com (Preston Brown)
  2410.   Date: Thu, 17 May 1990 17:26:53 GMT
  2411.   Subject: Re: Memory Card: Give Us True Facts!
  2412.   Organization: Hewlett-Packard Co., Corvallis, OR, USA
  2413.  
  2414.  
  2415.   When the RAM cards detect that voltage is to low to operate they clamp
  2416.   the address lines to ground.  This clamping is done by turning on the
  2417.   output drivers of a custom chip included on the card.  The clamping
  2418.   current is specified to be 2mA min at the Vol output level.  Since the
  2419.   48 can be trying to drive the line all the way high even more current
  2420.   is typical.  10mA per fight is not uncommon with totals of several
  2421.   hundred mAs.
  2422.  
  2423.   The VDD power supply is regulated at 4.1 - 4.9 with typical parts at
  2424.   the low end (4.3).  The power to the cards is switched through a
  2425.   transistor, creating up to a 0.1V drop.  Standard Epson cards have a
  2426.   significant chance of seeing this voltage as to low and shutting down.
  2427.   We have seen cards do this in the lab.  When it occurs the calculator
  2428.   locks up with VDD pulled down to about 2.5V and 250mA being drawn from
  2429.   the batteries.  This current drain greatly exceeds the ratings for the
  2430.   power supply and can damage your calc.  The least that will happen is
  2431.   a loss of memory.
  2432.  
  2433.   Now, why didn't we regulate VDD higher?  The 48 has two power supplies
  2434.   VDD at 4.3 and VH at 8.5.  VH cannot be regulated higher without
  2435.   exceeding the spec for our CMOS IC process.  VH is used as the +
  2436.   voltage for the I/O.  In order to meet a +3V output level VH must be
  2437.   more then 3.6V above VDD.  (VDD is used as I/O ground).  Our power
  2438.   supply system increase the battery life and reduces the cost greatly
  2439.   for the wired I/O.
  2440.  
  2441.   Preston
  2442.  
  2443.  
  2444.   12.5.  Where can one obtain third party RAM cards?
  2445.  
  2446.   If you decide you want to look into the non-mainstream alternatives
  2447.   for RAM cards, you might like to check the following URLs:
  2448.  
  2449.  
  2450.   o  <http://www.cynox.de/>
  2451.  
  2452.   o  <http://stolte-edv.com/de/>
  2453.  
  2454.   o  <http://www.cyberline.de/kkgbr/>
  2455.  
  2456.   o  <http://www.Digitalis.de/>
  2457.  
  2458.   o  <http://home.t-online.de/home/FFFFF/>
  2459.  
  2460.   o  <http://www.geocities.com/Eureka/Enterprises/3190/>
  2461.  
  2462.  
  2463.  
  2464. -----BEGIN PGP SIGNATURE-----
  2465. Version: PGPfreeware 5.0i for non-commercial use
  2466. Charset: noconv
  2467.  
  2468. iQA/AwUBNz8oQOhzXOws+qC7EQKLNACfdCHbhGSpsjKRoxJB1FlyIgTmU1MAn37G
  2469. 3ET/SX5Luix7oTUtkKnLB89p
  2470. =qFFu
  2471. -----END PGP SIGNATURE-----
  2472.  
  2473.