HP-15C: Usage

Version 4.5.00, Build 6308
© 2023 Torsten Manz
H E W L E T T · P A C K A R D 15C
A Simulator for Windows, Linux and macOS

# Usage

## Operation

### Online Help

To view this online help from the Simulator press F1.

By default, the Simulator uses the Mozilla web browser to display the online help. If you do not have this installed on your system, the Simulator will automatically select another browser. You can also specify your preferred browser in the Help File Browser section of the preferences.

### Using the Mouse

Each key on the real HP-15C has three functions: A primary function in white and two secondary functions in gold and blue. Pressing the key itself calls up the primary function. To call up a secondary function, click on one of the two shift keys f or g, followed by the key with the secondary function. The Simulator behaves in exactly the same way when you click the buttons with the mouse.

On the Simulator, you can also access the secondary functions also by clicking directly on the gold and blue labels. You do not need to click the f or g button before. This behaviour can be turned off in the Simulator section of the Preferences .

When you move the mouse over a gold or blue label, the label becomes highlighted, i.e. the foreground and background colours will be swapped. If a shift key is active, an "f" or a "g" is shown in the status line of the display, the highlighting is only active for the corresponding functions. The highlighting can be switched off in the preferences in the Simulator section. Highlighting is always off, if the direct access to the secondary functions is switched off.

If you click on a gold label while the blue functions are active, indicated by the letter "g" in the display, the blue function is called and not the gold one you clicked. The sequence g →H.MS therefore does not call the function →H.MS but →H. The behaviour is the same, when the gold functions are active and you click on a blue label.

In general, clicking on any of the three parts of a Simulator button while a secondary function indicator is shown in the display calls the corresponding secondary function of that button.

### Using the Keyboard

Each Simulator button is mapped to a specific keyboard key (see section Keyboard). Pressing the keyboard key has the same effect as clicking the button with the mouse. This allows it to use the Simulator in almost the same way as the real HP-15C. For example, the SIN button is mapped to key S; thus, pressing S computes the sine of the value in the display. To compute the inverse sine you can either click SIN-1 or key in the sequence G S on the computer keyboard.

On the real HP-15C only two keys, SST and BST in PRGM mode, have auto-repeat functionality. On the Simulator the auto-repeat functionality depends on the operating system:

- Windows: No auto-repeat for any key.
- Linux: If auto-repeat is enabled in the system settings, all keys have auto-repeat functionality.

Exceptions from this rule are:

- → or SST (in Run mode)
- I or (i)
- space or PREFIX
- MEM

These keys behave differently for the <KeyPress> (<ButtonPress>) and the <KeyRelease> (<ButtonRelease>) events, and therefore have no auto-repeat functionality. See the keyboard page for a detailed description.

### Combining Mouse and Keyboard

Mouse and keyboard operations can be mixed without any limitation. Let us assume you typed in a time value as a decimal number. To convert this value into hours, minutes, and seconds, the HP-15C provides the function →H.MS. Each of the following mouse/keyboard sequences calls this function:

F 2 | F 2 | F →H.MS |  |
f 2 | f 2 | f →H.MS |  | →H.MS (click the gold label, when direct access is turned on)

### Abbreviated Keyboard Sequences

Like the real HP-15C, the Simulator allows abbreviated key sequences for some of the gold secondary functions. This means that the f key is obsolete if it follows another prefix key in a key sequence. For example, the sequence f LBL f A can be keyed in as f LBL A and the sequence STO f RAN # can be abbreviated to STO RAN #.

You can abort any pending command with f PREFIX or F space without losing the display contents.

### Clipboard

The content of the X-register can be copied to and retrieved from the clipboard with the standard keyboard shortcuts Ctrl–C and Ctrl–V.
When you copy a number to the clipboard, its internal representation is used, not the one shown on the display. To copy the number in the current display format press Ctrl–Shift–C.

For example, if the format is set to f ENG 4, the result of 7 g LOG is displayed as 845.10 -03. Ctrl–Shift–C copies this as `845.10e-03`, whereas Ctrl–C copies it as `0.8450980400142568`, i.e. the internal representation using the full precision.

By default, the Simulator uses the same character as the decimal point, i.e. period or comma, as in the display. To allow different settings for the clipboard and the display, you can force the usage of "C locale" for the clipboard (see the Simulator section of the preferences). In the above example the number will either be copied as `4567,105` (period is a comma) or as `4567.105` (period is a point), depending on the current settings.

When a number is pasted from the clipboard, the format is derived using the following rules:

1. Any character at the beginning and the end of the clipboard data, that can not be part of a number, is removed:
   - `##1.234##` becomes `1.234`
   - `"1.6"` becomes `1.6`
   - `-123+` becomes `-123`
   - `123.456,76€` becomes `123.456,76`

