Programming simple problems with the TI-59 or TI-58 is a very straightforward process. In programming mode, the TI-59 simply records key presses. Alphabetical keys provide easy access to up to ten entry points. It is also possible to activate any of the programs in the pre-programmed memory module, and run one like any user-written program. Programs written by the user can also use programs in the module as subroutines. The module's programs run directly from
ROM, so they leave the calculator's memory free for the user. However, exploiting the computer-like capabilities of the TI-59 is a different matter. Although the TI-59 is
Turing-complete, supporting straight-line programming, conditions, loops, and indirect access to memory registers, and although it supports limited alphanumeric output on the printer only, writing sophisticated routines is essentially a matter of planning machine language and using a coding pad. A large degree of sharing occurred in the TI-59 and TI-58 community. At least one
game, ''Darth Vader's Force Battle'', appeared as a
type-in program.
Programming example Here is a sample program that computes the factorial of an integer number from 2 to 69. For 5!, if "5 A" is pressed, it gives the result, 120. Unlike the
SR-52, the
TI-58 and
TI-59 do not have the factorial function built-in, but do support it through the software module which was delivered with the calculator.
Op-code Comment LBL A ''You'll call the program with the A key'' STO 01
stores the value in register 1 1
starts with 1 LBL B
label for the loop *
multiply RCL 01
by n DSZ 1 B
decrements n and back to B until n=0 =
end of loop, the machine has calculated 1*n*(n-1)*...2*1=n! INV SBR
end of procedure Here is the same program written for
TI Compiler: #reg 01 counter #label A factorial LBL factorial STO counter 1 FOR counter * @counter LOOP = RTN #end == Memory ==