
TECHNICAL NOTES
WHAT'S NEW
IN THE HP48 G/GX
Revised: Nov 1, 1993
collected by Joseph K Horn
This article answers the question, "If I upgrade from the HP 48S or SX to an HP 48G or GX, what will I gain, and what will I lose?" Knowledge of the features of the HP 48S/SX is presumed.
(1) 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 function 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:
- a. those which never get a Bad Argument Type error (like DUP),
- b. meta-object commands (like ROLL),
- c. program branch structures (like FOR), and
- d. 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.
(2) PORTS AND MEMORY
The HP48G, like the 48S, 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 HP 48SX 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.
(3) LOCAL VARIABLES
Variable names whose first character is 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.
(4) SPEED
CPU clock speed is double the S/SX's, but throughput is about 40% faster, primarily due to the fact that it still has the same 4-bit bus bottleneck, so RAM access is slowed down.
(5) IMPROVED COMMANDS
AXES can now also specify the spacing of the tick marks.
DEPND can now also specify the initial values and tolerance for the new DIFFEQ plot type.
REPL and SUB now work on arrays.
(6) HP SOLVE EQUATION LIBRARY CARD COMMANDS
AMORT, amortization calculations
CONLIB, starts Constants Library catalog
CONST, returns value of a named CONLIB constant
DARCY, calculates Darcy friction factor
EQNLIB, starts Equation Library catalog
F0lambda, calculates black-body power fraction
FANNING, calculates Fanning friction factor
LIBEVAL is a generalized form of the EQ card's ELSYSEVAL; it executes any XLIB by its library number
MCALC, marks an MSOLVR variable as "not user-defined"
MINEHUNT, starts the "Minehunt" video game
MINIT, initializes Mpar from 'EQ' for MSOLVR
MITM, customizes title & menu of MSOLVR's screen
MROOT, solve for variable(s) in MSOLVR
MSOLVR, shows Multiple Equation Solver menu
MUSER, marks an MSOLVR variable as "user-defined"
SIDENS, density of silicon as function of temperature
SOLVEQN, starts solver for specified EqLib equation(s)
TDELTA, subtracts temperatures like "-" ought to but doesn't
TINC, adds temperatures like "+" ought to but doesn't
TVM, shows the financial calculator (Time Value of Money) menu
TVMBEG, sets payments-at-beginning-of-periods mode
TVMEND, sets payments-at-end-of-periods mode
TVMROOT, solves for a TVM variable
ZFACTOR, calculates gas compressibility factor Z
Note: The EQ Card's Periodic Table and Tetris game are not in the HP 48G/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 eparately as freeware on Goodies Disk 9.
(7) NEW ARRAY COMMANDS
COL+, inserts a column vector into a matrix or a number into a vector (like INSCOL/PUTCOL in Donnelly's Tool Library)
COL
">, deletes a column from a matrix or number from a vector (identical to DELCOL in Donnelly's Tool Library)
COL
, combines multiple column vectors into a matrix
COL, breaks a matrix into multiple column vectors (like repeated GETCOL in Donnelly's Tool Library)
COND, column norm condition number of a square matrix
CSWP, swaps two columns in a matrix (like EXCOL in Donnelly's Tool Library)
DIAG, returns vector of major diagonal elements of a matrix
DIAG
, creates matrix with specified diagonal elements
EGV, eigenvalues and right eigenvectors of a square matrix
EGVL, eigenvalues of a square matrix
FFT, discrete Fourier transform
IFFT, inverse discrete Fourier transform
LQ, returns the LQ factorization of a matrix
LSQ, minimum norm least-squares solution to an ill-determined system of linear equations
LU, returns the Crout LU decomposition of a square matrix
PCOEF, returns polynomial with given roots (inverse of PROOT)
PEVAL, evaluates polynomial at x
PROOT, finds all roots of polynomial (inverse of PCOEF)
QR, returns QR factorization of a matrix
RANK, rank of a rectangular matrix (uses flag -54)
RANM, creates matrix with random elements
RCI, multiplies elements in one row of a matrix by a scalar
RCIJ, does RCI then adds the result to a row
ROW+, inserts a row vector into a matrix or a number into a vector (like INSROW/PUTROW in Donnelly's Tool Library)
ROW-, deletes a row from a matrix or number from a vector (identical to DELROW in Donnelly's Tool Library)
ROW
, combines multiple row vectors into a matrix
ROW, breaks a matrix into multiple row vectors (like repeated GETROW in Donnelly's Tool Library)
RSWP, swaps two rows in a matrix (identical to EXROW in Donnelly's Tool Library)
RREF, row-reduced echelon form of a matrix
SCHUR, computes the Schur decomposition of a square matrix
SNRM, spectral norm of an array
SRAD, spectral radius of a square matrix
SVD, singular value decomposition of a matrix
SVL, computes the singular values of a matrix
TRACE, sum of diagonal elements of a square matrix
(8) GRAPHICS & PLOTTING COMMANDS
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 quite good!
ATICK, specifies tick spacing on plot axes
DIFFEQ, selects the new "differential equation" plot type
EYEPT, specifies the eye-point coordinates in a perspective plot
GRIDMAP, selects the new "gridmap" plot type
NUMX, number of x-axis increments (plotting steps)
NUMY, number of y-axis increments (plotting steps)
PARSURFACE, selects the new "parametric surface" plot type
PCONTOUR, selects the new "pcontour" plot type
PICTURE, new name for the GRAPH command
SLOPEFIELD, selects the new "slopefield" plot type
WIREFRAME, selects the new "wireframe" plot type
XVOL, sets the width of the 3D plotting volume
XXRNG, sets the width of the 3D target mapping range for gridmap and parametric surface plots
YSLICE, selects the new "yslice" plot type
YVOL, sets the depth of the 3D plotting volume
YYRNG, sets the depth of the 3D target mapping range for gridmap and parametric surface plots
ZVOL, sets the height of the 3D plotting volume
(9) USER-INTERFACE COMMANDS
CHOOSE, displays a point-and-click menu "dialog box"
INFORM, formatted multi-line input with named fields (nice!!)
MSGBOX, displays text in a centered box with shadow, then WAITs
NOVAL, placeholder for unspecified values in INFORM argument list
(10) LIST PROCESSING COMMANDS
ADD, adds lists element-wise (see section #1 above)
DOLIST, evals an object on multiple lists
DOSUBS, evals a program or command taking arguments from a list
ENDSUB, returns the number of loops the current DOSUBS will do
HEAD, first element in a list or first char in a string (identical to CAR in Donnelly's Tool Library)
DeltaLIST, list of first finite differences of list objects
SigmaLIST, sum of the elements in a list
PiLIST, product of the elements in a list
NSUB, returns the current list pointer value during a DOSUBS
REVLIST, reverses the order of the objects in a list (like REVERSE in Donnelly's Tool Library)
SEQ, list of results from repeated execution of an object (like a FOR/STEP loop but the results go into a list)
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)
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.
TAIL, returns a decapitated list or string (see HEAD above) (identical to CDR in Donnelly's Tool Library)
(11) SYSTEM COMMANDS
CLTEACH, clears the 'EXAMPLES' directory created by TEACH
CYLIN, sets polar/cylindrical coordinate mode
FREE1, like 1 FREE (see section #2 above)
MERGE1, like 1 MERGE (see section #2 above)
PINIT, port initialize, esp. important for 4-Meg RAM card users
RECT, sets rectangular coordinate mode
SPHERE, sets polar/spherical coordinate mode
TEACH, loads pre-fab examples into a dir in HOME
VERSION, returns the operating system ROM version string and a copyright notice, like this:
2: "Version HP48-R"
1: "Copyright HP 1993"
Note: first 48G's are version "K"; first 48GX's are version "L" due to the removal of a port management
bug in version "K" which does not affect the 48G. Versions "L" and "M" GX's have a bug that can clear memory if the clock is on; contact HP to upgrade to a later version.
Note: this command is necessary since the ON-D "memory scanner" has been removed.
XRECV, Xmodem protocol receive (binary mode only)
XSEND, Xmodem protocol send (binary mode only)
(12) MATH COMMANDS
LININ, tests whether an equation is linear in a given variable
NDIST, normal probability density
PCOV, population covariance of SigmaDAT
PSDEV, population standard deviation of SigmaDAT
PVAR, population variance of SigmaDAT
RKF, solves initial value problem using Runge-Kutta-Fehlberg
RKFERR, change in solution and absolute error using RKF
RKFSTEP, next solution step with given error tolerance using RKF
RRK, solves initial value problem using Rosenbrock & RKF
RRKSTEP, next solution step with given error tolerance using RRK
RSBERR, change in solution and absolute error using Rosenbrock
(13) MENU NUMBERS & KEY CODES
Many menu numbers have changed, so software that uses # MENU or # TMENU may not work the same as in the HP 48S/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, and the right-shift key which was blue on the S/SX is now green 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 new user-friendly full-screen menus. The unshifted keys remain identical to the S/SX, except for a cosmetic color change to match the very dark green-gray of the calculator case. The functionality of almost every key is new, however. For example, pressing DEL when there is no command line executes CLEAR. EDIT on a name performs a VISIT. And so on.
Note: the G/GX has no 2D, 3D, or
Q key (but
Q can be found in a menu).
(14) 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.
(15) FLAGS
Some previously "unused" flags are now used. To wit:
-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).
(16) 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.
(17) 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'll be "typed" into your program. There's no need any more for the alpha keyboard table.
(18) 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.
(19) 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.
(20) 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. ($5 at EduCALC if ordered at time of purchase).
(21) 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.
(22) 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.
(23) 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.
(24) 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.
--- Please send addenda and corrigenda for this article to:
rnelson@educalc.com (Richard J. Nelson)
joehorn@mail.liberty.com (Joseph K. Horn)
Back to Technical Notes Index