2. The right most comma or period is taken as the decimal point. Any other comma, period, blank or hyphen is treated as a digit separator:
   - `123.456.789,00` : most countries in Europe
   - `123'456'789.00` : Switzerland
   - `123 456 789,00` : France, Latvia and others
   - `12,34,56,789.00` : Canada
   - `123456,789.00` : Philippines
   - `123 456 789.00` and `12.34.56.789,00`

### Continuous Memory

When the real HP-15C is turned off, the memory content is preserved in its Continuous Memory. The Simulator mimics this behaviour by writing the memory content to a file when it is "turned off". The name of the memory file is "`HP-15C.mme`", the location depend on the operating system:

OS | Path
--- | ---
UNIX, Linux and macOS | $HOME/.HP-15C
Windows 7/8/10 | %APPDATA%/HP-15C

At start-up the Simulator checks for a memory file and tries to load it. If no file is found, all registers are set to zero and all status settings are set to their default value. If an existing file can not be read in, an error is reported and the default settings are used.

To save the memory manually, press Ctrl–M. To reload the previously saved memory, press Ctrl–L. To reset the memory of the Simulator completely, press Ctrl–R. The display will then show PR ERROR (Power Error). This is the same as removing the batteries on the real HP-15C.

The following items are saved in the memory file:

- Stack and LSTx register
- Program registers
- Program documentation
- Flags
- Status information:
  - Settings for digit separator and decimal point
  - Display mode and precision
  - Trigonometric mode
  - Initial value for random number
  - User mode status
- Preferences

Some statuses are not saved, and are reset to their default value every time the Simulator is started:

- f and g are reset
- A running program is stopped
- Input is terminated
- Run mode is activated
- Blinking (Flag 9) is switched off
- Error status is reset

### Modes

The HP-15C has two input modes: The Run mode and the PRGM mode. The Run mode is the normal operation mode where you can do all your calculations. The PRGM mode is used to enter programs, which can then be executed in the Run mode. After the HP-15C is turned on, it is always in Run mode.

You can also choose between the Real mode and the Complex mode to calculate with complex numbers. By default, the HP-15C is in the Real mode.

Run/PRGM mode and REAL/Complex mode are independent from each other. For example, you can enter a program in the Real mode and then execute it in Complex mode and vice versa.

The Run mode is described below; the PRGM mode is described in the Programs section.

◀ Operation ▲ Top

## Run Mode

### Reverse Polish Notation

Like all HP calculators of its time, the HP-15C uses Reverse Polish Notation (RPN). In the widely used Infix Notation, terms are written in the form "`13 + 29`", whereas in RPN this term reads "`13 29 +`". RPN is a so-called postfix notation: the operators, here the "`+`", are not between the operands, but after them. For the HP-15C, this means that you enter the digits of the first operand and press the ENTER key, which pushes the input to the Y-register (see below), then enter the digits of the second operand and select the operation. The operation acts on the numbers in the X and Y-register.

### The Stack

The stack of the HP-15C consists of four registers named X, Y, Z and T. The display always shows the contents of the X-register. A fifth register LSTx (last X) stores the last operand used in an operation. This is useful if you want to perform successive operations on the same parameter or undo the last operation.

When you type a number, it is stored in the X-register. Functions that require only one parameter, such as the square root or the exponential function, take the value from the X-register, compute the result and write it to the X-register. When you click ENTER, the stack contents are pushed up, that is, the number in register X is copied to the Y-register, that in Y is copied to Z, and the one in Z is copied to T. The number previously stored in T is discarded.

