Installation procedure for HP-42X MicroCode Emulator:

I am not responsible for anything you do with this software. The emulators are not designed to make any (software or hardware) damage but (due to the complexity of the code) if something goes wrong I am not responsible for that.

Again: Use this software at your (and only your) own risk!

As described on the main page, there are few variations of HP-42X according to the various calculator configurations and different user needs. The installation procedure is different for each version and is described separately.

Very important notice: Some features from EXTENDED, EASY and LITE versions are disabled or missing in DEMO version. And, of course, "Memory Clear" occurs every time you start the emulator :-(

It is assumed that a potential user of such software already knows how to transfer files from computer to calculator so this won't be explained here.

In the following sections I will refer any covered port by Port2 for simplicity. In all cases it is up to you to ensure that you have enough free memory in the calculator for the installation procedure to complete succesfully. Needless to say, RAM cards must not be write protected for the emulator to be installed and work properly.

The emulator works OK on the regular HP-48/49 system but it is not guaranteed to work on the system loaded with take-over libraries e.g. libraries which have tendency to take control over the calculator.

HP42X48 installation:

Before installation, make shure that Port1 and Port2 are empty and writeable. If needed, initialize them with PINIT and clear everything from them. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM (from the HP42X variable) to Port2 with 2 STO (or Port1 with 1 STO). Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the second time.

HP42X48E installation:

Before installation, make shure that Port1 (or Port2) is empty and writeable. If needed, initialize with PINIT and clear everything from Port1 (or Port2). Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM/RAM (from the HP42X variable) to Port1 with 1 STO (or Port2 with 2 STO). Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the second time.

HP42X48L installation:

Before installation, make shure that Port1 (or Port2) is empty and writeable. If needed, initialize with PINIT and clear everything from Port1 (or Port2). Port0 must be empty as well. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM (from the HP42X variable) to Port1 with 1 STO (or Port2 with 2 STO). Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XM42 file from the computer and execute it. Store the (unnamed) backup object containing the HP-42S/Emulator RAM (produced by XM42) to Port0 with 0 STO. Press ON+C to reboot the calculator for the second time. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the third time.

HP42X48S installation:

Before installation, make shure that Port1 and Port2 are empty and writeable. If needed, initialize them with PINIT and clear everything from them. Merge Port1 with the main calculator RAM. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM (from the HP42X variable) to Port2 with 2 STO. Purge the HP42X variable, free (unmerge) Port1 and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the second time.

HP42X48D installation:

Before installation, make shure that Port1 (or Port2) is empty and writeable. If needed, initialize with PINIT and clear everything from Port1 (or Port2). Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM/RAM (from the HP42X variable) to Port1 with 1 STO (or Port2 with 2 STO). Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42.

It is very important to free Port1 on HP-48GX/SX because emulator will not start if Port1 remains merged ('Port Not Available' error will be generated).

Extremly important: Due to the very serious bug on HP-48GX ROM versions L and M, Port 1 could be corrupted after storing an object to Port >1. To avoid this, store everything what had to be stored to Port >1 first. If you got 'Invalid Card Data' warning after ON+C you have to execute PINIT. After this, you can store the remaining object(s) to Port 1.

HP42X49 installation:

Before installation, make shure that both banks of Port1 are empty. If needed, initialize with PINIT and clear everything from Port1. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM (from the HP42X variable) to Port1 with 1 STO. Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the second time.

HP42X49E installation:

Before installation, make shure that at least one bank of Port1 is empty. If needed, initialize with PINIT and clear as many objects as needed to make one 128K bank empty. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM/RAM (from the HP42X variable) to Port1 with 1 STO. Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the second time.

HP42X49L installation:

Before installation, make shure that at least one bank of Port1 is empty. If needed, initialize with PINIT and clear as many objects as needed to make one 128K bank empty. Port0 must be empty as well. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM (from the HP42X variable) to Port1 with 1 STO. Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XM42 file from the computer and execute it. Store the (unnamed) backup object containing the HP-42S/Emulator RAM (produced by XM42) to Port0 with 0 STO. Press ON+C to reboot the calculator for the second time. Receive the XQ42 file from the computer. Run the emulator with XQ42. Exit the emulator with ON&F. Press ON+C to reboot the calculator for the third time.

HP42X49D installation:

Before installation, make shure that at least one bank of Port1 is empty. If needed, initialize with PINIT and clear as many objects as needed to make one 128K bank empty. Receive the HP42X file from the computer and store the (unnamed) backup object containing the HP-42S/Emulator ROM/RAM (from the HP42X variable) to Port1 with 1 STO. Purge the HP42X variable and press ON+C to reboot the calculator. Receive the XQ42 file from the computer. Run the emulator with XQ42.

Execution:

Emulator must be executed with XQ42. If, at any time, XQ42 cannot find the appropriate backup object containing the HP-42S/Emulator ROM it will raise an "Object Not in Port" error. If you have (accidently) stored the emulator to more than one port, XQ42 will search them by port number order and execute the first one found. Don't mix XQ42 and HP42X from different versions of the emulator because crash of the calculator is guaranteed ...

HP-49G only: Due to some issues with port management on HP-49G, XQ42 SHOULD NOT be executed from either Port1 or Port2 - it should be executed from the main memory only.

If, for some reason, you have to reset the emulator through the reset hole you must immediately run the emulator again to recover it. Don't do anything else before you run the emulator or the HP-42S/Emulator ROM/RAM could be corrupted. Don't pay attention to the "Invalid Card Data" warning and don't even think to execute PINIT. This is especially important for the EASY and LITE versions. This procedure isn't necessary if you perform the warm start with ON+C while the emulator is off (deeply sleeping).

"Machine Reset" occurs every time the emulator is executed. It's the way to protect the emulator from a possible memory changes made by user. After the emulator has been turned off with SHIFT+EXIT it can be turned ON as usual (without "Machine Reset").

Unnamed backup objects:

I use these objects a lot with HP-42X. They have many advantages but you cannot simply purge them because they have no name. On the HP-48 you can purge unnamed objects from Port1 with something like 1 PVARS DROP PURGE (equivalent procedure for ports 2..31). On the HP-49 you can purge them with Filer.

Uninstallation:

In the case of an upgrade to a newer version of the emulator you have to uninstall the previous version. For all versions you must purge the backup object containing the emulator from the appropriate port. The backup object containing the HP-42S RAM in the other port doesn't have to be purged. In the case of HP42X48L version you will have to remove the backup object from Port0 in order to make enough free memory for installation. Then you can install the upgrade.

Display refresh:

The HP-42S display organization is very different from the HP-48/49 display organization so it must be refreshed somehow. To increase execution speed the emulator can work in two modes: Slow and Fast. Slow mode is on by default (after power up). In Slow mode the display is refreshed in many places including graphics instructions like CLLCD, AGRAPH and PIXEL. The Fast mode can be activated by a new FAST instruction. It can be entered with XEQ "!FAST" ('!' means 'external instruction' e.g. instruction which isn't part of HP-42S). In this mode the display isn't refreshed by graphics instructions. Instead you have to refresh it explicitly with VIEWD when needed. Regardless of the mode, the display is always refreshed by instructions like VIEW, AVIEW, GETKEY, ... and when the program isn't being executed.

Other external instructions are:

!LOCKD: Lock the display (like AVIEW or VIEW do but without disturbing the display).
!SLOW: Activate SLOW mode explicitly.
!BYE: Return to the HP-48/49 operating system and resume execution when starting the emulator again (no 'Machine Reset' will be executed on entry). This is very useful when you want to return to the HP-48/49 operating system, execute something and then return to the emulator and resume execution.

Keyboard mapping for HP-48GX and HP-49G:
(one HP-42S key can be assigned to more-than-one HP-48/49 keys)

 HP-42S

 HP-48GX

 HP-49G

 Sigma+

 A, Y^X

 A, Y^X

 1/X

 B, 1/X

 B, 1/X

 SQRT

 C, SQRT

 C, SQRT

 LOG

 D

 D, EQW

 LN

 E

 E, SYMB

 XEQ

 F, '

 F, CAT, TOOL

 STO

 STO

 STO

 RCL

 EVAL, VAR

 VAR

 RDN

 NXT

 NXT

 SIN

 SIN

 SIN

 COS

 COS

 COS

 TAN

 TAN

 TAN

 ENTER

 ENTER

 ENTER

 X<>Y

 DEL

 X

 +/-

 +/-

 +/-

 E

 EEX

 EEX

 <−

 <−

 <−

 +

 +

 +

 -

 -

 -

 *

 *

 *

 /

 /

 /

 0

 0

 0

 1

 1

 1

 2

 2

 2

 3

 3

 3

 4

 4

 4

 5

 5

 5

 6

 6

 6

 7

 7

 7

 8

 8

 8

 9

 9

 9

 .

 .

 .

 R/S

 SPC, PRG

 SPC, APPS

 Up

 Alpha, UpArrow, LeftArrow

 Alpha, UpArrow, LeftArrow

 Down

 LeftShift, DownArrow, RightArrow 

 LeftShift, DownArrow, RightArrow 

 SHIFT

 RightShift, MTH, CST

 RightShift, MODE, HIST

 EXIT

 ON

 ON

The keyboard mapping is a combination of two approaches: some keys retained their position as on HP-42S and some retained the same name (some of them even retained the same position and name). The mapping is left the same on HP-48 and HP-49, where possible.

ON&F key combination is used for return to the HP-48/49 operating system.

Port Memory:

In addition to the 96K of HP-42S RAM, some versions of HP-42X support the port memory. Its purpose is to store programs for long term use. Data cannot be stored to port memory. Programs cannot be directly executed from port memory but they can be dynamically loaded to the main memory and executed. There are two ports inside HP-42X: Port1 (RAM port, size 16K for HP42X48L, 30K for HP42X49L and 31K for EXTENDED versions) and Port2 (ROM port, size 32K). These are 'virtual' HP-42S ports which have nothing to do with the real HP-48/49 ports. Port memory isn't affected by "Memory Clear". External instructions for accessing port memory are:

!SAVE1 "NAME" for saving the current HP-42S program to Port1,
!SAVA1 "NAME" for saving all HP-42S programs to Port1,
!LOAD1 "NAME" for loading the HP-42S program(s) from Port1,
!PURG1 "NAME" for deleting the HP-42S program from Port1,
!CAT1 for displaying all programs contained in the Port1,
!SAVE2 "NAME" for saving the current HP-42S program to Port2,
!SAVA2 "NAME" for saving all HP-42S programs to Port2,
!LOAD2 "NAME" for loading the HP-42S program(s) from Port2,
!PURG2 "NAME" for deleting the HP-42S program from Port2 and
!CAT2 for displaying all programs contained in the Port2.

Indirect versions of SAVE/SAVA/LOAD/PURG instructions aren't possible empty name ("") is used as an argument in this case.

A little article about loading HP-41C RAW/P41 files into HP-42X is presented here.

In addition to the above port instructions there are a few instructions which can deal directly with the main calculator RAM. These are:

!SAVE for saving the current HP-42S program to the main calculator RAM,
!SAVA for saving all HP-42S programs to the main calculator RAM,
!LOAD for loading the HP-42S program(s) from the main calculator RAM,
!BKUP for saving the whole HP-42S RAM to the main calculator RAM,
!BKUP1 for saving the whole Port1 to the main calculator RAM,
!BKUP2 for saving the whole Port2 to the main calculator RAM,
!REST for loading the whole HP-42S RAM from the main calculator RAM,
!REST1 for loading the whole Port1 from the main calculator RAM and
!REST2 for loading the whole Port2 from the main calculator RAM.

When loading a HP-42S program (either from the port memory or the main calculator RAM) it is always loaded as the last program in memory. On some versions (LITE, for example) the display can become garbled during the loading and restoring process but this is normal. Before running the emulator you must put the character string object(s) containing the HP-42S program(s) on the stack. When saving a program, the character string object containing the program will be put on the stack automatically.

Port and main calculator RAM instructions aren't available in DEMO and EASY versions. Furthermore, BKUP/BKUP1/BKUP2 and REST/REST1/REST2 instructions aren't available on HP42X48L and HP42X48S.

All external instructions are programable this opens many interesting possibilities for dynamic loading and program execution.

Printer output:

Printer output works in 4 modes which can be activated with the following external instructions:

!RS: Activate RS-232 (Wire) serial mode (baud rate fixed at 9600).
!IR: Activate IR serial mode (baud rate fixed at 2400).
!LED: Activate IR LED (RedEye) mode.
!LCD: Activate redirection to the HP-48/49 display.

Note: !IR and !LED act as !RS on HP-49G. !LCD mode is default on both HP-48/49.

!RS must be used when printing to HP-82240A/B InfraRed Thermal Printer Emulator.

While RS-232 mode primary function is to communicate with the real printer, IR serial mode is especially useful for communication with another HP-48 calculator (data can be received with the SRECV command). Of course, RS-232 mode can be used for this purpose on both HP-48/49, too. IR LED mode is mainly aimed at printing on the HP-82440 thermal printer or receiving data with INPRT program on HP-48.

Redirection to the HP-48/49 display is perfect for debugging. Characters are a little narrow than usual (last column of each character isn't displayed) in order for all 24 characters (26 characters indeed) to fit on the display but otherwise this mode is just perfect. This is, in fact, a built-in HP-82240 thermal printer emulator.

Memory scanner:

Although the memory scanner is supported it is not recommended to poke around the emulator's memory. And, please, don't execute random addresses (with .) in the emulator ROM because the emulator and the real HP-42S aren't the same. Especially don't execute machine code from the address #00000 as a machine reset because you will crash the emulator.

Auto power-off:

Auto power-off feature is supported - the emulator shuts the calculator down after approx. 5 minutes of inactivity.

Known bugs/issues:

None.

Tips and tricks:

(*) Set an HP-48/49 alarm, start HP-42X and turn it OFF: when the alarm comes due it will wake up the emulator (if you set flag 11, the HP-42S program will be executed automatically). You can acknowledge the alarm after exiting to the operating system with ON&F. This trick cannot be used with demo version.

(*) Character string objects containing the HP-42S programs can be concatenated together in order to load several HP-42S programs at once. However, other objects (produced by BKUP, BKUP1 or BKUP2) should not be concatenated.