HP-95LX Programming


Writing your own program for the HP-95LX is a fairly simple process:

Create the program on the PC First, you need a 8088/8086 compiler or assembler to create the .EXE file.
I found Borland C++ V3.1 to be a very versatile tool. It is not quite a standard-C++ compiler but it comes very close to it (even supporting templates) and it runs under Win2000 without problems.

For my test I used the following standard performance test program:

#include <stdio.h>
#include <math.h>

static void test() {
  const int loops=100;
  double x, r0;
  int i;
  for (i=0; i<loops; i++) {
    r0=10;
    do {
      x=r0;
      x+=1;
      x-=4.567E-4;
      x+=70;
      x-=69;
      x*=7;
      x/=11;
      r0-=1;
    } while (r0>0);
    x=log(x);
    x=sin(x);
    x=sqrt(x);
    x=sqrt(x);
  }
  printf("%f\n",x);
}

int main() {
  test();
  return 0;
}

With Borland C++ 3.1 compile this little program.
Essential settings for the compiler are: Memory model small, floating point emulation, 8088 instruction set, optimization for speed, no debugging.
The executable is about 23kByte in size and produces an output of 0.880982.
Transfer executable to the HP-95LX The only thing needed is the HP-95LX serial cable.
Simply connect it to the HP-95LX and one of the serial ports of your computer.
On the PC do this:
  • Start a terminal program, ie. HyperTerminal.
  • Configure the terminal program to some reasonable values (ie. 19200 baud, 8 bits, 1 stop bit, no parity).
  • Initiate an XMODEM transfer to send the executable to the HP-95LX. In HyperTerminal this is done thru menu "Transfer"/"Send file".

On the HP-95LX do this:
  • Activate the "Communications" program.
  • Press "Menü" and "Einstellungen" (mine is a German unit!)
  • Make sure the serial port is configured for the same value as the PC (ie. 19200 baud, 8 bits, 1 stop bit, no parity). If this is not the case go to "Konfig"/"Leitung" and set the desired parameters.
  • Press ESC to quit the "Einstellungen" menu and activate "Transfer". Choose "XMODEM".
  • Choose "Empfang" and type in the name of the file that will be received. After this the transfer will start.

Once the transfer is complete quit the Communications program.
(Note that a DOS program cannot be started while any other application except the file manager is open on the HP-95LX.)
Execute the test program
Activate the file manager and select the downloaded executable.
Press F4 to execute it.
On my HP-95LX the program runs for 13 sec and produces an output of 0.880982.