Operations that require two operands take the values in the Y and X registers, remove them from the stack, and write the computed result to the X-register. The other registers are `popped´, i.e. their contents are moved down one register. The value that was previously in Z is copied to Y, and the value in T is copied to Z. This results in the same value in the Z and the T-register.

Let us, for example, take the operation "`6 × 7`", which is keyed in as 6 ENTER 7 ×. The following figure shows the effect on the stack as the keys are pressed (The Z-register is already set with a value from a previous operation):

| 6 |  | ENTER |  | 7 |  | ×
--- | --- | --- | --- | --- | --- | --- | ---
T | 0.00 |  | 1.11 |  | 1.11 |  | 1.11
Z | 1.11 |  | 0.00 |  | 0.00 |  | 1.11
Y | 0.00 |  | 6.00 |  | 6.00 |  | 0.00
X | 6 |  | 6.00 |  | 7 |  | 42.00
LSTx | 0.00 |  | 0.00 |  | 0.00 |  | 7.00

Please see the HP-15C Owner's Handbook for a complete description of data entry and the stack.

◀ Run mode ▲ Top

## Complex Mode

### The Imaginary Stack

Operations with complex numbers use a second stack, the so-called imaginary stack. This stack holds the imaginary part of complex numbers, while the real parts are stored in the normal real stack. Like the real stack, the imaginary stack has the four registers X, Y, Z and T, plus the LSTx-register. The imaginary stack is created automatically when you activate the Complex mode and it is destroyed when you deactivate it.

Complex mode is switched on by one of the following functions:

HP-15C key | Purpose
--- | ---
f I | Creates a complex number from the values in the X and Y-register of the real stack.
f Re↔Im | Exchanges the real and the imaginary part of a complex number.
g SF 8 | Sets flag 8, the COMPLEX flag.

Flag 8 determines whether the Complex mode is on or off. The only way to switch off the Complex mode is to clear flag 8 (g CF 8). The letter "C" in the display status line indicates that the HP-15C is in Complex mode:

### Entering Complex Numbers

To enter a complex number, enter the real part of the number in the Y-register and the imaginary part in the X-register. To create the complex number click f I to create the imaginary stack. The number in the real X-register is then moved to the imaginary X-register and the real stack is popped. The number previously in the real Y-register now is in the real X-register. Thus, the complex number is stored in the two X-registers, the real and the imaginary one.

The following example shows how to enter the complex number `6+7i` and the effect on the real and imaginary stack. The real stack already contains results from previous calculations:

| 6 |  | ENTER |  | 7 |  | f I
--- | --- | --- | --- | --- | --- | --- | ---
T | 0 |  |  | 1 |  |  | 1 |  |  | 1 | 0
Z | 1 |  |  | 0 |  |  | 0 |  |  | 1 | 0
Y | 0 |  |  | 6 |  |  | 6 |  |  | 0 | 0
X | 6 |  |  | 6 |  |  | 7 |  |  | 6 | 7
LSTx | -5 |  |  | -5 |  |  | -5 |  |  | -5 | 0

As you can see from this example, the imaginary stack does not exist until you click f I. Registers in the imaginary stack not yet used are initialised with `0`.

We will now add the complex number `2+3i` to that in the X-register. The second number is keyed-in in exactly the same way as the first one:

| 2 |  | ENTER |  | 3 |  | f I |  | +
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
T | 1 | 0 |  | 0 | 0 |  | 0 | 0 |  | 0 | 0 |  | 0 | 0
Z | 0 | 0 |  | 6 | 7 |  | 6 | 7 |  | 0 | 0 |  | 0 | 0
Y | 6 | 7 |  | 2 | 0 |  | 2 | 0 |  | 6 | 7 |  | 0 | 0
X | 2 | 0 |  | 2 | 0 |  | 3 | 0 |  | 2 | 3 |  | 8 | 10
LSTx | -5 | 0 |  | -5 | 0 |  | -5 | 0 |  | -5 | 0 |  | 2 | 3

Please note that when you click ENTER both stacks are pushed up.

### Supported Functions

The following functions can make use of the imaginary stack:

- Functions with one parameter:

  √x̅ x2 LN LOG ⅟x 10x ex ABS →R →P

  SIN COS TAN SIN-1 COS-1 TAN-1 HYP HYP-1

- Functions with two parameters:

  + − × ÷ yx

- Compare functions:

  x=0 TEST 0(`x ≠ 0`) TEST 5(`x = y`) TEST 6(`x ≠ y`)

- Stack operations:

  x↔y R↓ R↑ ENTER LSTx

All other functions ignore the imaginary stack.

◀ Complex mode ▲ Top

## Differences

This section describes the differences between the real HP-15C and the Simulator.

- Register organisation

  The memory of the real HP-15C is organised in 67 registers with 7 bytes each. Registers are shared between the data pool and the common pool. The data pool contains registers that are used for storage operations. The common pool contains free registers that can be used for program steps, matrix operations, complex numbers and temporarily by SOLVE and ∫xy. To redefine the number of registers in the data pool, type in the number in the X register and key in the sequence f DIM (i).

  The Simulator `memory´ is not organised in registers. This is less important, since the HP-15C has only one function that gives the user knowledge of the internal structure: g MEM. The Simulator fully mimics the behaviour of that function, so that there is no visible difference between the Simulator and the real HP-15C.

- Number encoding

  The real HP-15C uses Binary-Coded Decimal (BCD) to encode all numbers. The Simulator uses the IEEE encoding of the Tcl/Tk run time environment. BCD can represent real numbers like `0.0006` exactly, it is encoded as `06000000000996`. See The Museum of HP Calculators for a detailed description. On the contrary, the IEEE encoding is always only an approximation to a real number. This can lead to differences in the results as shown in the following example:

  Key sequence | Display
  --- | ---
  7 . 0 0 5 | 7.005
  1 + | 8.005
  8 . 0 0 5 − | -1.776 -15

  Obviously the result should be `0.000`, and that is what the real HP-15C displays: All numbers used here can be represented exactly when using BCD. The IEEE encoding leads to rounding errors which yield a result other than zero.

◀ Differences ▲ Top

Programs ▶