HP HP-28S User manual

HP-28S
HP-28S Quick Reference
General
List of
contents
See at the end of this document.
HP-28S Famous calculator made by Hewlett-Packard from 1988 1992.
Memory 32768 bytes for stack, programs and data.
Approximately 31.6 kBytes available to the user.
Contrast
adjustment
Press and hold ON then press + or to change the contrast.
Number
resolution •56 bit for real numbers, 12 decimal digits of precision, exponent
range ±499
•64 bit for binary numbers
The Stack The HP-28S is a stack-based calculator.
For details on using the stack see STACK Menu.
Commands
and Menus •Commands can be entered by typing their name explcitly.
•Most commands and functions are organized in menus, some are
directly available on the keyboard. See Direct Key Command .
•SYSEVAL is the only command which neither accessible thru the
keyboard not thru a menu. See Sy tem Operation .
•Some commands are present in multiple menus.
Endless-loop
interruption
See Sy tem Operation . Note that a program or other lengthy
operations can usually be interrupted by pressing "ON".
Audible
feedback
Can be turned off by clearing flag 51, see Flag .
HP-28C The main difference is the smaller memory of only 2 kByte.
And whereas the HP-28S comes with a software version "2BB" it is
"1BB" for the HP-28C.
Manuals At least four editions of the Reference Manual exist: Version 1 dated
October 1987 to version 4 dated November 1988.
This Quick Reference is based on my experience with a HP-28S version
"2BB". It is best described by edition 4 of the Reference Manual.
Author A. Thimet, V1.0, © 2003, all right reserved.
1

HP-28S
Direct-Key Command
General The following section gives a description of useful commands that are
directly accessible from the keyboard.
•Commands are listed in the order as they show up on the calculator
keyboard, from top left ("A") to bottom right ("+").
•On the calculator menus are generally indicated by a white label
backround.
•In the following text menus are indicated by bold-faced print in the left
column.
•References to other sections of this Quick Reference are also printed
bold-faced.
•When a menu key is pressed it displays six "soft labels" on the bottom
of the LCD screen which are associated with the white top row keys
below the display. Pressing one of these keys will activate the
command written on the soft label.
•Pressing "<>" to the right of the red SHIFT key will remove the soft
labels from the LCD display and the white keys beneath will resume
their cursor-control meanings printed in white above the buttons.
See CURSOR Menu.
Command
line
editin
g
Pressing a command key performs different actions depending on the
current input mode:
•If no command line is currently being edited and Alpha Mode (see
below) is not active the command is immediately applied to the stack
contents.
•If command line editing is in progress some commands will evaluate
the entire command line and produce immediate results. These
commands (ie. STO) perform an implicit ENTER.
•If Alpha-Mode is active or if a command is typed in explicitly or if a
command key is pressed which doesn't perform an implicit ENTER (ie.
"+") then the command word or symbol is appended to the command
line.
To abort editing without executing any commands press ON.
ARRAY Vector and matrix creation, manipulation and operations.
See ARRAY Menu.
BINARY Binary number bases (bin, dec, oct, hex) and operations including rotation.
See BINARY Menu.
COMPLX Complex number creation and operations. See COMPLX Menu.
STRING String functions and conversions. See STRING Menu.
LIST List creation and manipulation. See LIST Menu.
eWhen 'e' (lower case E) is converted into a number using →NUM it
evaluates to 2.71828…
If flag 35 is clear then 'e' immediately evaluates to its numeric value.
See Flag and Evaluation Rule .
2

HP-28S
REAL Functions for real number arguments. See REAL Menu.
STACK Stack manipulation. See STACK Menu.
STORE Storage arithmetic. See STORE Menu.
MEMORY Memory display, MENU management, paths and directories.
See MEMORY Menu.
iWhen 'i' (lower case I) is converted into a number using →NUM it
evaluates to the complex number (0,1).
If flag 35 is clear then 'i' immediately evaluates to its numeric value.
See Flag and Evaluation Rule .
ALGEBRA Symbolic formulae manipulation and Taylor series expansion.
See ALGEBRA Menu.
STAT Summation and statistics. See STAT Menu.
PRINT Printing and printer control. See PRINT Menu.
CONTRL Programming: Control functions, text display, sound. See CONTRL Menu.
BRANCH Programming: Branch and loop instructions. See BRANCH Menu.
TEST Programming: Flag manipulation and various tests. See TEST Menu.
CATALOG Displays a list of all built-in functions. See CATALOG Menu.
UNITS Displays a list of all built-in units. See UNITS Menu.
≤ ≥ < >
== ≠Comparisn operators. See TEST Menu.
→The right arrow key above the character U is used to store local variables
in a program, see Program .
# " { } [ ]
( ) << >>
Delimiters required to enter certain kinds of data types.
Note that trailing delimiters are automatically added. See Data Type .
NEWLINE Used to insert a line break in a program (ENTER cannot be used because it
would push the progam onto the stack)
LC Toggle between lower and upper case characters
αAlpha-Mode:
While editing the command line many command keys will immediately
evaluate the command line and produce a result (implicit execution of
ENTER). However, in Alpha-Mode the command key symbols will be added
to the command line und evaluation occurs only when pressing the ENTER
key explicitly.
MENUS Menu-lock.
•When active, pressing a character key with an associated menu
activates the menu (ie. pressing "F" activates the REAL menu). To
select the character, press shift-key.
•When inactive pressing a character will return the character and shift-
key activates the menu.
Note that the status of Menu-lock is not indicated in the LCD display!
INS Toggle command line editing mode between insert and overwrite.
Default is overwrite. See CURSOR Menu.
DEL Delete character under cursor in editing mode. See CURSOR Menu.
← → ↑ ↓Cursor movement in editing mode. See CURSOR Menu.
<> Activates the CURSOR Menu, see there.
MODE Display and angle modes and various general settings. See MODE Menu.
TRIG Trigonometric functions. See TRIG Menu.
LOGS Logarithms and exponential functions. See LOGS Menu.
3

