TI BASIC (TI 99/4A)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
TI-BASIC
TI BASIC HELLO WORLD.png
First appeared 1979; 39 years ago (1979)
License Proprietary

TI BASIC is a now discontinued ANSI-compliant implementation of the BASIC programming language interpreter for the Texas Instruments TI-99/4 Home Computer (1979), developed at Microsoft by Bob Wallace[1] and Bob Greenberg. A version supporting compiled code was also used as a commercial development language for the TI-990 range of minicomputers.

TI BASIC was built into the 99/4 and 99/4A. 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.

Wallace said, "I put in a lot of extra time trying to get the TI BASIC to do funny little things.... In BASIC, you could bring up a line and edit the line. So ... suppose you wanted the same line somewhere else. Why can't you just edit the line numbers? And it didn't work that way, so I worked a lot to get it to work that way."[2]

Elements of TI BASIC[edit]

Statements[edit]

The statements of TI BASIC are CALL, CLOSE, DATA, DEF, DIM, DISPLAY, 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, STOP

Every 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 executing machine 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, unlike TI Extended BASIC, could not take advantage of the 32K memory expansion.

Functions[edit]

Unlike other Microsoft BASICs, which used LEFT$, MID$, RIGHT$, and INSTR for manipulating strings, TI BASIC used the ANSI-compliant SEG$ and POS.

Subprograms[edit]

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 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) and noise
  • VCHAR Writes a character to a screen position and repeats it vertically

Execution speed[edit]

TI BASIC is a double interpreted implementation, as the BASIC interpreter itself is written in a mid-layer interpreted byte-code language known as Graphics Programming Language which is unique to the TI-99/4A

TI Extended BASIC improved execution speed somewhat by providing some functionality in assembly language.

References[edit]

  1. ^ Stephen Manes and Paul Andrews (1993). Gates: How Microsoft's Mogul Reinvented an Industry and Made Himself The Richest Man in America. Touchstone. p. 122. ISBN 0-385-42075-7. 
  2. ^ Stephen Manes and Paul Andrews (1993). Gates: How Microsoft's Mogul Reinvented an Industry and Made Himself The Richest Man in America. Touchstone. ISBN 0-385-42075-7. 

External links[edit]