TI Extended BASIC
   HOME

TheInfoList



OR:

TI BASIC is an
ANSI The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
-compliant BASIC programming language interpreter built into the 1979 Texas Instruments TI-99/4 home computer and its improved 1981 version, the TI-99/4A. In contrast to most BASICs found on contemporary microcomputers, TI BASIC does not trace its history to
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first ...
, but was instead a TI-developed interpreter following the emerging Minimal BASIC standard being created by
ANSI The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
and ECMA. This was, in turn, based on the original
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time Sharing System (DTSS), it offered an inte ...
from the 1960s. There are a number of differences, sometimes subtle, between TI BASIC and the more common MS varieties. Minimal BASIC lacks a number of features that are commonly found on contemporary BASICs, and Texas Instruments later introduced the TI Extended BASIC cartridge that enhanced the functionality accessible to BASIC users. This included a wide variety of features found in other BASICs, as well as new system functions for sprite handling, sound, and other features of the platform. As was common on home computers, TI BASIC was used not only for programming but also as a thin
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
. On top of Minimal BASIC, TI added commands for text, graphics, and basic file operations like recording to tape or any other file system. Due to the specifics of the TI-99 platform, TI BASIC was most notable for its extremely slow performance, roughly half that of common machines, but conversely sported high numerical accuracy.


Performance