HP-28S
SOLV Numerical solver and root finder. Symbolic solver for quadratic formulas.
See SOLV Menu.
PLOT Plotting curves on the LCD display. See PLOT Menu.
USER Display user variables and progams in the current directory.
See USER Menu.
CUSTOM Custom menu. See CUSTOM Menu.
NEXT, PREV Display next or previous set of menu soft-labels if a menu is active.
These soft-labels are displayed on the bottom of the LCD screen. When a
menu is active the cursor keys printed above of the top row of white keys
beneath the LCD display are not available. Rather, the command indicated
by the soft-label will be executed when the corresponding white key is
pressed.
ENTER •When a command line is present its contents are evaluated and
commands executed.
•Without a command line this performs a DUP and pushes the stack.
See STACK Menu.
•Note that ENTER is not a command! It cannot be used in a program. It
is only a command to the calculator to evaluate the command line.
EDIT Edit the contents of stack level 1.
After pressing ENTER the modified data overwrites the old contents.
CHS Change sign of number.
In a program enter NEG to negate stack level 1.
VIEW↑Change the visible section of the stack so that higher stack contents are
visible. Useful when the stack contains many elements.
Cannot be used in programs.
EEX Enter exponent for number.
If not in edit mode "1E" is put into the command line.
VIEW↓Change the visible section of the stack so the lower stack contents are
visible. Cannot be used in programs.
DROP Drop the stack and discard contents of stack level 1. See STACK Menu.
ROLL Move a specified stack object to level 1. See STACK Menu.
⇐Delete character to the left in editing mode.
This does never delete the element in stack level 1.
SWAP Exchange stack level 1 and 2. See STACK Menu.
' Name or equation delimiter. See Data Type .
Note that trailing delimiters are automatically added.
VISIT •Put the
contents
of a variable for editing into the command line. Ie.
'A' VISIT puts the contents of variable A into the command line for
editing.
•If the argument is a number the contents of the corresponding stack
level are retrieved for editing. Ie. 3 "A" 2 1 3 VISIT puts the
contents of stack level 3 ("A") into the command line for editing.
To abort the VISIT operation press ON. To keep modifications press
ENTER. This will store the modified data in the variable or the earlier
specified stack level.
COMMAND ENTER (or any other command that involves execution of ENTER) stores a
copy of the current command line provided MODE CMD has been activated
(see MODE Menu).
4

HP-28S
COMMAND can be used to retrieve this stored command line for editing.
UNDO ENTER (or any other command that involves execution of ENTER) stores a
copy of the current stack before it executes provided MODE UNDO has
been activated (see MODE Menu).
UNDO recalls the previousely stored stack layout.
Note that this feature potentially requires a lot of memory!
LAST When a command takes arguments from the stack those arguments will be
saved provided MODE LAST has been specified (see MODE Menu).
LAST retrieves these saved arguments and pushes them back onto the
stack. Note that the number of saved stack arguments depends on the
command.
If MODE LAST is active and a command produces an error then the stack is
automatically restored. If MODE LAST is not active these arguments are
lost.
1/x Reciprocal of numbers or matrices.
Displayed in equations and programs using the INV() function notation.
STO Stores the object in stack level 2 in the variable who's quoted name is
given in stack level 1. Ie. 5 'A' STO stores 5 in variable A and drops both
objects from the stack. See STORE Menu.
RCL Recall variable and push it onto the stack. This does not evaluate the
contents of the variable or execute a program. The quoted variable name
is replaced by the recalled object. See STORE Menu.
PURGE Delete variable or program who's name is given in stack level 1. This
command can operate on lists of names! To erase all variables of the
current directory use MEMORY VARS PURGE
Warning: VARS also returns subdirectory names so in the above example
all subdirectories will be returned as well!!
See STORE Menu.
∫Numeric or symbolic integration. See Integration.
d/dx Symbolic differentiation. See Differentiation.
^ Exponential function. Ie. –2 3 ^ returns 8 in stack level 1.
Accepts real and complex numbers.
EVAL Evaluate quoted name or program in stack level 1. See Evaluation Rule .
→NUM Same as EVAL but also converts a symbolic name into a number.
Ie. 3 π * results in '3*π' and →NUM converts this into 9.424…
CONT Continue an interrupted program. See Program .
% Percentage.
Note that different from other HP calculators this does drop the stack.
%CH Percentual difference from contents in stack level 2 to contents in stack
level 1.
√XSquare root. Displayed in equations and programs using the square root
symbol "√".
ON Turns calculator on, clears errors displays, aborts command line editing,
interrupts programs. ON never discards data from the stack.
OFF Turns calculator off.
It automatically turns itself off after a few minutes of inactivity.
CLEAR Clear the stack. See STACK Menu.
CONVERT Convert between different units. See UNITS menu.
5

