HP48 Frequently Asked Questions List (FAQ) Andre Schoorl v4.62, 14 April 2000 Answers to Frequently Asked Questions about HP48 calculators 3.2. What is the difference between the HP48 G/GX and the HP48 S/SX? The HP48 G/GX calculators are, basically, slightly faster (by 40%) versions of the HP48 S and HP48 SX calculators, with more features, such as 3D-plotting and a new forms-based interface. Much of the HP Solve Equation Library card is now built-in. See Appendix B-1 for a detailed list of GX features. Note, however, that the HP48 G/GX is different from the HP48 S/SX in a number of significant areas: 1. The HP48 GX comes with 128KB RAM, as opposed to 32KB RAM in the HP48 SX. The HP48 G still has 32KB RAM, however. The HP48 G/GX also has twice the ROM (512K), compared the HP48 S/SX (256K). 2. Much of the HP48 G/GX internals have changed, compared with the HP48 S/SX. Unfortunately, this means that many programs written in assembly language or System RPL won't work on the HP48 G/GX. This is especially true of any program that tried to access the display memory directly. 3. The HP48 G/GX CPU runs at 4 MHz, instead of the 2 MHz used with the HP48 S/SX CPUs. However, due to various overheads (memory bank switching, etc.), the speed increase between the S/SX and G/GX is less than 2 times. G/GX throughput is approximately 40% faster. 4. Slot 2 of the HP48 GX can access up to 32 ports (ports 2-33) by bank switching. Each port is 128KB, for a maximum total of 4 MB in slot 2. 10. Appendix B: GX Specific Information 10.1. What's new in the HP48 G/GX? From: Joe Horn AUTOMATIC LIST PROCESSING Almost all commands that did not accept list(s) as their arguments can do so now. Here are just a few examples: { 1 2 3 } SF sets flags 1, 2, and 3 { 1 2 3 } SQ --> { 1 4 9 } { 2 4 } 10 / --> { .2 .4 } 10 { 2 4 } / --> { 5 2.5 } { 10 12 } { 2 4 } / --> { 5 3 } { .1 .2 .5 } ->Q --> { '1/10' '1/5' '1/2' } { freq freq ...} { dur dur ... } BEEP can play a song with no audible hiccup between tones. Since + has always been used to concatenate lists, a new ADD func- tion exists to add the elements of two lists, like this: { 1 2 3 } { 4 5 6 } ADD returns { 5 7 9 }, whereas { 1 2 3 } { 4 5 6 } + returns { 1 2 3 4 5 6 } as it did before. The only commands which do not have automatic list processing are: o those which never get a Bad Argument Type error (like DUP), o meta-object commands (like ROLL), o program branch structures (like FOR), and o commands that specifically work on lists (like GET). Sometimes the results are non-obvious, for example: 5 { A B C } STO --> A=5, B=5, C=5 { 5 6 7 } 'A' STO --> A={ 5 6 7 } (same as on SX) { 5 6 7 } { A B C } STO --> A=5, B=6, C=7 List processing is only recursive for ->Q and ->Qpi. PORTS AND MEMORY The HP48 G, like the 48 S, only has 32K RAM. The GX, unlike the SX, has 128K RAM built-in. Card slot 1 can contain another 128K (maximum), but card slot 2 can contain up to 4 megabytes of RAM. Only port 1 can be merged in the GX. Card slot 2, which is intended for large-capacity RAM cards, is permanently "free", and is automatically divided up into 128K "ports", each of which becomes Port 2, Port 3, Port 4, etc. Up to 4 Megabytes can be plugged into slot 2, which would then become Port 2 through Port 33. (Although the FREE and MERGE commands were kept for HP48 SX compatibility, GX users will prefer the new FREE1 and MERGE1 commands). Therefore the maximum amount of merged main memory is 256K (unlike the SX which allowed up to 288K) after MERGE1; the maximum amount of fully online free independent memory is 4224K after FREE1. LOCAL VARIABLES Variable names prefixed with a <- (backarrow character) are compiled as local (temporary) variable name objects even if they're not explicitly after FOR or ->. This allows programs to share values through local variables, which is much faster than sharing values through global variables, and they get purged automatically. SPEED CPU clock speed is double the S/SX's, but throughput is estimated to be only 40% faster, primarily due to the fact that all RAM & ROM is now bankswitched (on the S/SX only a 32K portion of the ROM required bank switching), and it still has the same 4-bit bus bottleneck. IMPROVED COMMANDS: o AXES can now also specify the spacing of the tick marks. o DEPND can now also specify the initial values and tolerance for the new DIFFEQ plot type. o REPL and SUB now work on arrays. HP SOLVE EQUATION LIBRARY CARD COMMANDS: o AMORT, amortization calculations o CONLIB, starts Constants Library catalog o CONST, returns value of a named CONLIB constant o DARCY, calculates Darcy friction factor o EQNLIB, starts Equation Library catalog o F0lambda, calculates black-body power fraction o FANNING, calculates Fanning friction factor o LIBEVAL is a generalized form of the EQ card's ELSYSEVAL; it executes any XLIB by its library number o MCALC, marks an MSOLVR variable as "not user-defined" o MINEHUNT, starts the "Minehunt" video game o MINIT, initializes Mpar from 'EQ' for MSOLVR o MITM, customizes title & menu of MSOLVR's screen o MROOT, solve for variable(s) in MSOLVR o MSOLVR, shows Multiple Equation Solver menu o MUSER, marks an MSOLVR variable as "user-defined" o SIDENS, density of silicon as function of temperature o SOLVEQN, starts solver for specified EqLib equation(s) o TDELTA, subtracts temperatures like "-" ought to but doesn't o TINC, adds temperatures like "+" ought to but doesn't o TVM, shows the financial calculator (Time Value of Money) menu o TVMBEG, sets payments-at-beginning-of-periods mode o TVMEND, sets payments-at-end-of-periods mode o TVMROOT, solves for a TVM variable o ZFACTOR, calculates gas compressibility factor Z Note: The EQ Card's Periodic Table and Tetris game are not in the HP48 G/GX, but the EQ Card can be used in the GX if those applications are needed. Tetris was not included because no agreement on royalty was reached. The Periodic Table is available separately as freeware on HPCVBBS. NEW ARRAY COMMANDS: o COL+, inserts a column vector into a matrix or a number into a vector (like INSCOL/PUTCOL in Donnelly's Tool Library) o COL-, deletes a column from a matrix or number from a vector (identical to DELCOL in Donnelly's Tool Library) o COL->, combines multiple column vectors into a matrix o ->COL, breaks a matrix into multiple column vectors (like repeated GETCOL in Donnelly's Tool Library) o COND, column norm condition number of a square matrix o CSWP, swaps two columns in a matrix (like EXCOL in Donnelly's Tool Library) o ->DIAG, returns vector of major diagonal elements of a matrix o DIAG->, creates matrix with specified diagonal elements o EGV, eigenvalues and right eigenvectors of a square matrix o EGVL, eigenvalues of a square matrix o FFT, discrete Fourier transform o IFFT, inverse discrete Fourier transform o LQ, returns the LQ factorization of a matrix o LSQ, minimum norm least-squares solution to an ill-determined system of linear equations o LU, returns the Crout LU decomposition of a square matrix o PCOEF, returns polynomial with given roots (inverse of PROOT) o PEVAL, evaluates polynomial at x o PROOT, finds all roots of polynomial (inverse of PCOEF) o QR, returns QR factorization of a matrix o RANK, rank of a rectangular matrix (uses flag -54) o RANM, creates matrix with random elements o RCI, multiplies elements in one row of a matrix by a scalar o RCIJ, does RCI then adds the result to a row o ROW+, inserts a row vector into a matrix or a number into a vector (like INSROW/PUTROW in Donnelly's Tool Library) o ROW-, deletes a row from a matrix or number from a vector (identical to DELROW in Donnelly's Tool Library) o ROW->, combines multiple row vectors into a matrix o ->ROW, breaks a matrix into multiple row vectors (like repeated GETROW in Donnelly's Tool Library) o RSWP, swaps two rows in a matrix (identical to EXROW in Donnelly's Tool Library) o SCHUR, computes the Schur decomposition of a square matrix o SNRM, spectral norm of an array o SRAD, spectral radius of a square matrix o SVD, singular value decomposition of a matrix o SVL, computes the singular values of a matrix o TRACE, sum of diagonal elements of a square matrix GRAPHICS and PLOTTING COMMANDS: o ANIMATE, displays grobs on the stack sequentially. You can use the defaults, or specify your own delay between frames (can be very fast), the number of times to repeat the sequence, and even the pixel coordinates. It's just like a ROLL REPL loop... except very fast. Note: Charlie Patton converted 17 seconds of the Apollo moon-walk video into HP48 GROBs and ran them with ANIMATE, and it looked very good! o ATICK, specifies tick spacing on plot axes o EYEPT, specifies the eye-point coordinates in a perspective plot o GRIDMAP, selects the new "gridmap" plot type o PARSURFACE, selects the new "parametric surface" plot type o PCONTOUR, selects the new "pcontour" plot type o PICTURE, same as GRAPH command o SLOPEFIELD, selects the new "slopefield" plot type o WIREFRAME, selects the new "wireframe" plot type o XVOL, sets the width of the 3D plotting volume o XXRNG, sets the width of the 3D target mapping range for gridmap and parametric surface plots o YSLICE, selects the new "yslice" plot type o YVOL, sets the depth of the 3D plotting volume o YYRNG, sets the depth of the 3D target mapping range for gridmap and parametric surface plots o ZVOL, sets the height of the 3D plotting volume USER-INTERFACE COMMANDS: o CHOOSE, displays a point-and-click menu "dialog box" o INFORM, formatted multi-line input with named fields (nice!!) o MSGBOX, displays text in a centred box with shadow, then WAITs o NOVAL, placeholder for unspecified values in INFORM argument list LIST PROCESSING COMMANDS: o ADD, adds lists element-wise (see section above) o DOLIST, evals an object on multiple lists o DOSUBS, evals a program or command taking arguments from a list o ENDSUBS, returns the number of loops the current DOSUBS will do o HEAD, first element in a list or first char in a string (identical to CAR in Donnelly's Tool Library) o DeltaLIST, list of first finite differences of list objects o SigmaLIST, sum of the elements in a list o PiLIST, product of the elements in a list o NSUB, returns the current list pointer value during a DOSUBS o REVLIST, reverses the order of the objects in a list (like REVERSE in Donnelly's Tool Library) o SEQ, list of results from repeated execution of an object (like a FOR/STEP loop but the results go into a list) o SORT, sorts elements in a list into ascending order, or sorts a list of lists using each list's first element as the key (can be done with LSORT/QSORT in Donnelly's Tool Library) o STREAM, executes an object on first two elements of a list, then again on the result and the 3rd element, etc. Allows easy creation of things similar to SigmaLIST and PiList. o TAIL, returns a decapitated list or string (see HEAD above) (identical to CDR in Donnelly's Tool Library) SYSTEM COMMANDS: o CLTEACH, clears the 'EXAMPLES' directory created by TEACH o CYLIN, sets polar/cylindrical coordinate mode o FREE1, like 1 FREE (see section above) o MERGE1, like 1 MERGE (see section above) o PINIT, port initialize, esp. important for 4-Meg RAM card users o RECT, sets rectangular coordinate mode o SPHERE, sets polar/spherical coordinate mode o TEACH, loads the Owner's Manual examples into a dir in HOME o VERSION, returns the operating system ROM version string and a copyright notice, like this: 2: "Version HP48-R" <-- means version "R" 1: "Copyright HP 1993" o XRECV, X-Modem protocol receive (binary mode only) o XSEND, X-Modem protocol send (binary mode only) MATH COMMANDS: o LININ, tests whether an equation is linear in a given variable o NDIST, normal probability density o PCOV, population covariance of SigmaDAT o PSDEV, population standard deviation of SigmaDAT o PVAR, population variance of SigmaDAT o RKF, solves initial value problem using Runge-Kutta-Fehlberg o RKFERR, change in solution and absolute error using RKF o RKFSTEP, next solution step with given error tolerance using RKF o RRK, solves initial value problem using Rosenbrock & RKF o RRKSTEP, next solution step with given error tolerance using RRK o RSBERR, change in solution and absolute error using Rosenbrock MENU NUMBERS and KEY CODES Many menu numbers have changed, so software that uses # MENU or # TMENU may not work the same as in the HP48 S/SX. (Specifically, only menu numbers 0-3, 28, 30, and 42-59 are the same). Likewise, almost all of the shifted keycodes correspond to new commands and menus, which programmers must take into account; for example, the "RAD" key on the S/SX had the keycode 82.2, but it's 21.2 on the G/GX. The left-shift key, which was orange on the S/SX, is now purple [officially "lavender"], and the right-shift key which was blue on the S/SX is now green [officially "teal"] on the G/GX. Also, the digit-key menus can be activated by both shift keys; left-shift gives the softkey menus like in the S/SX, but the right-shift gives the new user- friendly full-screen menus. The unshifted keys remain identical to the S/SX, except for a cosmetic colour change to match the very dark green of the calculator case. MANUALS The G/GX comes with two manuals, a "Quick Start Guide" for beginners, and a cost-cutting, slimmer owner's manual called the "User's Guide" which has only 21 pages about programming, since HP figures that the huge majority of all 48 owners never program it anyway. The power users can buy the optional "Advanced Users Reference Manual" (similar to the S/SX's "Programmer's Reference Manual") which covers programming and the many commands that are not mentioned in the User's Guide. There is no "Quick Reference Guide" like the S/SX came with, although the case still has a pocket for one. Jim Donnelly has marketed a nice pocket guide, but it's too wide to fit in the case's pocket. The User's Guide is not spiral bound, but is made to open fully and last a long time, since it's not just glued but has sewn signatures like real books, and is printed on quality paper. Another possibility is "The HP 48G/GX Pocket Guide" by Chris Coffin and Thomas Dick (Grapevine Publications). It's 80 pages long, contains a complete command reference (with input/output stack diagrams), alpha keyboard description, system flag description, as well as examples of how to use various calculator features. This guide is designed to fit nicely in the pocket of the HP case. FLAGS Some previously "unused" flags are now used. They are: -14 Clear = end-of-period payment mode (for TVM calculations) Set = beginning-of-period payment mode -27 Clear = display symbolic complex numbers in coordinate form e.g. '(X,Y)' Set = display symbolic complex numbers using 'i' e.g. 'X+Y*i' -28 Clear = plot multiple equations like the S/SX does (serially) Set = plot multiple equations simultaneously -29 Clear = include axes in plots (like the S/SX does) Set = omit axes from 2D and statistics plots -30 is no longer used (it never did anything useful anyhow) -54 Clear = tiny matrix elements get rounded to zero Set = leaves matrix elements alone The default setting of all these flags is Clear (as in the S/SX). FLAG BROWSER There is a System Flag browser which shows the flag number, shows whether it's set or clear, lets you toggle it, and shows in English what the current setting means. CHARACTER BROWSER While programming, if you want to type any character at all, press CHARS and a screenful of ASCII characters is displayed that you can browse with the arrow keys, and not only does the screen also show the ASCII code (NUM value) and even the shortcut keyboard key sequence (if any) for each character, but if you press ECHO, it will be "typed" into your program. There's no need any more for the alpha keyboard table. DIRECTORY MAINTENANCE Press right-shift VAR to launch a Variable Browser which is a complete memory manager. You can tag multiple objects and copy, move, or delete them all with a single keystroke; there's even a Mark All and an Unmark All, like a real computer. It's slow, however, and has been obsoleted by the very fast PCT library. FRACTIONAL UNIT POWERS The S/SX only handled integer powers of units correctly, but the G/GX can use any real number as a unit power. NAME PLATE The case has a rectangular indentation in the back like the HP 95LX and 100LX, and it comes with an adhesive metal nameplate that you can get engraved with your name. XLIB NAMES All of the new commands in the GX are XLIB names, and therefore take 5.5 bytes in programs. The commands common to the SX and GX take 2.5 bytes each, as they did in the SX. INPUT FORMS and CHOOSE BOXES Many operations have two menu types: the old SX style, and a new "drop-down" menu and "input forms" that have the feel of computer dialog boxes. Especially useful for the HP48 beginner. ENHANCED PRECISION The internal precision of at least some of the matrix routines has been improved; INV gets better answers on square matrices than the SX did. HP has not released information about which routines were improved, how, and by how much. IMPROVED DISPLAY The LCD introduced with revision M of the G/GX is easier to read since it has higher contrast between on/off pixels. It has a slower cycle response time, however, making it difficult to use for rapid-motion video games or any other rapid animation.