HP 48SX Emulation in MESS

[ Main page ]

System

HP 48SX (US, 1990)

Driver name: hp48sx

The HP 48SX is a personal scientific calculator designed by Hewlett Packard to perform a wide range of mathematical functions, including symbolic computing and programming.

Features

Following the HP 28, the HP 48SX features RPL, a programming language based on Reverse Polish Notation, which is both exposed to the user and intensively used internally by the calculator. However, it borrows the form factor and extension capabilities found in the earlier HP 41C. To these, the HP 48SX adds a large graphics screen (64x131) permitting high-quality graph plotting and improved GUI (including matrix and equation input), and fully bidirectional infra-red calculator-to-calculator communication.

Usage

Starting and Stopping

When starting the calculator for the first time (or after removing the nvram file), the message Try To Recover Memory should appear. This is expected as the RAM is empty and uninitialized. As there is no previous contents to recover, choose NO by hitting the [F] key (top right). After a few seconds, it should say Memory Clear and the calculator is ready.

When exiting the emulator, the contents of the RAM (except for memory cards) is saved in a nvram (non-volatile RAM) file. Starting up the emulator again is then equivalent to a reset ([ON]+[C] key combination or reset hidden button): it clears the stack but should keep the contents of the memory intact. In rare cases, if the HP 48 was busy reconfiguring the memory when exiting the emulator, you may encounter a Try To Recover Memory screen, in which case, choose YES by hitting the [A] key, and you may still be able to recover the RAM contents.

The calculator can be turned off by hitting the [OFF] key (i.e., [right shift] and then [ON]). This clears the screen and puts the CPU in low-power mode but does not exit the emulator. The calculator can be turned on again by hitting the [ON] key. The memory contents and the stack are preserved. The calculator can also turn on automatically as a result of a user-defined time alarm. Note the difference between starting/stopping the emulator and starting/stopping the calculator. A sure way to prevent Try To Recover Memory is to turn off the calculator before exiting the emulator.

Keyboard

-------------------------------------------------
|   A   |   B   |   C   |   D   |   E   |   F   | 
|-----------------------------------------------|
|  MTH  |  PRG  |  CST  |  VAR  |   up  |  NXT  | 
|      G|      H|      I|      J|      K|      L|
|-----------------------------------------------|
|   '   |  STO  |  EVAL |  left | down  | right | 
|      M|      N|      O|      P|      Q|      R|
|-----------------------------------------------|
|  SIN  |  COS  |  TAN  |  sqrt |  y^x  |  1/x  | 
|      S|      T|      U|      V|      W|      X|
|-----------------------------------------------|
|     ENTER     |  -/-  |  EEX  |  DEL  |  <=   |
|               |      Y|      Z|       |       |  
|-----------------------------------------------|
|  alpha  |   7    |    8   |    9    |    /    | 
|         |        |        |         |         |
|-----------------------------------------------|
|  <--.   |   4    |    5   |    6    |    *    | 
|     |   |        |        |         |         |
|-----------------------------------------------|
|   .-->  |   1    |    2   |    3    |    -    | 
|   |     |        |        |         |         |
|-----------------------------------------------|
|   ON    |   0    |    .   |   SPC   |    +    | 
|         |        |        |         |         |
-------------------------------------------------

The keyboard contains 49 keys, each of which having up to four functionality accessible by hitting one of three combiners (left, right, and alpha) before the key. When using a proper artwork file in full mode, an image of the HP 48SX case and keyboard are shown around the screen, which presents all key functionality at a glance. Most keys are mapped to alphanumeric keys. If the keyboard image is shown, it is also possible to press keys by mouse clicks.

Some keys worth of notice:

The [ON] key can be combined with some keys (by holding [ON] while one or several keys are pressed) to obtain interesting results:

Screen

LCD matrix and annouciators during display test.

