Level I BASIC is a dialect of the
BASIC programming language
Basic or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* ''Basic'' (film), a 2003 film
* Basic, on ...
that shipped with the first
TRS-80
The TRS-80 Micro Computer System (TRS-80, later renamed the Model I to distinguish it from successors) is a desktop microcomputer developed by American company Tandy Corporation and sold through their Radio Shack stores. Launched in 1977, it is ...
, the TRS-80 Model I.
Background
Tandy employee Steve Leininger had written the first draft of the
NIBL (National Industrial Basic Language) BASIC interpreter
A BASIC interpreter is an Interpreter (computing), interpreter that enables users to enter and run programs in the BASIC programming language, language and was, for the first part of the microcomputer era, the default Application software, applica ...
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's public domain version of
Tiny BASIC
Tiny BASIC is a family of dialects of the BASIC programming language that can fit into 4 or fewer KBs of memory. Tiny BASIC was designed by Dennis Allison and the People's Computer Company (PCC) in response to the open letter published by Bi ...
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
Tandy Corporation was an American family-owned Retail, retailer based in Fort Worth, Texas that made leather goods, operated the RadioShack chain, and later built personal computers.
Tandy Leather was founded in 1919 as a leather supply store ...
's then-President
Charles Tandy 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 on subsets of real numbers formed by a ''significand'' (a Sign (mathematics), signed sequence of a fixed number of digits in some Radix, base) multiplied by an integer power of that ba ...
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
Rom, or ROM may refer to:
Biomechanics and medicine
* Risk of mortality, a medical classification to estimate the likelihood of death for a patient
* Rupture of membranes, a term used during pregnancy to describe a rupture of the amniotic sac
* ...
.
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 - developed by
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
and using 12 KB of ROM to add
string handling,
error handling,
trigonometric and other dedicated functions
*
Level III BASIC - 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
In software development, a breakpoint is an intentional stopping or pausing place in a computer program, program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.
More generally, a breakpoint is a means o ...
)
* 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
Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful ''lexical tokens'' belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives ...
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 (also procedure, method, subroutine, routine, or subprogram) is a callable unit of software logic that has a well-defined interface and behavior and can be invoked multiple times.
Callable units provide a ...
listings for
square root
In mathematics, a square root of a number is a number such that y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
,
exponentiation
In mathematics, exponentiation, denoted , is an operation (mathematics), operation involving two numbers: the ''base'', , and the ''exponent'' or ''power'', . When is a positive integer, exponentiation corresponds to repeated multiplication ...
,
exponentials
Exponential may refer to any of several mathematical topics related to exponentiation, including:
*Exponential function, also:
**Matrix exponential, the matrix analogue to the above
*Exponential decay, decrease at a rate proportional to value
*Expo ...
,
logarithms
In mathematics, the logarithm of a number is the exponent by which another fixed value, the base, must be raised to produce that number. For example, the logarithm of to base is , because is to the rd power: . More generally, if , the ...
,
arithmetic sign, and
trigonometry
Trigonometry () is a branch of mathematics concerned with relationships between angles and side lengths of triangles. In particular, the trigonometric functions relate the angles of a right triangle with ratios of its side lengths. The fiel ...
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