TI-BASIC is the official name of several BASIC-like programming languages used by Texas Instruments' graphing calculators. It is a language family of three different and partially-incompatible versions, released on different products:
TI-BASIC 83 for the Zilog Z80-based TI-83 and TI-84 Plus series TI-BASIC 89 for the Motorola 68000-based TI-89 and TI-92 series TI-BASIC Nspire for the ARM-based TI-Nspire series TI rarely refers to the language by name, but the name TI-BASIC has been used in some developer documentation. Built into every TI graphing calculator, it is the primary method of programming available to the user. On most calculators, assembly language can also be used, and C cross-compilers exist for translation into assembly: TIGCC for 68000-based calculators, and SDCC for Z80-based calculators; these do not run on the calculator itself. As an interpreted language, TI-BASIC is considerably slower than assembly, making it better suited to writing programs to quickly solve math problems or perform repetitive tasks, rather than programming games or graphics-intensive applications. TI-BASIC programs (usually written in TI-BASIC 83) can also be found in math textbooks. Despite its limitations, a growing community of TI-BASIC programmers has developed, mainly on the Internet.
Syntax The syntax of all versions of TI-BASIC are somewhat different from typical BASIC implementations. The language itself has some basic structured programming capabilities, but makes limited to no use of or allowance for white space or indentation. It is also dependent on a somewhat non-standard character set, with specific characters for assignment (the right "STO" arrow, not readily available in most character sets), square and cube roots, and other mathematical symbols, as well as tokenized entry and storage for keywords. All statements begin with a colon, which also functions as a statement separator within lines. In TI-BASIC 83, closing parentheses, brackets, braces, and quotes can optionally be omitted at the end of a line or before the STO token in order to save space, although sometimes they are better left on; for example, the for loop function runs much slower without closing parentheses in certain circumstances. Expressions use infix notation, with standard operator precedence. Many statements demand arguments in parentheses, similar to the syntax used for mathematical functions. The syntax for assignment (copying of data into a variable) is unusual with respect to most conventional programming languages for computers; rather than using a BASIC-like let statement with an equal sign, or an Algol-like := operator, TI-BASIC uses a right-arrow sto→ operator with the syntax: source → destination. This is similar to several Japanese calculators, such as from Casio, Canon and Sharp, that have often employed a similar syntax, ever since the first mass market Japanese alphanumerical calculators appeared in the late 1970s and early 1980s.
Control flow Control flow statements include if-then-else blocks, for loops, while loops, and repeat loops, though no switch statements. The main control flow statements are:
Unusual for a high level language, TI-BASIC implementations include IS> (Increment and Skip if Greater Than) and DS< (Decrement and Skip if Less Than) statements, constructs generally associated with assembly languages. Sections of programs can be labeled; however, particularly on the Z80 models, the labels function as destinations for Goto statements or Menu( functions rather than as program or block labels. Availability of functions and subroutines depends on the implementation; the versions available on the TI-82-descended calculators do not even support a GOSUB-like function, though it is possible to call programs from within each other and share variables between programs. TI-89/92-based designs can have access to shared functions, essentially programs capable of returning a value.
Data types TI-BASIC is a strongly- and dynamically-typed language. Available data types differ considerably between the 68k and Z80 versions. It is not possible to create user-defined data types without using a library written in assembly. Lists are often used as a replacement for structs.
… excerpt ends here. Continue reading the full article.