The screen is a LCD with 131x64 pixels (including the lower menu part that can be disabled by some applications) refreshed at 64 Hz. The screen is 2-color, black and white. However, some applications (especially games) simulate 3, 4, 8, or even 16 gray-scale levels by exploiting the high latency of the LCD screen and switching screens at high frequency. To emulate this, the HP 48 drivers average the screen on the last few frames. This works in some cases, but causes flickering in other cases.

The screen contrast can be improved or reduced by hitting [ON]+[+] and [ON]+[-].

Above the LCD matrix are displayed up to 6 annunciators corresponding to key modes (left shift, right shift, alpha), alarms (such as low battery), busy, or I/O operation. In order for the annunciators to be displayed correctly, an artwork file is required.

Program Transfer

The HP 48SX can be connected to a PC through a RS-232 port. The preferred method to exchange data and programs is to use the Kermit protocol as the HP 48SX ROM has built-in support for it. MESS directly emulates the serial port and a minimal built-in Kermit client that allows transferring files between the host and the emulated calculator:

Data transfer may be slow. You may want to disable throttling and increase frame-skipping in the MESS built-in menu to speed-up the emulator during the transfer.

Downloaded files appear in the VAR menu (mapped to the [J] key). Some files are libraries that must be attached to some port before being run. You must select the library variable (this puts the library on the stack), then enter the port number (generally 0 which denotes the internal RAM; 1 and 2 denoting RAM extension cards in slot 1 and 2), press STO ([N] key), turn off the calculator (press right shift and the [ON] key), and back on ([ON] key). The program should be available under the LIBRARY menu (left shift and [K] key). You may want to delete the library copy in VAR to free some memory (put the name of the variable on the stack and choose PURGE by hitting left shift and del).

The RS-232 support is currently limited to only SEND and RECV Kermit commands. Other Kermit commands (in particular, Kermit servers) are not supported. No other serial protocols are supported. Also, infra-red I/O (calculator-to-calculator or calculator-to-printer connection) is not supported.

ROM Revisions

The HP 48SX ROM has been through a set of revisions, from A (oldest) to J (most recent). The HP 48SX driver supports ROM revisions A, B, C, D, E and J. Revisions F, G, H, and I are either missing or were never released. By default, revision J (most recent) is used. This can be changed using the -bios command-line option, followed by a revision letter: a, b, c, d, e, or j.

Memory Cards

The HP 48SX has two extension slots that can accept one RAM or ROM card each. Each card has a capacity of 32 KB, 64KB, or 128 KB and is stored in an image file on the host. To run the emulator with an extension card, use either the -port1 file (for slot 1) or -port2 file (for slot 2) command-line option, or both. Any modification to the memory card is automatically saved to the given file when the emulator quits. When passing the name of an non-existing file, a new memory card with 128 KB capacity is created. There is no difference between RAM and ROM cards, except that the first ones correspond to read-write images files, and the second to read-only image files.

It is possible to add/remove/change memory cards without exiting the emulator, through the built-in MESS image menu. However, the calculator should be turned off when the memory card is changed.

By default, memory cards in slot 1 and 2 are visible as library ports 1 and 2 in the LIBRARY menu (port 0 corresponding to the internal RAM). In this mode, cards can only store library data. It is also possible to merge memory from either or both ports. To merge a port, enter its number (1 or 2) and use the MERGE command in the MEMORY menu (left shift, [J], [L], [L], then [A]). Merged memory extends the user memory (as visible with the MEM command) which can be used to store variables as well as library data. Up to 288 KB of user memory can be achieving by merging two 128 KB cards. Note, however, that merged memory becomes part of the user memory, so, the corresponding memory card should never be removed before being un-merged (using the FREE command in the MEMORY menu). Removing or changing an attached memory card (even when the calculator is off, or by stopping the emulation and starting it again without the corresponding -port1 or -port2 option) will surely result in a Try To Recover Memory.


This MESS driver was written by Antoine Miné.

Return to the HP 48 MESS driver page.