# 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 on-line help. If you have not installed it on your system, the Simulator will automatically choose 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 the primary function. To call a secondary function you press 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 if you click the buttons with the mouse.

On the Simulator, you can access the secondary functions also directly by clicking on the gold and blue labels. You do not need to click the f or g button before. This behaviour can be switched 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 the background colour are exchanged. If a shift key is active, an "f" or a "g" is shown in the status line of the display, and the highlighting is active only for corresponding functions. The highlighting can be switched off in the Preferences dialogue. 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 will therefore **not** call the
function →H.MS but →H. The behaviour
is the same if 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 will call the corresponding secondary function of that button.

### Using the Keyboard

Each Simulator button is mapped to a single 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 will compute 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 PC 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 will call this function:

F 2 | f 2 |
f →H.MS | |

F 2 | f 2 | →H.MS (click on 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. In general, the f key is obsolete when 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 by clicking f PREFIX or pressing F space without losing the display contents.

### Clipboard

The contents of the X register can be copied to, and set 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.
Assume you set the display format to fixed format with two decimal places
(f FIX 2).
If you key in the number `4567,105`

and press ENTER, it is being displayed as
`4.567,11`

. The number becomes rounded to two decimal places and a digit separator is added. Internally
the number is stored in the form 4567.105, without digit separators, and with a period for the decimal point and all
decimal places.

By default, the Simulator uses the same character, period or comma, as decimal point 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 detected by the following actions:

At first, 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.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 to a file when it is `turned off´.

The name and directory of the memory file depend on the operating system. While the name is fixed, the directory is derived from environment variables:

OS | Variable | File name |
---|---|---|

UNIX/Linux/Mac OS X | $HOME | .hp-15c.mem |

Windows XP/Vista/7/8 | $APPDATA | HP-15C.mem |

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 main modes: Run mode and PRGM mode. Run mode is the normal operation mode where you can do all your calculations. PRGM mode is used to enter programs, which can then be executed in Run mode. After the HP-15C is turned on, it is in Run mode.

You can also choose between the Real mode and the Complex mode. 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.

## 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: Operators,
here "`+`

", do not stand between the operands, but *after* them.
For the HP-15C, this means that you enter the digits of the first operand and hit the
ENTER key, which pushes the input to Y-register (see below), then enter the
digits of the second operand and select the operation. The operation will act on the numbers in the
X and the 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 can be useful if you want to do consecutive operations with the same parameter.

When you key in a number, it is stored in the X register. Functions that require only one parameter, like square root or the exponential function, take the value in the X register, compute the result and write it to the X register. When you press ENTER, the stack content is pushed up, that is, the number in register X is copied to Y, that in Y is moved to Z, and that in Z is moved 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´; that is, their contents are moved down one register. The value formerly in Z is moved to Y, and the value in T is copied to Z (thus leaving the same value in both Z and T).

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 (Register Z
is already loaded 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.

## 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 enter Complex mode and it is destroyed when you leave 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 indicates whether Complex mode is on. The only way to switched off 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 press 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 press ENTER both stacks are pushed up.

### Supported Functions

The following functions can make use of the imaginary stack:

- Functions with one parameter:

√x̅ x^{2}LN LOG ⅟x 10^{x}e^{x}ABS →R →P

SIN COS TAN SIN^{-1}COS^{-1}TAN^{-1}HYP HYP^{-1}

- Functions with two parameters:
+ − × ÷ y

^{x}

- 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.

## 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 ∫

_{y}^{x}. 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 decimal numbers. The simulator uses the IEEE encoding of the Tcl/Tk run time environment. With BCD, numbers like

`0.0006`

can be represented exactly, it is encoded as`06000000000996`

. See The Museum of HP Calculators for a detailed description. On the other hand, 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 f FIX 2 7.01 1 + 8.01 8 . 0 0 5 − -1.78 -15 `0.00`

, and that is what the real HP-15C displays: In BCD all the numbers used here can be represented exactly. The IEEE encoding leads to rounding errors which yield a result other than null.- ∫
_{y}^{x}The Simulator uses the Simpson method to compute an integral; the HP-15C uses the Romberg method.

I compared results from the Simulator and the HP-15C, and found that the Simulator produces comparable results in less time.