HP-28S
Data Type
General •All of the data types described below can be stored on the stack
and in variables.
•Special delimiters are used to denote different kinds of data types.
•Each data type has a type-identifier, see TEST Menu.
Real numbers 3.4567E12 See REAL Menu.
Complex
numbers
(2.3,4.5) where 4.5 is the imaginary part. See COMPLX Menu.
•When using a comma as decimal separator this must be
entered as (2,3.4,5)
•Instead of the separator symbol a SPACE can be used!
•Note that it is not possible to refer to variables when
constructing a complex number: ( Y) will cause an error.
Binary numbers #123456 See BINARY Menu.
Strings "This is a string!" See STRING Menu.
Real fields [1,2,3,4] or [[1,2] [3,4]]
•Can be a vector or matrix. See ARRAY Menu.
•Note that it is not possible to refer to variables when
constructing a field: [ Y] will cause an error.
Complex field [(1,2) (3,4) (4,5)] or [[(1,2) (2,3)] [(4,5) (5,6)]]
Can be a vector or matrix. See ARRAY Menu.
List { 1 A B "String" }
A list of objects. See LIST Menu.
Note that almost everything can be put in a list: {* = ^}
This is important when doing symbolic manipulations on
equations, see ALGEBRA Menu.
Object delimiters cannot be put in a list.
Names ' 2'
Used to reference stored variables of the above data types. When
a number is put in single quotes the plain number is used. Other
data types cannot be put in quotes, ie. '[1]' ENTER will cause
an error but '1.5E3' will not.
Expressions 'A+B' or 'C=A+B'
Note that like other data objects expressions can be stored in
variables!
Program << 3 * >>
A series of program instructions. See Program .
6

HP-28S
Program
General •A program is a series of commands surrounded by << and >>
brackets. These symbols are located next to the SPACE key.
•The programming language is called RPL: Reverse Polish Lisp. It
is stack based with a support for many data types. The HP-28C/S
was the first calculator to use RPL. Later models like the HP-48
and HP-49 used it as well.
•Control instructions are described in the CONTRL Menu
•Branching instructions are descibed in the BRANCH Menu
•Flag manipulation and other program commands are described in
MENU Te t
•Programs can be stored in variables like other objects.
See Data Type .
•There is no GOTO available. Use structured programming instead.
•Programs can be interrupted by pressing "ON".
Program example <<ROT * SWAP 2 / CHS DUP SQ ROT - √ >> 'QE' STO
•Program QE takes 3 input values from the stack which represent
coefficients a, b and c of a quadratic equation.
•The program returns two values r1 and r2 on the stack. The two
solutions of the quadratic equation can be calculated as r1+r2
and r1-r2.
Local Variables A program can have local variables.
Using local variables avoids conflicts with global variable names.
Example: <<→ x y <<x y + LN>> >> 'P' STO
This creates the program and stores it in a variable called P.
Important: The SPACE after the "→" is required!
The program takes two arguments from the stack and puts them into
the local variables x and y. The return value is ln(x+y).
Example: 1 2 P returns 1.0986…
This program could also be entered in the form of an expression:
<< → x y 'LN(x+y)' >> 'P' STO
Both the program and expression form allows to invoke the program
in functional notation.
Example: 'P(1,2)' EVAL also returns 1.0986…
Important: For some reason the sequence P(1,2) ENTER will not
work but rather issue and error.
Editing a
program •Use 'P' VISIT to bring back the program into the command
line for editing.
•Use NEWLINE to enter line breaks to make the program code
more readable.
Comparisn
operators
> ≥ < ≤ == ≠ and flag checking commands return either 0 or 1 onto
the stack and can be used to steer branch instructions.
Note that the values to be compared must be present on the stack.
Example: 4 5 > returns 0.
For more details see TEST Menu.
Subroutines Simply specify the name of the program to execute. Example:
<< SQ LN 1 + >> 'P1' STO
<< P1 SWAP P1 + >> 'P2' STO
7

HP-28S
When P2 is invoked it calls P1 with the values in stack level 1 and 2
and adds the results that P1 produced (which is ln(x²)+1).
ARRAY Menu
General •Arrays (or fields) are either vectors or matrices.
•Arrays can be real or complex.
•If an array contains a single complex value the entire array is
automatically complex.
•Lengthy array operations can be interrupted by pressing ON
•Arrays are entered by using square brackets [ and ].
•Example 2x2 matrix: [[1 2] [3 4]]
+ −Add/substract vectors or matrices of matching dimensions.
This also works on mixed real/complex arguments but if a complex
argument is involved the result will always be complex.
* Multiplication. Either operand may be real or complex:
•Multiply vector by number or number by vector → vector
•Multiply matrix by number or number by matrix → matrix
•Multiply matrix by vector → vector
•Multiply matrix by matrix → matrix
÷ • Calculate matrix X so that M1*X=M2 where M1 and M2 are matrices in
stack level 1 and 2. Or: B A ÷ calculates X=B/A so that AX=B.
•Calculate vector X so that M1*X=V2 where M1 and V2 are the matrix
and vector in level 1 and 2. Or: V M ÷ calculates X=V/M so the M*X=V.
These operations produce more accurate results then using the INV
command on matrices. The matrices must be square. Can often be used
even if the matrix A or M is singular and thus solves systems where the
number of variables does not match the number of equations.
INV (1/x) Returns inverse of square matrix.
SQ (x²) Returns the square of a square matrix.
→ARRY Convert stack values into a matrix or vector:
•1 2 … n n →ARRY results in vector [X1 X2 … Xn]
•11 12 … nm {n m} →ARRY results in matrix [[X11…X1m] …
[Xn1…Xnm]]
•Note that combining a number of vectors into a matrix is not possible!
•An error occurs if the stack doesn't hold enough values for the matrix or
if they are not of numerical type.
•If any one value on the stack is complex the resulting array will be
complex.
ARRY→The inverse operation of →ARRY. Vector and matrix dimensions are
returned as a number or length-2 list in stack level 1.
PUT Replace value of a matrix or vector:
•V {idx} PUT puts the number X into vector V at position idx and
returns the modified vector in level 1.
•M {row col} PUT puts the number X into matrix M at position
(row,col) and returns the modified matrix in level 1.
•'Nam' {idx} PUT puts the number X into vector named Nam at
position idx and returns nothing.
8

