Level I BASIC is a dialect of the
BASIC programming language
BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of General-purpose programming language, general-purpose, high-level programming languages designed for ease of use. Dartmouth BASIC, The original version was created by John ...
that shipped with the first
TRS-80, the TRS-80 Model I.
Background
Tandy-employee Steve Leininger had written the first draft of the
NIBL (National Industrial Basic Language) BASIC interpreter for the
SC/MP while employed at
National Semiconductor
. Unable to take that source code with him, he initially hired a consultant to write an
interpreter. When that contractor failed to deliver, he adapted
Li-Chen Wang
Li-Chen Wang (born 1935) is an American computer engineer, best known for his ''Palo Alto Tiny BASIC'' for Intel 8080-based microcomputers. He was a member of the Homebrew Computer Club and made significant contributions to the software for early ...
's public domain version of
Tiny BASIC for the original prototype of the TRS-80 Model I. This required only 2 KB of memory for the
interpreter, leaving an average of another 2 KB free for user programs in common 4 KB memory layouts of early machines.
During a demonstration to executives,
Tandy Corporation's then-President
Charles Tandy
Charles David Tandy (15 May 1918 – 4 November 1978) was the chairman of the board, president, and chief executive officer of the Tandy Corporation.
Early life
Charles Tandy was born in Brownsville, Texas to Dave L. Tandy, who ran the Hinckley-T ...
tried to enter his salary but was unable to do so. This was because Tiny BASIC used
2-byte signed integers with a maximum value of 32,767. The result was a request for
floating-point
In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can b ...
math for the production version.
This led to the replacement of the existing 16-bit integer code with a version using 32-bit
single-precision floating-point numbers. Leininger further extended the language to support input/output routines (keyboard, CRT, and reading and writing from cassettes). The language fit within 4 KB of
ROM.
In a presentation announcing the TRS-80, Leininger said, "What we did, we went back through the Wang Basic and completely tore out about 60 per cent of it, the integer overhead and all that kind of stuff."
Further Development
When the TRS-80 was introduced, three versions of BASIC were announced:
* Level I BASIC
*
Level II 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 fir ...
- developed by
Microsoft and using 12 KB of ROM to add
string handling
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). ...
,
error handling,
trigonometric and other dedicated functions
*
Level III 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 fir ...
- also developed by Microsoft, offering disk commands
The Level I language was not available for the TRS-80 Model II but briefly re-surfaced as the baseline package for the TRS-80 Model III in 1981, selling for $699 compared to the $999 system with Model III BASIC (another Microsoft product). The language was identical to the Model I version but with the addition of two commands, the LLIST and the LPRINT, to output to a printer.
Language features
Level I BASIC supported the following keywords:
* Commands:
NEW
,
RUN
,
LIST
,
CONT
(to continue or resume a program from a
breakpoint)
* Statements:
PRINT
,
INPUT
,
READ
,
DATA
,
RESTORE
,
LET
* Print modifiers:
AT
,
TAB
* Structure:
GOTO
,
GOSUB
,
ON-GOTO
,
ON-GOSUB
,
RETURN
,
IF-THEN
(but no
ELSE
),
FOR-TO-STEP/NEXT
,
STOP
,
END
* Graphics:
CLS
,
SET
,
RESET
,
POINT()
* Functions:
ABS()
,
INT()
,
RND()
,
MEM
* Math:
+
-
*
/
* Relational operators:
<
>
=
<=
=>
<>
* Logical operators:
*
(AND)
+
(OR)
Like Palo Alto Tiny BASIC on which it was based, Level I BASIC did not
tokenize keywords like
Microsoft BASIC but used abbreviations to reduce the amount of memory used by keywords, such as
F.
for
FOR
,
G.
for
GOTO
,
P.
for
PRINT
, and
T.
for
THEN
.
The language supported 26 single-precision variables A to Z, two
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
s A$ and B$ (limited to 16 characters each), and one pre-defined
array A(). The language lacked a DIM statement for dimensioning the array, the size of which was determined by available memory not used by the program listing (4 bytes per item).
As the language lacked many common math functions, the manual provided
subroutine
In computer programming, a function or subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed.
Functions may ...
listings for
square root,
exponentiation,
exponentials,
logarithms,
arithmetic sign, and
trigonometry functions.
Graphics support was as minimal a set as possible: , for CLear Screen; , which lighted a location on the display; , which turned it off; and , which returned 1 if a location was lit, 0 if it was not. The coordinates could be any expression and ranged from 0 to 127 for the
X-axis and 0 to 47 for the
Y-axis. Only black-and-white display was supported.
References
External links
TRS-80 Level I BASIC SimulatorConklin Systems - He Changed Our World- tribute to the Level I BASIC user manual's personification of the computer
{{BASIC
Microcomputer software
BASIC interpreters
BASIC programming language family