The TI-99 was based on the
TMS9900 Introduced in June 1976, the TMS9900 was one of the first commercially available, single-chip 16-bit microprocessors. It implemented Texas Instruments' TI-990 minicomputer architecture in a single-chip format, and was initially used for low-end m ...
microprocessor A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit, or a small number of integrated circuits. The microprocessor contains the arithmetic, logic, and control circ ...
, a 16-bit design that was originally built to provide a single-chip
central processing unit A central processing unit (CPU), also called a central processor, main processor or just Processor (computing), processor, is the electronic circuitry that executes Instruction (computing), instructions comprising a computer program. The CPU per ...
(CPU) in low-end models of their
TI-990 {{Short description, Series of 16-bit computers by Texas Instruments. The TI-990 was a series of 16-bit minicomputers sold by Texas Instruments (TI) in the 1970s and 1980s. The TI-990 was a replacement for TI's earlier minicomputer systems, the T ...
minicomputer lineup. The TMS9900 was also suitable for use in a microcomputer, but at that time the rest of the support chips required to build a complete computer were invariably 8-bit, and this included TI's wide catalog of such chips. In a minicomputer, 16-bit support systems were built up of many individual chips, but this was not suitable for a low-cost product. TI thus adopted the solution of making the machine mostly 8-bit and connecting the various support chips to this 8-bit bus, with the TMS9900 reading the bus twice to produce a 16-bit value. The TMS9900's instruction set architecture was based on 16-bit opcodes, meaning that programs would generally be twice as large as they would be on an 8-bit machine. In the era of expensive memory, this presented a significant cost. To address this, TI created an 8-bit
virtual machine In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized h ...
with its own language or
intermediate representation An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code. An IR is designed to be conducive to further processing, such as optimization and translation. A "good" ...
known as the "Graphic Programming Language", or GPL, that allowed programs to be written in a more compact format. The downside to this approach is that every GPL instruction had to be converted on the fly into one or more underlying TMS9900 instructions. The GPL code itself was stored on the 8-bit side of the machine, further slowing its performance. For all of these reasons, the machine ran far slower than it was theoretically capable of. This was particularly noticeable in BASIC. Every instruction in the user's program had to be read from 8-bit memory, interpreted using code written in GPL, and then output back over the 8-bit bus again. As a result, TI BASIC had poor performance; on common benchmarks of the era, the TI-99 generally ran half as fast as 8-bit machines like the
Commodore PET The Commodore PET is a line of personal computers produced starting in 1977 by Commodore International. A single all-in-one case combines a MOS Technology 6502 microprocessor, Commodore BASIC in read-only memory, keyboard, monochrome monitor, ...
or Apple II. For instance, running the
Byte Sieve The Byte Sieve is a computer-based implementation of the Sieve of Eratosthenes published by ''Byte'' as a programming language performance benchmark. It first appeared in the September 1981 edition of the magazine and was revisited on occasion. Al ...
in BASIC took 3960 seconds in TI BASIC, while the same test in
Applesoft BASIC Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the origina ...
on the Apple II, ostensibly a much slower machine, took 2806 seconds, about 30% faster that the TI.


Elements of TI BASIC


Editing and running

Unlike most BASICs of the era, TI BASIC did not provide a full-screen editor. Instead, a line editor was provided, which allowed the user to add or edit one line at a time. Explicit line numbers were used to order each statement. It used a prompt to indicate the current new line in immediate mode, as opposed to the more common . Line numbers ranged from 1 to 32767, inclusive, and entering a line outside that range resulted in the "BAD LINE NUMBER" error. Line entry was aided by the command, available only in immediate mode, which entered ascending line numbers, and , which renumbered an existing program. TI BASIC also included a number of debugging commands. worked something like , stopping execution on certain lines, by unlike , the exit to immediate mode did not occur on the line where appeared, but on the lines referred to. For instance, would cause the program to exit to immediate mode whenever it moved to line 130. turned off existing breakpoints. Additionally, printed out the line number of the current executing line in angle-brakets: etc, and turned it off.


Statements

The ANSI-compatible
statements Statement or statements may refer to: Common uses *Statement (computer science), the smallest standalone element of an imperative programming language *Statement (logic), declarative sentence that is either true or false *Statement, a declarative ...
of TI BASIC are . Most of these operate in the same fashion as their MS counterparts with two additions; restarts the
random number generator Random number generation is a process by which, often by means of a random number generator (RNG), a sequence of numbers or symbols that cannot be reasonably predicted better than by random chance is generated. This means that the particular outc ...
at a given "seed" value, and sets the first entry in arrays to either 0 or 1, whereas MS is always zero-based. To this standard set it added
CALL Call or Calls may refer to: Arts, entertainment, and media Games * Call, a type of betting in poker * Call, in the game of contract bridge, a bid, pass, double, or redouble in the bidding stage Music and dance * Call (band), from Lahore, Paki ...
,
CLOSE Close may refer to: Music * ''Close'' (Kim Wilde album), 1988 * ''Close'' (Marvin Sapp album), 2017 * ''Close'' (Sean Bonniwell album), 1969 * "Close" (Sub Focus song), 2014 * "Close" (Nick Jonas song), 2016 * "Close" (Rae Sremmurd song), 201 ...
, DISPLAY and
OPEN Open or OPEN may refer to: Music * Open (band), Australian pop/rock band * The Open (band), English indie rock band * ''Open'' (Blues Image album), 1969 * ''Open'' (Gotthard album), 1999 * ''Open'' (Cowboy Junkies album), 2001 * ''Open'' ( ...
. In keeping with the Minimal BASIC standard, statements could only perform branches, they could not perform arbitrary statements as was common in almost every other BASIC of the era. For instance, code such as: is not valid in TI BASIC. Instead, this would have to be performed using multiple lines: This can easily lead to
off-by-one error An off-by-one error or off-by-one bug (known by acronyms OBOE, OBO, OB1 and OBOB) is a logic error involving the discrete equivalent of a boundary condition. It often occurs in computer programming when an iterative loop iterates one time too m ...
s if the conversion is not careful about changing the sense of the boolean comparison. TI BASIC did, however, support the clause: The statement used colons to separate items on different lines, in addition to the more common comma or semicolon. This precluded its use as a statement separator, a concept that TI BASIC did not have. This means a line can have only a single statement. Due to the way BASIC interpreters work, -based loops can be sped up significantly by combining code onto a single line, which avoids having to search through the program for line numbers. This seemingly minor missing feature may result in much slower code, and adding this feature was part of Extended BASIC. Extensions to the Minimal BASIC system were often not represented directly in BASIC, but were instead accessed via the command and a series of named GPL-based subroutines. For instance, clears the screen, and returns the keycode of the currently pressed key on the keyboard. The language lacked PEEK and POKE so there was no way to create new CALLable code within BASIC, to do this one would require the TI Editor/Assembler, the TI Mini Memory cartridge which included a small
assembler Assembler may refer to: Arts and media * Nobukazu Takemura, avant-garde electronic musician, stage name Assembler * Assemblers, a fictional race in the ''Star Wars'' universe * Assemblers, an alternative name of the superhero group Champions of ...
, or by using Extended BASIC.


Functions

Unlike Microsoft BASICs, which used , , , and for manipulating strings, TI BASIC used the
ANSI The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
-compliant and . ; : Absolute value ; :
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
numeric value of the first character of a string ; : Arctangent ; : Convert a number into a string with an ASCII character ; : Cosine ; : Test whether the end of a file has been reached ; :
Exponentiation Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to r ...
; : greatest integer less than or equal to the parameter ; : Length of a string ; : Natural logarithm ; : First occurrence of a string in another string ; :
Pseudorandom number generator A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), is an algorithm for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers. The PRNG-generate ...
; : Return a substring of a string ; : Sign function ; : Sine ; :
Square root In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or  ⋅ ) is . For example, 4 and −4 are square roots of 16, because . ...
; : Convert a number to a string ; :
Tangent In geometry, the tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points on the curve. Mo ...
; : Convert a string to a number


Subprograms

Subprograms are called with CALL statement (e.g. CALL CLEAR). * CHAR Definition of graphical characters * CLEAR Clears the
screen Screen or Screens may refer to: Arts * Screen printing (also called ''silkscreening''), a method of printing * Big screen, a nickname associated with the motion picture industry * Split screen (filmmaking), a film composition paradigm in which mul ...
* 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 the joystick * KEY Reads from the keyboard without echo on the screen * SCREEN Changes the color of the screen * SOUND Creates sounds (using a
frequency Frequency is the number of occurrences of a repeating event per unit of time. It is also occasionally referred to as ''temporal frequency'' for clarity, and is distinct from ''angular frequency''. Frequency is measured in hertz (Hz) which is eq ...
) and noise * VCHAR Writes a character to a screen position and repeats it vertically


Extended BASIC

TI BASIC was located in the system's internal ROMs. In 1981, TI released a plug-in ROM cartridge that added additional functions to the existing code, improving the language in a number of ways. Known as Extended BASIC, it was a highly anticipated addition to the platform. Among the changes was the addition of the ability to have multiple statements on a line. Using multiple statements may improve performance; loops that are implemented in a single line run much faster. Additionally, statements could now span several lines. As the underlying dialect already used the colon for string separators, Extended BASIC used the double-colon for this purpose. Confusingly, as a statement with two colons was also possible in TI BASIC, for instance, , which would output "A", a blank line and then "B", so these statements required a space to be added in Extended BASIC, . Another overdue addition was that statements could now perform arbitrary statements, rather than only a . In Extended BASIC one could write a simple statement like . This also worked in the clause, allowing statements like . Other additions include a small selection of new statements, including , , , , , , , and . The last three statements are used for structured programming, allowing the creation of named subroutines. Extended BASIC also included a number of new functions and especially CALLable routines. Among the latter was a library of sprite commands, including ones that created motion that continued automatically.


Speech synthesis

When equipped with the TI Speech Synthesizer, TI Extended BASIC users could also generate speech from a predefined vocabulary as easily as writing text on-screen. For example, the following line of text would cause the speech synthesizer to identify the computer: CALL SAY("HELLO I AM A #TEXAS INSTRUMENTS# T I NINETY NINE FOUR A HOME COMPUTER") Multi-word phrases are delimited with the # symbol, as #TEXAS INSTRUMENTS# in this example. Using a word not included in the speech synthesizer's built-in vocabulary of 338 words and phrases would cause it to slowly spell out the word. TI's Terminal Emulator II cartridge provided text-to-speech functionality.


References


Citations


Bibliography

* *


External links


Beginner's BASIC
at ClassicCmp.org
TI-99/4A BASIC Reference Card
at ClassicCmp.org {{DEFAULTSORT:Ti Basic (Ti 99 4a) TI-99/4A BASIC interpreters Discontinued BASICs BASIC programming language family