HP-28S
•'Nam' {row col} PUT puts the number X into the matrix named
Nam at position (row,col) and returns nothing.
Note that you cannot put a complex number into a real matrix!
Vector and matrix indices count from 1.
GET Inverse operation of PUT:
•V {idx} GET pushes the number at position idx in vector X onto the
stack.
•M {row col} GET pushes the number at position (row,col) in matrix
M onto the stack.
•'Nam' {idx} GET pushes the number at position idx in vector named
Nam onto the stack.
•'Nam' {row col} GET pushes the number at position (row,col) in
matrix named Nam onto the stack.
Vector and matrix indices count from 1.
PUTI This is similar to PUT but it does not discard the index value but rather
increments it (including row wrap) and returns it on stack level 1.
Example: V {idx} PUTI puts the number X into vector V at position idx
and returns the modified vector (or its name) in level 2 and {idx+1} in level
1. This greatly simplyfies the input or modification of vectors and matrices.
GETI Reverse operation of PUTI.
Example: V {idx} GETI returns V (or its name) on stack level 3, {idx+1}
on stack level 2 and the retrieved number on stack level 1.
SIZE Returns the size of the specified vector as a length-1 list or the size of a
matrix as a length-2 list in {rows columns} format.
RDM Redimensions a matrix or vector. Added elements are set to 0. If the new
dimension is smaller than the original one then elements are discarded.
It is possible to redimension a matrix into a vector and a vector into a
matrix. Examples:
•[1] {2 2} RDM redimensions the vector V into a 2x3 matrix and
returns the resulting matrix on stack level 1: '[[1 0][0 0]]'
•'Nam' {4} RDM redimensions the vector or matrix named Nam into a
length-4 vector and returns nothing.
TRN Transpose a nxm matrix into a mxn matrix.
When operating on a variable name the name is dropped from the stack.
For complex matrices the elements are also conjugated (imaginary part is
negated).
CON Create a "constant" matrix or vector where all elements have a specified
value.
•{3} 5 CON creates a length-3 vector with all elements set to 5.
•{2 3} 0 CON creates a 2x3 matrix with all elements set to 0.
•[1 2] 7 CON replaces all elements of the vector with value 7.
•'Nam' 2 CON replaces all elements of the matrix or vector named Nam
with value 7 and returns nothing.
IDN Create an identity matrix (all elements 0 except for 1s in the diagonal).
•5 IDN creates a 5x5 identity matrix
•[[1 2][3 4]] IDN sets elements of the square matrix to identity
matrix values.
•'Nam' IDN sets elements of the square matrix named Nam to identity
matrix values and returns nothing.
9

HP-28S
RSD Returns the residual:
'B' 'A' ' ' RSD returns B A*X in stack level 1.
A must be a matrix; B and X must be of the same type, either matrix or
vector.
CROSS Cross product of two length-3 vectors A and B returned as a length-3 vector:
[A2*B3-A3*B2, A3*B1-A1*B3, A1*B2-A2*B1]
DOT Scalar product of two equally-dimensioned vectors or matrices:
•[1 2 3] [4 5 6] DOT returns 1*4+2*5+3*6 = 32
•[[1 2] [3 4]] [[5 6] [7 8]] DOT returns
1*5+2*6+3*7+4*8 = 70
DET Returns the determinant of a square matrix.
ABS Returns the norm of a matrix or vector.
This is the square root of the sum of squares of all elements.
RNRM Row norm of a matrix or vector.
•For a vector this is the largest absolute value of all elements.
•For a nxm matrix: For each row sum up the absolute values of all n row
elements. Then take the largest value from these m sums. This returns
a single number.
CNRM Column norm. Same as RNRM but column-oriented.
For a vector this is the sum of the absolute values of all vector elements.
R→C Combine two real matrices or vectors into a complex matrix or vector where
the field in stack level 1 will be the imaginary part.
C→R Split a complex matrix or vector into real and imaginary part.
Stack level 1 will receive the imaginary part.
RE Return the real part of a real or complex matrix or vector.
IM Return the complex part of a real or complex matrix or vector.
For a real matrix/vector this will return a matrix/vector filled with zeros.
CONJ Conjugate a real or complex matrix or vector.
This will negate all imaginary parts.
Will do nothing on a real matrix or vector.
NEG (CHS) Negate each matrix or vector element.
BINARY Menu
General •"Binary" numbers are unsigned integer numbers with a maximum length of
64 bit.
•Binary numbers can be entered and displayed in binary, octal, decimal or
hex format (don't confuse binary display mode with the binary number
type!).
•Binary numbers are entered using the pound sign: #3A75C.
The digits must be valid for the selected number base.
•To enter a number in a number base other than the current one use a
trailing specifier: d (decimal), o (octal), h (hex), b (binary). Ie. #3Ah.
The number will automatically be converted to the current number base.
•Negative binary numbers are not supported.
+ - x ÷These can be used on binary or mixed binary/real numbers.
The result will be a binary number with the fractional part cut off.
Binary and complex numbers cannot be combined.
10

