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 Preferences dialogue box.
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.
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 on will call the indicated secondary function of that button.
Each Simulator button is mapped to a single keyboard key (see Keyboard). Pressing that 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, almost all keyboard keys have auto-repeat functionality. Exceptions from this rule are:
These keys behave different for the <KeyPress> (<ButtonPress>) and the <KeyRelease> (<ButtonRelease>) event and therefore have no auto-repeat functionality. See the keyboard page for a detailed description.
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 |
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 #.
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>.
If you copy a number to the clipboard its internal representation is used, not the format used in 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 digits group separator is added. Internally
the number is stored in the form 4567.105
. Without digits group separators, a period for the decimal point and
with all decimal places.
When you exchange numbers using the clipboard, the operating system settings for the decimal point and the digits group separator should be considered. Unfortunately, there is no platform independent way to obtain the current locale. By default, the Simulator therefore uses the same settings as for the display. To allow different settings for clipboard and display, you can force the usage of "C locale" for the clipboard (see Preferences).
In the above example the number will either be copied as "4567,105
" or as "4567.105
",
depending on the current settings.
When the real HP-15C is turned off, the memory content is preserved. The Simulator mimics this behaviour by writing the memory to a file when it is 'turned off'.
Name and directory of the memory file depend on the operating system. While the name is fix, the directory is derived from environment variables:
OS | Variable | File name |
---|---|---|
UNIX/Linux | $HOME | .hp-15c.mem |
Windows 95/98/ME | $WINDIR | HP-15C.mem |
Windows NT 4.0 | $HOMEDRIVE\$HOMEPATH | HP-15C.mem |
Windows 2000/XP | $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>.
The following items are saved in the memory file:
Some statuses are reset to their default value before writing them to the file:
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 that can then be executed in RUN mode. After the HP-15C is turned on, it is in RUN mode.
You can also choose between REAL mode and COMPLEX mode. By default, the HP-15C is in REAL mode.
RUN/PRGM mode and REAL/COMPLEX mode are independent from each other. For example, you can enter a program in REAL mode and than execute it in COMPLEX mode and vice versa.
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 not between the operands, but after them. For the
HP-15C this means, that you first enter the digits of the first operand, hit the
ENTER key, which pushes the input to the top of a stack (see below), then
enter the digits of the second operand, then select the operation. The operation will operate on
the numbers put on 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, 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, removes them from the stack and writes the computed result to the X register. The other registers are 'popped', that means, 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 |
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 switch 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:
To enter a complex number, you load 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, which first creates 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 complex 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.
The following functions make use of the imaginary stack:
√x x2
LN LOG
1/x 10x
ex ABS
→R →P
SIN COS
TAN
SIN-1 COS-1
TAN-1
HYP HYP-1
+ −
× ÷
yx
x = 0 TEST 0
(x ≠ 0
) TEST 5
(x = y
) TEST 6
(x ≠ y
)
x↔y R↓ R↑ ENTER LSTx
All other functions ignore the imaginary stack.
To write a program on the HP-15C you must switch to PRGM mode. To enter PRGM mode click g P/R or press <F9> on the keyboard. The display will change and the word "PRGM" appears in the bottom right corner of the display:
You can now start to key in operations, as you would do in RUN mode. The HP-15C will record the keys as
you type them in but does not execute any function. HP-15C programs are more like macros than
like 'real' programs.
Each program must begin with a label; valid labels are the letters A-E
and the numbers
0-9
and .0-.9
. As an example, we will write a program that starts with label A
.
Click f LBL A or
key in <F8> <Q>.
This is the first program step and it is displayed like this:
Each key on the HP-15C is identified by a two-digit code that is derived from its position on the keypad.
The first digit gives the row (starting at 1) and the second digit gives the column (where 0 means 10). For
example, LBL is on the first key in the second row and therefore has the key
code 21
. Digit keys differ from that rule; the (single) digit itself identifies them.
The codes in a three-key sequence are separated by a digits group separator. Codes in a two-key sequence are separated by blanks.
There are also some four-key sequences like
STO + . 5,
which adds the contents of the X register to register 15. This sequence is displayed
like this:
To complete the program key in the following sequence:
This little program computes the time it takes for an object to fall from a given height to the ground in
the earth gravity field. The gravitational acceleration is approximated with 9.8 m/s2
.
In PRGM mode you can right-click the display to display the program pop-up menu. The full description of this pop-up menu can be found in the Pop-up menu section.
To run the program you must switch back to RUN mode. Press g P/R again.
To run a program you press the GSB key followed by the program label. Thus, GSB A will run the program from the previous chapter. While a program is running, the word "running" is blinking in the display:
Programs with an alpha label can also be run by clicking on the labels A through E. Programs with numeric labels can only be run using the GSB key. In addition to that, the Simulator provides several shortcuts to run programs. See the Program (RUN mode) section in the keyboard chapter for a complete list.
Any key pressed and any mouse click will interrupt a running program.
The GTO key can not be used to run a program. In RUN mode
GTO A positions the program pointer on the
step with label A
, but does not run the program.
The current program is always part of the memory file and is therefore saved automatically every time you
save the memory. Moreover, programs can also be saved separately: If you press
<Ctrl>-<S>, the operating systems
"Save file" dialogue box pops up. The Simulator supports the file extensions .15c
and
.txt
; the default is .15c
.
To open a program file press <Ctrl>-<O>. The operating systems "Open file" dialogue box will pop up. If a program is read in, all currently loaded programs are deleted. There is no option to merge programs upon reading. See the next section on the file format how to do this manually.
The Simulator remembers the last directory used, used for writing or reading a program file. This directory is used as the initial directory the next time you open a dialogue box.
Simulator program files are simple text files. The following figure shows the program file for the little program used in the previous sections:
HP-15C simulator program |
---|
# -------------------------------------------- # Tcl/Tk HEWLETT·PACKARD 15C Simulator program # Created with version 1.1.0 # -------------------------------------------- 000 { } 001 { 42 21 11 } f LBL A 002 { 2 } 2 003 { 20 } × 004 { 9 } 9 005 { 48 } . 006 { 8 } 8 007 { 10 } ÷ 008 { 11 } √x 009 { 43 32 } g RTN # -------------------------------------------- |
Like on the real HP-15C step 000
is always empty.
Each line in a program file must be of one of the following types:
Comment lines begin with a #
. Leading whitespaces are ignored.
The Simulator does not read in comment lines. All comments, except the header and footer generated by the Simulator, are lost when you write back the program to the same file.
A blank line is a line that contains only whitespaces or is of zero length. Blank lines are skipped.
Each line not recognised as a comment or a blank line is expected to contain a program step. The line must then have the form:
[line_number] "{" key_sequence "}" [mnemonic]
The key_sequence
must be a valid HP-15C key sequence enclosed in curly braces;
line_number
and mnemonic
are optional.
Program files are encoded in UNICODE by default to preserve all special characters used in mnemonics. You can
change the encoding to ASCII (see Preferences), but then
mnemonics with special characters are not stored correctly. Key sequences are not affected because key codes
contain only digits.
If a file is read in, only the key sequences are used. Line numbers and mnemonics are saved for
documentation purposes only.
The Simulator uses the file format described so far, when it writes a program file. Since the files are
simple text files, you can use any text editor that supports UNICODE to edit them. When you edit files the
only thing you need to take care of are the key sequences. For example, you may want to increase the gravitational
acceleration precision in the program example from 9.8 m/s2
to
9.81 m/s2
. You just have to insert a new program step with the key code for digit
1
after line 006
:
HP-15C simulator program |
---|
... 003 { 20 } × 004 { 9 } 9 005 { 48 } . 006 { 8 } 8 { 1 } 007 { 10 } ÷ ... |
Neither the line number nor the mnemonic must to be specified. Program steps are automatically renumbered when the file is read in. When you write back the program with the Simulator, the full file format will be used. Missing information, like the mnemonics, are added by the Simulator.
Omitting all optional information brings us to the simplest form of the example program file
Simplified file format |
---|
{42 21 11} {2} {20} {9} {48} {8} {10} {11} {43 32} |
If you press <Ctrl>-<F1> the Simulator searches the directory
from where you last loaded a program for an HTML-file with the same name as the program file but the
extension .htm
or .html
. If a program help file is found, it is displayed in
the help file browser.
The "progs
" directory of this distribution contains an example program "Little_Gauss.15C
"
and its help file "Little_Gauss.htm
".
The preferences dialogue box allows you to change some Simulator parameters. It can be found in the ON pop-up menu: <Alt>-<O>-<Preferences…>
Pressing <OK> or <Apply> will activate the new settings for the current session. The settings are not saved to disk, and therefore not made persistent, until you save the current session. If you have unchecked "Save on exit" (see below) you must save the current session manually by pressing <Ctrl>-<M>.
The following items can be set in the dialogue box. Default values are used if no memory file is found at start-up.
If checked, a period is used as decimal point in the clipboard. The setting is independent from the current display settings for the decimal point and the decimal separator.
Default: not checked
If this option is checked, the program pop-up menu (<Alt>-<S>) displays program steps as mnemonics. If unchecked, program steps are displayed with their key codes. Please note that this setting does not affect the display.
Default: checked
If checked, the program pop-up menu will show labels, Return
, GoTo
and
GoSub
statements coloured.
Default: checked
The program pop-up menu displays the program steps in a multi-column format. This value defines the number of program steps per column.
Default: 30
By default, the storage pop-up menus show the available storage registers in two columns. Uncheck this setting if you want the storage menus with all storage registers displayed in one column.
Default: checked
By default, program files are encoded in UNICODE. Uncheck this option to encode them in ASCII.
Default: checked
This option can not (yet) be unchecked.
Default: checked
If checked, continuous memory is enabled. When you exit the Simulator, the status is saved to disk.
If you have unchecked this option, you must save the memory manually, to make the new setting persistent!
Default: checked
Time in milliseconds a program pauses during execution when it encounters an
f PSE statement.
This is also the time the display changes when you press f PREFIX
or g MEM. Setting the pause length to smaller
values, e.g. zero, is therefore not suggested.
Default: 1000
Time in milliseconds a program pauses after each statement. A value of around 100 gives a good impression of the performance of the real HP-15C. A value of 0 gives maximum performance.
Default: 100
The Simulator layout depends very much on the combination of fonts, font sizes and display resolution. The Simulator therefore provides predefined font sets for common display resolutions. These font sets have been fine adjusted to achieve a good reproduction of the real HP-15C aspect ratio.
The following table lists the available font sets for each platform and display resolution:
Platform | Resolution | Font set | Fonts used in set |
---|---|---|---|
UNIX/Linux | 70-80 DPI | UNIX Standard fonts, small | Helvetica Bitstream Vera Sans Courier |
UNIX Standard fonts | Helvetica Courier |
||
Microsoft fonts | Arial Microsoft Sans Serif Tahoma Courier New |
||
81-135 DPI | UNIX Standard fonts, small | Helvetica Courier |
|
UNIX Standard fonts | Helvetica Courier |
||
Microsoft fonts, small | Arial Microsoft Sans Serif Courier New |
||
Microsoft fonts | Arial Microsoft Sans Serif Courier New |
||
MS Windows (all versions) |
91-119 DPI 120-140 DPI |
Microsoft fonts, small | Arial Arial narrow Microsoft Sans Serif Courier New |
Microsoft fonts | Arial Arial narrow Microsoft Sans Serif Courier New |
||
URW fonts | Nimbus Sans L Nimbus Sans L Condensed Bitstream Vera Sans Courier New |
Remarks:
This setting allows you to set the browser used to display the online help.
When you run the simulator for the first time or if no browser is set, the Simulator checks for the following
browsers in all directories from the PATH
environment variable:
Platform | Browser list |
---|---|
UNIX/Linux | mozilla firefox netscape opera konqueror |
Windows | mozilla firefox netscape opera iexplore start hh |
Remarks on some browsers:
start
in the Windows list will always run the default browserhh
is the browser used with the online help on Windows 2000/XP.
All browsers found will be listed and the first from the list will be set as the help file browser.
You can choose another browser from the list of specify one using the <Browse...
> button
This section describes the differences between the real HP-15C and the Simulator.
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 mimics the behaviour of that function, so the differences between the Simulator and the real HP-15C are rather small:
I compared results from the Simulator and the HP-15C and found that the Simulator produces better approximations in less time.
I do not know which method the real HP-15C uses to find the roots of an equation. The Simulator uses the "Regula Falsi" method.
There are little differences for results with large exponents. For example, the root for
x4 = 0
is computed as 1.5060 -25
on the real HP-15C and as
3.8481 -14
on the Simulator.
Up to version 8.3.x the Tcl/Tk interpreter supports only 32 bit integers. A number is treated
as integer, if it has no decimal point. A 10-digit integer can therefore exceed the valid range
(0 - 232
) for an
integer. To avoid an integer overflow, such a number is automatically converted to real. That is, a decimal
point is be appended as soon as you enter the 10th digit.
On the real HP-15C you can key in a 10-digit number and than key in a decimal point separately. When you click ← or press Backspace, a first click deletes the decimal point and a second click deletes the 10th digit.
If you click ← or press Backspace on the Simulator, both the decimal point and the 10th digit are deleted by a single click.
Matrix operations are not supported and I have no plans to add this feature.