Help Page for the ti5x app
Topics:
ti5x is an emulator for the TI-58/58C/59 family of programmable scientific
calculators which were manufactured by Texas Instruments from the late 1970s.
It mostly tries to follow the original functionality; features marked “extension”
are additions not present in the original.
Basic Operation
- 0 , 1 ,
2 , 3 ,
4 , 5 ,
6 , 7 ,
8 , 9 ,
— number entry.
- . — decimal point. Also lets you continue
mantissa entry after entering exponent.
- EE (during number entry) — enter exponent
- +/- — change sign of mantissa or exponent
- CE — clear current number without losing rest of calculation.
- CLR — clear entire current calculation.
- + , - ,
× and ÷
— four-function arithmetic operators with usual algebraic precedence.
- ( , )
— lets you override normal arithmetic operator precedence.
- = — completes entire pending calculation,
automatically supplying any missing closing parentheses.
Back to Topics
Display Control
- INV 2nd
Fix or 2nd
Fix 9
— switch display to default format. This uses up to 9 decimal places (trailing zeroes
omitted) with no exponent displayed, provided the magnitude of the number is within
[5.0 × 10-9 .. 1.0 × 1010], otherwise it will show 8 figures with an exponent.
- 2nd Fix n (n ∈ 0 .. 8) — switch display to fixed point with exactly n decimal places, provided number is
within the range above, otherwise 8 figures will be shown with exponent.
- EE (after a result has been computed) — round displayed
number to only digits shown. Display will also switch to exponential format for subsequent results.
- INV EE — switch
display to default format.
- 2nd Eng — switch display
to engineering notation (with exponent that is always a multiple of 3).
- INV 2nd
Eng — switch display to default format.
Back to Topics
Copy/Paste
If you long-tap the display, a context menu will appear with “Copy Number”,
“Copy Full-Precision Number” and “Paste Number” options in it. Select “Copy Number” to copy
the currently-displayed number to the Clipboard, or “Copy Full-Precision Number” to copy
it with all significant figures intact, regardless of how many are being displayed.
From here it may be pasted into other applications. Select “Paste Number” to enter a number
from the Clipboard, perhaps copied from another application. If it is not a valid number,
you will get an error message.
Back to Topics
Additional Operations
- 2nd — modify next key to perform function written just
above it, rather than on key itself.
- INV — modify next key to perform “inverse” function
(meaning depends on key).
- INV ÷
— extension: remainder on division.
- y**x — raise number entered before to power of number
entered after.
- INV y**x — raise number
entered before to power of reciprocal of number entered after.
- lnx — replaces last-entered number with its log
base e.
- INV lnx — replaces last-entered
number with its antilog base e.
- 2nd log — replaces last-entered number
with its log base 10.
- INV 2nd log
— replaces last-entered number with its antilog base 10.
- x² — replaces last-entered number with its square.
- √x — replaces last-entered number with its square root.
- 1/x — replaces last-entered number with its reciprocal.
- x⇌t — interchanges contents of X (displayed number) and
T registers.
- 2nd Op nn —
performs various special operations, depending on the value of nn.
- 2nd Op 50 —
extension: return the current time in seconds since 00:00:00 1st January 1970 UTC.
- 2nd Op 51 —
extension: return a cryptographically-strong random value in [0.0 .. 1.0).
If you use both 2nd and INV,
they can be pressed in either order. If you press one of these by mistake, just press it
again to cancel it before pressing another key.
The following operations are mainly useful when writing programs:
- 2nd Int — replace
the displayed number with its integer part.
- INV 2nd
Int — replace the displayed number with its fractional part.
- 2nd |x| — replace
the displayed number with its absolute value.
- 2nd Op 10 —
signum: replace displayed number with 1 if positive, 0 if zero, or -1 if negative.
- 2nd Nop — does nothing.
May be inserted in program sequences in place of deleted instructions to avoid changing
the positions of following instructions.
Back to Topics
Memories
There are 100 memory registers available, numbered 00 to 99.
- STO nn — store current number into memory nn.
- RCL nn — replace current number with copy of memory nn.
- SUM nn — add current number to memory nn.
- INV SUM nn — subtract
current number from memory nn.
- 2nd CMs — set all memories to zero.
- 2nd Exc nn — exchange
current number and contents of memory nn
- 2nd Prd nn — multiply
contents of memory nn by current number.
- INV 2nd Prd nn
— divide contents of memory nn by current number.
The following operations are mainly useful when writing programs:
- STO 2nd
Ind nn, RCL
2nd Ind nn etc —
all the above memory operations on single registers are also available in indirect
versions, where the contents of the specified memory register are taken as the number of
the actual register to operate on.
- 2nd Op 2n —
adds 1 to memory 0n.
- 2nd Op 3n —
subtracts 1 from memory 0n.
- 2nd Op 52 —
extension: returns the current register offset as nn
(nn ∈ 00 .. 99).
- 2nd Op 53 —
extension: sets the register offset to the current number nn
(nn ∈ 00 .. 99).
The register offset is an adjustment to the numbering of all the memory registers:
when the offset is set to nn, all references to register ii actually become
references to register ii + nn (modulo 100). The purpose of this is to
minimize register conflicts when one program calls another. For example, you might want
to call two library programs that both use registers 01 .. 06; rather than
move the registers one by one into different registers and then back again, simply change
the register offset before calling one or both of them, to cause them to use different registers.
You can also use this to give yourself more convenient numbering for your own register usage;
thus, if you want to use 10 registers, but want to call a library routine that will
use registers from 00 onwards, simply add 10 to the register offset before calling
that routine, then subtract 10 back after it returns. That way your own code can use
the register numbers 00 .. 09 without conflict.
The preferred way to make adjustments to the register offset is to always add
to or subtract from the current value, never unconditionally set it to
a new value. In the previous example, you might use a key sequence like
( 2nd
Op 5
2 +
1 0
)
2nd Op
5 3
before invoking the routine, and
( 2nd
Op 5
2 -
1 0
)
2nd Op
5 3
to restore the previous offset afterwards. The reason for this is to allow the same trick
to be pulled on your routine to relocate its register usage by some other routine that
wants to call it.
Back to Topics
Trigonometry
- 2nd π — enter π.
- INV 2nd π — extension: enter the equivalent of 1 radian in the current angle units
(1 if in radians, 180 ÷ π if in degrees, 200 ÷ π if in gradians). Dividing an angle in the
current angle units by this number converts it to radians; multiplying a value in radians
by this number converts it to the current angle units. Many algorithms are easiest to express
if all angles are in radians; at the same time, you can make your program more user-friendly
if it accepts inputs and displays results in the current angle units.
- 2nd Deg — switches angle units
to degrees (default).
- 2nd Rad — switches angle units
to radians.
- 2nd Grad — switches angle units
to gradians (100 gradians = 90°).
- 2nd Sin — sine of last-entered
number.
- INV 2nd Sin
— arcsine of last-entered number.
- 2nd Cos — cosine of last-entered
number.
- INV 2nd Cos
— arccosine of last-entered number.
- 2nd Tan — tangent of last-entered
number.
- INV 2nd Tan
— arctangent of last-entered number.
- 2nd P→R — polar-to-rectangular
coordinate conversion; input angle in X register and magnitude in T register, output will be X-coordinate in
T register and Y-coordinate in X register.
- INV 2nd P→R
— rectangular-to-polar coordinate conversion: input X-coordinate in T register and Y-coordinate in
X register, output will be angle in X register and magnitude in T register.
Back to Topics
Statistics Functions
Note these accumulate totals in registers 01 to 06 as follows:
- 01 — ∑y
- 02 — ∑y²
- 03 — N
- 04 — ∑x
- 05 — ∑x²
- 06 — ∑xy
so these need to be cleared before use. (The Master Library provides a function in
Program 01 for doing this: 2nd
Pgm 01 SBR
CLR.)
- 2nd ∑+ — accumulate a data point;
independent variable in T register, dependent variable in X register. T register automatically
incremented for next entry.
- INV 2nd ∑+
— remove a data point. Can be used to undo an incorrect entry. Note that T still increments!
- 2nd mean(x) — compute sample mean:
T = ∑x / N, X = ∑y / N.
- INV 2nd
mean(x) — compute population standard deviation:
T = sqrt(∑x² - (∑x)² / N(N - 1)), X = sqrt(∑y² - (∑y)² / N(N - 1)).
- 2nd Op 11 — compute
sample variance: T = ∑x² / N - (∑x)² / N², X = ∑y² - (∑y)² / N².
- 2nd Op 12 — compute
linear regression slope and intercept: T = m, X = ∑y - m * ∑x / N where m =
(∑xy - ∑x∑y / N) / (∑x² - (∑x)² / N).
- 2nd Op 13 — compute
correlation coefficient: X = m * sqrt(∑x² - (∑x)² / N(N - 1)) / sqrt(∑y² - (∑y)² / N(N - 1))
where m = (∑xy - ∑x∑y / N) / (∑x² - (∑x)² / N).
- 2nd Op 14 — compute
estimated y from x: X = m * X + (∑y² - m * ∑x) / N where
m = (∑xy - ∑x∑y / N) / (∑x² - (∑x)² / N).
- 2nd Op 15 — compute
estimated x from y: X = (X - (∑y² - m * ∑x) / N) / m where
m = (∑xy - ∑x∑y / N) / (∑x² - (∑x)² / N).
Back to Topics
Program Entry
Programs are stored as a sequence of 2-digit numbers that (mostly) correspond to the position
of the keys on the keyboard. There are 960 program locations available for holding a user-entered
program. These are numbered from 000 to 959.
- 2nd CP — in calculation mode,
set all program locations to zero.
- LRN — toggle between calculation and program-entry modes.
- SST — in program-entry mode: skip to the following program
location.
- BST — in program-entry mode: step back to the previous
program location.
- 2nd Ins — in program-entry mode,
insert a zero at the current location and move the following instructions down one.
- 2nd Del — in program-entry mode,
delete the instruction at the current location and move the following instructions up one.
Other keys will enter keystrokes that will perform their function when executed.
Note that all register, flag and location operands allow indirection: simply enter
2nd Ind nn in place
of the operand to specify the register which will supply the value of the operand.
Transfer of Control
Enter 2nd Lbl followed
by just about any other key (except the above program-entry functions, the digit keys
or Ind) to use that key to label the current location.
The same label key can then be specified as the loc operand to any of the branch/call/loop
instructions.
- GTO loc — unconditional transfer of control to loc.
- SBR loc — unconditional transfer of control to
loc, until the next INV SBR
instruction is executed, in which case control returns here to continue from the following
instruction.
- INV SBR — return
from the last subroutine entered.
- INV GTO loc —
extension: put the address of loc into the display register.
Any of the preceding that take a loc operand may be prefixed by
2nd
Pgm nn (or 2nd
Pgm 2nd
Ind nn) to refer to the specified location
in library program nn (or the library program given by the contents of register nn)
rather than the current program.
Back to Topics
Comparisons
- 2nd x=t loc —
if X is equal to T, branch to location loc.
- INV 2nd x=t loc — if X is not equal to T, branch to location loc.
- 2nd x≥t loc —
if X is greater than or equal to T, branch to location loc.
- INV 2nd
x≥t loc — if X is less than T, branch to location loc.
- 2nd CP — when executed
in a program, this just clears the T-register. It does not clear the program.
Back to Topics
Flags
There are 10 flags (numbered 0 to 9), each of which may be set, unset, or tested.
- 2nd St flg n —
set flag n.
- INV 2nd
St flg n — clear flag n.
- 2nd If flg n loc —
if flag n is set, branch to location loc.
- INV 2nd
If flg n loc — if flag n is unset, branch to
location loc.
- 2nd Op 18 —
if there is no error condition, set flag 7, otherwise leave it unchanged.
- INV 2nd
Op 18 —
if there is no error condition, clear flag 7, otherwise leave it unchanged.
- 2nd Op 19 —
if there is an error condition, set flag 7, otherwise leave it unchanged.
- INV 2nd
Op 19 —
if there is an error condition, clear flag 7, otherwise leave it unchanged.
Stop on error: if flag 8 is set when an error condition occurs during program execution,
execution immediately stops.
Trace execution: if flag 9 is set, the result of each calculation step will be printed
on the printer.
Back to Topics
Looping
- 2nd Dsz n loc —
decrement register 0n, and branch to loc if its new value is nonzero,
otherwise continue with the following instruction.
- INV 2nd Dsz n loc —
decrement register 0n, and branch to loc if its new value is zero,
otherwise continue with the following instruction.
Back to Topics
Other Control
- 2nd Pause — pauses execution
of the program just long enough for the user to see the displayed value before continuing.
- R/S — when this is encountered in a program,
execution stops. The user may resume from that point by pressing
R/S.
Back to Topics
User-Defined Keys
The keys A ,
2nd A´,
B ,
2nd B´,
C ,
2nd C´,
D ,
2nd D´,
E and
2nd E´
may be used as labels just like most other keys. They are special in that
they can be invoked as subroutines without being prefixed with
SBR. They are intended to behave as user-definable
function keys.
Back to Topics
Key Codes
Note that some codes represent merged keystrokes. This not only saves
space; some sequences cannot be represented unambiguously otherwise
(Ind versus register 40).
Note also that INV is (usually) a separate keystroke,
while 2nd is not.
01 1 |
02 2 |
03 3 |
04 4 |
05 5 |
06 6 |
07 7 |
08 8 |
09 9 |
00 0 |
11 A |
12 B |
13 C |
14 D |
15 E |
16 2nd A´ |
17 2nd B´ |
18 2nd C´ |
19 2nd D´ |
10 2nd E´ |
|
22 INV |
23 lnx |
24 CE |
25 CLR |
|
27 2nd INV |
28 2nd Log |
29 2nd CP |
20 2nd CLR |
|
32 x⇌t |
33 x² |
34 √x |
35 1/x |
36 2nd Pgm |
37 2nd P→R |
38 2nd sin |
39 2nd cos |
30 2nd tan |
|
42 STO |
43 RCL |
44 SUM |
45 y**x |
|
47 2nd CMs |
48 2nd Exc |
49 2nd Prd |
40 2nd Ind |
|
52 EE |
53 ( |
54 ) |
55 ÷ |
|
57 2nd Eng |
58 2nd Fix |
59 2nd Int |
50 2nd |x| |
61 GTO |
62 2nd Pgm 2nd Ind |
63 2nd Exc 2nd Ind |
64 2nd Prd 2nd Ind |
65 ×
|
66 2nd Pause |
67 2nd x=t |
68 2nd Nop |
69 2nd Op |
60 2nd Deg |
71 SBR |
72 STO 2nd Ind |
73 RCL 2nd Ind |
74 SUM 2nd Ind |
75 -
|
76 2nd Lbl |
77 2nd x≥t |
78 2nd ∑+
| 79 2nd mean(x)
| 70 2nd Rad |
81 RST |
|
83 GTO 2nd Ind |
84 2nd Op 2nd Ind |
85 +
|
86 2nd St flg |
87 2nd If flg |
88 2nd D.MS |
89 2nd π |
80 2nd Grad |
91 R/S |
92 INV SBR |
93 . |
94 +/- |
95 =
|
96 2nd R/S |
97 2nd Dsz |
98 2nd Adv |
99 2nd Prt |
90 2nd List |
Back to Topics
Program Execution
- A , 2nd
A´, B ,
2nd B´ etc — execute the subroutines with those
labels.
- SBR followed by another key, or by 3 digits — execute the
subroutine labelled by the following key, or starting at the specified location.
- GTO followed by another key, or by 3 digits — in
calculation mode, set the current location to that labelled by the following key, or the
specified number.
- R/S — in calculation mode, start execution at the current
location, or stop execution if already running.
- SST — in calculation mode: execute one instruction.
- RST — clear all flags and the subroutine return stack,
and set the current location to 000.
- INV RST — extension:
close the current data-import and data-export files.
While a program is running, you can hold down the
GTO/Pause
key to slow down execution and see intermediate results appearing in the display. Release
to resume full-speed execution.
Back to Topics
Library Programs
It is possible to load external library modules into the calculator. One module,
the “Master Library”, comes preloaded with the calculator. A library module can provide
up to 99 separate program banks, which can be selected for execution instead of program
bank 00, which is where your user-entered program is kept. Only one library module
can be loaded at a time.
- 2nd Pgm nn
— select program bank nn from loaded library module (if nn in
[01 .. 99]), or select user-entered program bank (if nn = 00).
If the selected program bank has a label card, it will appear just under the display.
If the program bank has a help page, it can be shown by tapping in the label card area.
- 2nd Op 09 — copies
the currently-selected program bank into the user program area.
Extension: pressing LRN while a nonzero program
number is selected will display the contents of the selected program, rather than the
user-program-entry area. The program number additionally appears to the left of the program
location number. Library programs cannot be edited.
Back to Topics
Importing Data
You can read numbers from a data file, instead of having to enter them manually.
You choose a file to open from the “Import Data...” item in the
Options Menu. The file must contain a sequence of numbers
separated by newlines, whitespace or commas. Thereafter, you can read the next
number into the display using INV
2nd Prt (either from
the keyboard or in a program). An attempt to read past the last number will set flag 7
and leave the display unchanged. If a number was successfully read, flag 7 will be cleared.
The import file can also be immediately closed by INV
RST.
Back to Topics
Printer Emulation
The app also includes emulation for a connected PC-100x dot-matrix printer
capable of printing 20 text columns per line, from a limited character set. The printer
output can be viewed by selecting the “Printer” item from the options menu.
- 2nd Prt — print
the number currently being displayed.
- 2nd Op 00 —
initialize the print register to all blanks.
- 2nd Op 01 —
load the 10-digit integer part of the displayed value into the leftmost 5 columns of the
print register.
- 2nd Op 02 —
load the 10-digit integer part of the displayed value into the next-to-leftmost 5 columns of the
print register.
- 2nd Op 03 —
load the 10-digit integer part of the displayed value into the next-to-rightmost 5 columns of the
print register.
- 2nd Op 04 —
load the 10-digit integer part of the displayed value into the rightmost 5 columns of the
print register.
- 2nd Op 05 —
print the contents of the print register.
- 2nd Op 06 —
print the number currently being displayed, followed by the last three characters in the
print register.
- 2nd Op 07 —
plot an asterisk preceded by n spaces, where n (which must be in [0 .. 19])
is taken from the integer part of the displayed number.
- 2nd Op 08 —
print a listing of the names and locations of all labels in the user program.
- 2nd Op 40 —
set flag 7 to indicate that a printer is attached.
- 2nd Adv — advance
the paper by 1 line.
- 2nd List — print out
the user program contents in mnemonic form, starting from the current
program counter. Press RST first to ensure the
listing starts from 000.
- INV 2nd
List — print out the memory contents, starting from the
register with the number showing in the display.
Back to Topics
Exporting Data
Calculation results can also be exported, in either of two ways:
- The printer emulation can write text representations of every printed line
to an output file. Every line sent to the printer, whether via
2nd Prt or any of the
printer-related 2nd Op nn
functions, will be written to the file. Note that characters with no obvious Unicode
equivalent are ignored. The 2nd
Adv function will write a blank line.
Note this file typically cannot be re-imported by ti5x, since exponents are
separated from mantissas by a space or nothing before a minus sign (instead of the more
conventional e character). Other programs are also likely to have trouble reading
such numbers.
- Only numbers are exported, in standard exponential format; the current calculation
result is written out every time the 2nd
Prt key is pressed (or that function is invoked from a program).
This file format can be re-imported by ti5x, and should also be readable by other programs.
To close the current export file, press (or execute in a program)
INV 2nd
Adv. It is also closed by INV
RST.
Back to Topics
Options Menu
Pressing the Android Menu button brings up a menu with the following options:
- Calc Help — bring up this help page.
- Key Codes — toggle the display of program key codes next to the corresponding keys.
- Module Help — bring up the main help page for the currently-loaded library module, if any.
- Printer — bring up the virtual printer display. (Use the Back button to return to
the main calculator display.)
- Load Program... — load a library module or saved program from a file on the SD card.
The list to pick from is built from the contents of the “Programs” and “Download”
directories.
- Feedback... — lets you choose what kind of feedback is used to indicate a button
press; either a click (the default), a short pulse of the vibrator, or nothing.
- Save Program... — save the user-entered program to a file on the SD card. The file is
saved in the “Programs” directory.
- Import Data... — lets you open a data file in the “Download” directory on the SD card
to begin importing numbers from. (See Importing Data for more details.)
- Export Data... — lets you create a data file on the SD card (or append to an existing data file)
to write exported data to. The file is saved in the “Download” directory.
(See Exporting Data for more details.)
- About ti5x... — displays version and copyright information for the app.
- Off — simulate a complete power down and quit the app. This completely wipes all user
program and memory contents. The next time the app is started, it will initialize
as though freshly installed.
Back to Topics
Additional Information
Copies of the user manuals for the original products can be found at
rskey.org
and datamath.org.