HP-28S
DEC Select decimal entry format and display all binary numbers in the stack in
decimal notation with a trailing 'd'.
HEX Select hexadecimal entry format and display all binary numbers in the stack in
decimal notation with a trailing 'h'.
OCT Select octal entry format and display all binary numbers in the stack in
decimal notation with a trailing 'o'.
BIN Select binary entry format and display all binary numbers in the stack in
decimal notation with a trailing 'b'.
STWS Use the real number N in stack level 1 to specify a new word size of N=1…64
bits. N<1 is the same as N=1 and N>64 is the same as N=64.
A binary number cannot be passed to STWS!
RCWS Return the current word size.
RL Rotate the binary number in stack level 1 one bit left. The topmost bit
becomes bit0.
For this and the following commands the topmost bit is determined by the
current word size.
RR Rotate one bit right. bit0 will be the topmost bit.
RLB Rotate ony byte left. The topmost 8 bits will become bits0-7.
RRB Rotate ony byte right. bits0-7 will become the topmost 8 bits.
R→BConvert real number X into binary number.
If X<0 the result will be 0. If X>0xFFFFFFFFFFFFFFFF the result will be
0xFFFFFFFFFFFFFFF reduced to the currently selected word size.
Note that reduction is carried out after conversion to a 64-bit integer. So if
the word size is 4 and 17d is entered the result will be #1d.
B→RConvert binary number to real. Some significant digits may be lost!
SL Shift one bit left. Inserts zero in bit0.
SR Shift one bit right. Inserts in the topmost bit.
SLB Shift one byte left. Inserts zero in bit0-7.
SRB Shift one byte right. Inserts zero in the topmost 8 bits.
ASR Shift one bit right. Duplicates the topmost bit and discards bit 0.
AND AND operation
OR OR operation
XOR XOR operation
NOT Invert all bits
11

HP-28S
COMPLX Menu
General •Complex numbers are entered using brackets: (1.72 378) (2,4.5)
The left number is the real part and the right one the imaginary part.
Note that either a space or the delimiter symbol (either dot or comma,
depends on the current RDX setting) can be used to separate the real and
imaginary part.
•Among others the following operations can be performed on complex
numbers:
•+ - x ÷ INV Simple arithmetics, inverse (1/x)
•SQ √ ^ Square (x²), square root and exponential
•SIN COS TAN Trigonometric functions and their inverse
•SINH COSH TANH Hyperbolic functions and their inverse
•E P LN LOG ALOG Logarithms and their inverse
R→CCombine two real numbers in stack level 1 and 2 to a complex number where
the number in stack level 1 will be the complex part.
C→RSplit complex number into real part (stack level 2) and imaginary part (stack
level 1)
RE Return real part of complex or real number.
IM Return complex part of complex or real number.
For a real argument this will always be 0.
CONJ Conjugate a complex or real number (negate the imaginary part).
Performs no action on a real number.
SIGN Return unary vector in the direction of the complex number:
(x/sqrt(x*x+y*y), y/sqrt(x*x+y*y))
R→PConvert from rectangular to polar coordinates. See TRIG Menu.
P→RConvert from polar to rectangular coordinates. See TRIG Menu.
ABS Absolute value of complex or real number.
For a complex number this is sqrt(re*re+im*im)
NEG Negative value of complex or real number.
ARG Returns the angle θ of the complex number (x,y) vector with the x-axis.
•≥0: θ=atan x/y
•<0: θ=atan x/y + π*sign(y)
STRING Menu
General •Strings are entered in double quotes: "This is a string."
•The length of a string is only limited by the available memory.
•Strings are based on all 255 ASCII characters.
+ Concatenate strings in stack level 1 and 2.
→STR Convert any object type in stack level 1 into a string.
The conversion preserves the current display format including multi-line
mode. NEWLINE symbols inside the string are displayed as .
If the object in level 1 is a string no additional quotes are added.
STR→Convert a string back into objects and evaluates them.
"3 4 + 10 *" STR→ evaluates the commands in the string and produces
70. This is essentially what ENTER does with the command line.
CHR Convert ASCII character code in stack level 1 into a string.
12

