- TI BASIC (TI 99/4A)
:"This article is about the
TI-99/4A Home Computer programming language. For the calculator language, seeTI-BASIC (calculators) (note: hyphen between "TI" and "BASIC" in that one)". TI BASIC was a dialect of BASIC for theTexas Instruments TI-99/4A Home Computer (1981), developed under contract toMicrosoft byBob Wallace andBob Greenberg . A version supporting compiled code was also used as a commercial development language for theTI-990 range ofminicomputers .TI BASIC was built into the 99/4 and 99/4A, and was remarkably easy to learn. Users could access functions through this simple language that on other computers would only be available to those versed in the machines'
assembly language code. Text, full screen graphics, logic operations, and recording to tape (or any other file system - diskettes, RS-232 interface, RAM disks) could all be accomplished using TI BASIC. TI also produced an Extended BASIC cartridge that greatly enhanced the functionality accessible to BASIC users.Elements of TI BASIC
Statements
The statements of TI BASIC are
CALL, CLOSE, DATA, DEF, DIM, END, FOR..TO..STEP,GOSUB ,GOTO , IF..THEN..ELSE, INPUT, LET, NEXT, ON..GOSUB, ON..GOTO, OPEN, OPTION BASE, PRINT, RANDOMIZE, READ, REM, RESTORE, RETURN, STOPEvery line of TI BASIC can only contain one statement. The possibility to put several statements in a line with :: and also the necessary PEEK and LOAD calls to use assembly language routines became available in
TI Extended BASIC . Note that there is no POKE statement in TI BASIC. Loading and executingmachine code requires a 32K memory expansion and the TI Editor/Assembler cartridge, which then gives access CALL LOAD. The 256 Bytes of RAM "directly" accessible by the CPU was mostly consumed by the BASIC interpreter. TI BASIC stored and ran programs from the 16K video RAM, and, unlikeTI Extended BASIC , could not take advantage of the 32K memory expansion.Functions
* ABS
Absolute value
* ASCASCII numeric value of the first character of a string
* ATN Arctangent
* CHR$ Convert a number into a string with anASCII character
* COS Cosine
* EOF Test whether the end of a file has been reached
* EXPExponentiation
* INT greatest integer less than or equal to the parameter
* LEN Length of a string
* LOGNatural logarithm
* POS First occurrence of a string in another string
* RNDPseudorandom number generator
* SEG$ Return a substring of a string
* SGNSign function
* SIN Sine
* SQRSquare root
* STR$ Convert a number to a string
* TAN Tangent
* VAL Convert a string to a numberSubprograms
Subprograms are called with CALL statement (e.g. CALL CLEAR). There are no user defined subprograms (This is possible in
TI Extended BASIC ), but some subprograms are predefined:
* CHAR Definition of graphical characters
* CLEAR Clears the screen
* COLOR Defines foreground- and background color for 8 characters
* GCHAR Reads one character at a specified position from the screen
* HCHAR Writes a character to a screen position and repeats it horizontally
* JOYST Returns the position of thejoystick
* KEY Reads from the keyboard without echo on the screen
* SCREEN Changes the color of the screen
* SOUND Creates sounds (using a frequency) and noise
* VCHAR Writes a character to a screen position and repeats it verticallyExecution speed
One serious shortcoming of TI BASIC was that, as an interpreted rather than compiled language, it was inherently slow. TI BASIC was a double interpreted language, as the BASIC interpreter was itself written in a mid-layer interpreted byte-code language known as Graphics Programming Language (GPL), which was unique to the TI Home Computer.
TI Extended BASIC improved execution speed somewhat by providing some functionality in assembly language.
Wikimedia Foundation. 2010.