HP-28S
Note that the command does not accept binary numbers!
NUM Return ASCII code of the first character of the string in stack level 1 as a real
number.
→LCD Writes the data of the given string into the LCD pixel memory.
Each characters inside the string represents 8 pixel. Bit0 of the first character
represents the pixel in the very top left corner. Bit1 of the first character the
pixel below etc. Bit0 of the 2nd character represents the 2nd pixel from left at
the very top of the display.
If the string does not contain enough characters to fill the entire LCD screen
then the remaining pixels are unchanged.
LCD→Returns a 548 byte string representing the pixel data of the LCD screen.
Each character receives the data of an 8 pixel-column, starting with the
column in the top left corner of the LCD screen.
The screen itself is 137x32 pixel in size.
POS Seach for the string given in level 1 within the string in level 2 and return the
position where the string was found or 0 if not found.
"This is a string" "str" POS returns 11.
SUB Returns a substring of the string in level 3. The numbers in level 2 and level 1
specify the start and end position of the substring (counting from 1).
"This is a string" 3 7 SUB returns "is is".
Start and end positions cannot be specified in a length-2 list.
SIZE Returns the length of the string.
DISP Display the string in level 2 on the LCD display line given in level 1 (1…4). See
CONTROL Menu.
LIST Menu
General •A list is a sequence of arbitrary objects which need not be of the same
type.
•Lists are entered by using curly brackets:
{1 (2,3) 5 "A" Q [7 8] {a b c}}.
•A lists may be put inside another list.
•In order to avoid evaluation of names when they are typed on the
command line to be put in a list they can be entered in single quotes or
with Alpha-Mode turned on. The quotes are removed when the list is
created.
+ Used to append objects of any type to a list:
•"Hi!" {1 2 3} + returns {"Hi!" 1 2 3}
•{3 4 5} [7 8 9] + returns {4 5 6 [7 8 9]}
•{1 2 3} {a b c} + returns {1 2 3 a b c} rather than
{{1 2 3} a b c}
→LIST Combine n elements on stack levels 2…n+1 into a list.
n must be given on stack level 1.
Some of the list components my be lists themselves:
{1 2 3} {a b c} 2 →LIST returns {{1 2 3} {a b c}}
LIST→Splits a list into individual elements on the stack. The length of the list is
returned on stack level 1.
PUT Put an element into a list at the given position. Similar to PUT for matrices.
•{1 2 3} 2 ' ' PUT puts the element X into the list at position 2 and
13

HP-28S
returns the modified list {1 3}
•'Nam' 2 ' ' PUT puts the element X into the list named Nam at
position idx and returns nothing.
List indices count from 1 and must be within range.
Note that this is an overwrite operation, not an insert!
GET Inverse operation of PUT:
{A B C} 2 GET pushes the element B at position 2 onto the stack.
B is not evaluated but rather returned as the name 'B'.
PUTI Put an element into a list at the given position and increase the position
index. Similar to PUTI for matrices.
Example: {1 2 3} 1 ' ' PUTI puts the element X into the list at position
1 and returns the modified list (or its name) in level 2 and 2 (the new index)
in level 1: { 2 3} 2.
This greatly simplyfies the input or modification of a list.
The index automatically wraps around.
GETI Inverse operation of PUTI.
Example: {1 2 3} 3 GETI returns the list (or its name) on stack level 3, 1
(the incremented and wrapped index) on stack level 2 and the retrieved
element on stack level 1.
The index automatically wraps around.
POS Searches for an element within a list.
Example: {1 (2,3) 5 "A"} 5 POS returns 3 because the real number 5
can be found at position 3.
SUB Return a sub-list from a given start index up to a given end index.
Example: {1 (2,3) 5 "A" 'Q'} 2 3 SUB returns {(2,3) 5}.
The start and end index cannot be specified in a list.
SIZE Returns the size (number of elements) of the list.
A list within a list counts as one list element.
REAL Menu
General •Note that various REAL functions are directly accessible on they keyboard.
See Direct-Key Command .
•Real numbers are entered without special delimiter: 3.5721E10
NEG Negates object. This can be a real or complex number or a real or complex
matrix or vector.
FACT Calculates n! for integer n or Γ(x+1) for fractional x.
Works for non-integer negative numbers but does not work for complex
numbers. Use the following program IFAC to find Γ-1(x+1):
<<→ x <<'FACT(Y)-x' 'Y' 5 ROOT>> >> 'IFAC' STO
You can verify that Γ(120.56417111)=1E200
RAND Return the next random number in the range 0 ≤ x < 1.
RDZ Takes a real number as the initializer for the random number generator.
When 0 is specified the elapsed time since power-on is used.
MAXR Largest positive real number: 9.99999999999E499
MINR Smallest positive real number: 1.00000000000E-499
ABS Absolute value of a real or complex number or a real or complex matrix or
vector. See also COMPLX Menu and ARRAY Menu.
14

HP-28S
SIGN Sign of a real or complex number.
For the sign of a complex number see COMPLX Menu.
MANT Mantissa of a real number.
XPON Exponent of a real number.
IP Integer part of a real number.
FP Fractional part of a real number.
FLOOR Return largest number ≤ x.
CEIL Return smallest number ≥ x.
RND Perform rounding of a real or complex number or a real or complex matrix or
vector according to the number of significant digits specified in the current
FIX, SCI or ENG display mode. In STD mode no rounding occurs.
MAX Return larger of the two real numbers in stack level 1 and 2.
MIN Return smaller of the two real numbers in stack level 1 and 2.
MOD Returns reminder of division of real numbers in levels 1 and 2.
This is defined as: x – y*floor(x/y)
%T Calculates percentage of total: 100*y/x
15

HP-28S
STACK Menu
General The stack of the HP-28S behaves similar to the stack of many other RPN
(Reverse Polish Notation) calculators like the HP-41. However, there are
important differences:
•In theory the stack can hold an arbitrary number of elements. (Practically,
the number is limited by the available memory.)
•In particular, the stack can be empty. In this case commands that
take arguments from the stack will cause an error. This is different
from the 4-level stack used in other HP calculators: There the stack
registers always contain numbers.
•When dropping data from the stack the content of the highest stack
level is not duplicated. Thus, it is not possible to perform "calculations
with a constant" as usual.
•To avoid a rapidly growing stack virtually all comands remove all of
their arguments from the stack before the results are pushed onto the
stack.
•Different from normal RPN calculators there is a command line. It
supports advanced editing features but also introduces slight differences
in behaviour as compared to normal RPN, see example below.
Periodically erase unneeded stack objects (use CLEAR located on the "0" key)
because a large number will slow down execution speed.
Examples All examples assume an initially empty stack.
1 2 + results in 3. Except for the result the stack is empty.
1 2 + ' ' STO stores the result (3) in variable X. The stack is empty
because like all other commands STO removes its arguments from the stack
(the value and the variable name).
1 ENTER 2 ENTER + results in 3 and an otherwise empty stack. On a
normal RPN calculator the result would be 4 in stack level 1 and 1 in level 2.
This is because the 2nd ENTER moves the input value (2) from the command
line to stack level 1 only.
1 ENTER 2 ENTER ENTER + returns 1 and 4 because the 3rd ENTER acts
as a DUP which duplicates the element in stack level 1.
1 ENTER 2 DUP + also returns 1 and 4 because DUP explicitly duplicates
the 2.
Note that ENTER is not a command! It merely tells the calculator to evaluate
the command line. If the command line is empty it executes the DUP
command as a convenience.
DROP Above the "9" key: Discard the object in stack level 1 and shift all other
values one stack level down.
SWAP Shifted "⇐" key: Exchange the object in level 1 and 2 without evaluating
them.
ROLL Shifted DROP key: Move a specified stack object onto the top of the stack.
Example: 10 20 30 40 50 3 ROLL
Moves the 3rd stack object (30) to the top of the stack. After the operation the
stack looks like this: 10 20 40 50 30
DUP Same as ENTER with an empty command line: Shift up objects in the stack by
1 level. The object in level 1 is duplicated into level 2.
OVER Pushes a copy of the element in stack level 2 onto the stack. Example:
16

HP-28S
10 20 30 40 OVER produces 10 20 30 40 30
DUP2 Pushes a copy of the elements in stack level 1 and 2 onto the stack. Example:
10 20 30 40 DUP2 produces 10 20 30 40 30 40
DROP2 Discards stack elements in level 1 and 2 and rolls down the stack.
ROT Rotates the elements in the first three stack levels up.
This is equivalent to "3 ROLL". Example:
10 20 30 40 ROT produces 10 30 40 20
LIST→See LIST Menu.
ROLLD Moves the element on top of the stack to a higher stack position.
This is the inverse operation of ROLL. Example:
10 20 30 40 50 3 ROLLD produces 10 20 50 30 40
PICK Push a copy of the given stack level onto the stack.
Note that "1 PICK" is equivalent to DUP and "2 PICK" is equivalent to "OVER".
Example: 10 20 30 40 3 PICK produces 10 20 30 40 20
DUPN Duplicate the given number of stack elements onto the top of the stack.
"1 DUPN" is equivalent to DUP and "2 DUPN" is equivalent to "DUP2".
Example: 10 20 30 40 3 DUP produces 10 20 30 40 20 30 40
DROPN Drop a given number of objects from the stack.
"1 DROPN" is equivalent to DROP and "2 DROPN" is equivalent to DROP2.
Example: 10 20 30 40 3 DROP produces 10
DEPTH Returns the number of elements in the stack.
Example (beginning with an empty stack):
Example: 10 20 30 40 DEPTH returns 4.
→LIST Create a list from stack elements. See LIST Menu.
STORE Menu
General •All data types (see Data Type ) can be stored in named variables. The
number of variables is only limited by the available memory.
•The USER key displays the USER menu with all the variables (and since a
program can be stored in a variable the programs) of the current
directory. See USER Menu.
•Note that the USER menu's soft labels on the bottom of the LCD screen
only show the first few characters of a variable in
upper case
.
•Variable names are case sensitive!
•Variable names can be up to 127 characters long.
•Use PURGE to erase variables.
•See MEMORY Menu for directory issues.
•Unfortunately, storage arithmetic commands (STO+, STO* etc.) cannot
operate on local variables! So their "shortcut effect" is really lost. See
Progam .
STO Stores the object in stack level 2 in the variable who's quoted name is given
in stack level 1. Ie. 5 'A' STO stores 5 in variable A and drops both objects
from the stack.
RCL Recall variable and push it onto the stack. This does not evaluate the
contents of the variable or execute a program. The quoted variable name is
replaced by the recalled object.
PURGE Delete variable(s) or program(s) as specified in stack level 1.
17

HP-28S
This command can operate on lists of names. Ie. to erase all variables of the
current directory use MEMORY VARS PURGE
To erase variable PROG: 'PROG' PURGE
To erase variables X and Y: { Y} PURGE
STO+ A quoted name must be present in stack level 1 or 2. The 2nd argument (real
or complex number, real or complex vector or matrix) will be added to the
variable:
'A' 6 STO+ and 6 'A' STO+ calculates A+6 and stores the result in A.
Note that even though "+" can be used with lists this is not supported for the
STO+ command.
Note: This command cannot operate on local variables!
STO- A quoted name must be present in stack level 1 or 2. The 2nd argument (real
or complex number, real or complex vector or matrix) will be substracted
from the variable (or vice versa depending on the order of arguments):
'A' 6 STO- Calculates A-6 and stores the result in A.
6 'A' STO- Calculates 6-A and stores the result in A.
Note: This command cannot operate on local variables!
STO* A quoted name must be present in stack level 1 or 2. The 2nd argument (real
or complex number, real or complex vector or matrix) will be multiplied to the
variable:
'A' 6 STO* and 6 'A' STO* calculates A*6 and stores the result in A.
Note: This command cannot operate on local variables!
STO/ A quoted name must be present in stack level 1 or 2. The 2nd argument (real
or complex number, real or complex vector or matrix) will be divided by the
variable (or vice versa depending on the order of arguments, see STO-):
'A' 6 STO/ Calculates A/6 and stores the result in A.
6 'A' STO/ Calculates 6/A and stores the result in A.
Note: This command cannot operate on local variables!
SNEG Negate the contents of a variable (real or complex number, real or complex
vector or matrix)
Note: This command cannot operate on local variables!
SINV Negate the contents of a variable (real or complex number, real or complex
square matrix)
Note: This command cannot operate on local variables!
SCONJ Conjugate the contents of a variable (real or complex number, real or
complex vector or matrix). This negates the imaginary part of the value.
Note: This command cannot operate on local variables!
18

HP-28S
MEMORY Menu
MEM Return the amount of free memory in bytes.
MENU Creates a customized user menu. See CUSTOM Menu.
ORDER Takes a list of variable names and moves these names in the given order to
the beginning of the current user menu.
PATH Returns the current path as a list of directory names. This always starts with
HOME which is the root directory.
Note that HOME is a reserved name that cannot be used for a variable.
Apparently, it cannot even put into a quoted name ('HOME').
HOME Return to the HOME directory.
Note that there are no commands to step up one level in the directory
hierarchy (no "CD .."). To get this functionality a user program must be
written which uses PATH to get access to the directory names:
<< PATH DUP SIZE 1 – → P N
<< 1 N FOR I P I GET EVAL NE T >>
>> 'UP' STO
This creates a command UP which steps up one directory.
Note that GET retrieves the next directory name from the list and puts it onto
the stack. This does not evaluate the name, hence EVAL is needed to actually
change the directory. Unfortunately, there doesn't seem to be a command
which activates the USER menu (or any other menu).
More
about
paths
•If a name (variable, program etc.) is not found in the current directory it is
searched in the partent directory and so on until it is found.
This also applies to directories so evaluating a directory name can not only
change to a subdirectory of the
current
directory but also to a subdirectory
of
any upper-level
directory.
As a consequence of this path searching, the above UP program should be
stored in the HOME directory so that it is accessible from all other
directories!
•The same applies to directory names.
•Furthermore, the HOME directory should contain utility programs; regular
work (which usually involves all sorts of temporary variables) should be
carried out in a subdirectory.
•It is possible to change to a subdirectory by specifying its name on the
command line. But be aware that the subdirectory's associated menu label
may not display the entire variable name or the true name may have lower
case characters!
•Path names need no be unique throughout the directory hierarchy.
CRDIR Create a directory with given name underneath the current directory.
VARS Return a list containing the names of all variables and subdirectories in the
current directory.
CLUSR Erases all variables in all directories.
19

HP-28S
ALGEBRA Menu
General This menu contains commands for symbolic manipulation of expressions and
equations. There's also an interactive equation editor available (FORM).
Important: If flag 36 is clear the "numerical" evaluation mode is used. It
evaluates expressions until a numerical result has been found. If an
undefined variable is encountered an error is issued. Thus, in order to to see
the symbolic results in this section flag 36 must be set.
COLCT Takes an equation or expression and collects similar expressions:
'1+2+LOG(10)' → '4'
'1+ +2' → '3+ '
' ^Z*Y* ^T*Y' → ' ^(T+Z)*Y^2'
' + +Y+3* ' → '5* +Y'
COLCT operates independently on each side of an equation:
'1+2* =3+4* ' is not simplified to '-2=2* ' or even '-1= '
EXPAN Expands an equation or expression:
'A*(B+C)' → 'A*B+A*C'
'(B+C)/A' → 'B/A+C/A'
'A^(B+C)' → 'A^B*A^C'
' ^5' → ' * ^4'
'( +Y)^2' → ' ^2+2* *Y+Y^2'
EXPAN doesn't perform all possible expansions in a single step. It may be
necessary to apply the command repeatedly.
SIZE Returns the number of objects in an expression or equation. Example:
' *LN(Y)=CCC' SIZE returns 6 because there are these objects:
XX, *, LN, Y, =, CCC
FORM Allows to perform identity manipulations interactively on equations and
expressions.
•When invoked, the expression in stack level 0 is displayed in line 2 (and
line 3 if it doesn't fit in one line) of the LCD display and a number of soft-
key menus are displayed.
•The commands available in the menus depend on the type of sub-
expression that is currently selected by the cursor.
•When done press ON to quit the interactive mode. The expression in level
1 will be replaced by the modified version.
•The FORM editor can be invoked by a program.
COLCT Collect similar expressions of the selected sub-expression.
Similar to COLCT above.
EXPAN Expand products and exponentials of the selected sub-expression.
Similar to EXPAN above.
LEVEL While this button is held down the level of the currently selected
object or sub-expression is displayed.
EXGET Quit the FORM editor and returns:
•In stack level 3: The edited expression.
•In stack level 2: A copy of the currently selected sub-expression.
•In stack level 1: The position index of the sub-expression.
[←]Move cursor left.
[→]Move cursor right.
20
Other manuals for HP-28S
2
Table of contents
Other HP Calculator manuals