Level I BASIC
Designed by | Steve Leininger |
---|---|
First appeared | 1977 |
Influenced by | |
Tiny BASIC, Palo Alto Tiny BASIC | |
Influenced | |
TRS-80 Level II BASIC |
Level I BASIC is a dialect of the BASIC programming language 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 .[1] Unable to take that source code with him, he initially hired a consultant to write an interpreter. When that contractor failed to deliver,[2] he adapted Li-Chen Wang'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 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 math for the production version.[3]
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.[4]
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."[5]
Further Development
When the TRS-80 was introduced, three versions of BASIC were announced:
- Level I BASIC
- Level II BASIC - developed by Microsoft 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[6]
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.[7]
Language features
Level I BASIC supported the following keywords:[8]
- 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 noELSE
),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 strings 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).[9] As the language lacked many common math functions, the manual provided subroutine listings for square root, exponentiation, exponentials, logarithms, arithmetic sign, and trigonometry functions.[10]
Graphics support was as minimal a set as possible: CLS
, for CLear Screen; SET(X,Y)
, which lighted a location on the display; RESET(X,Y)
, which turned it off; and POINT(X,Y)
, 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.[11]
References
- ↑ "NIBL". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte 1 (10). November 1976.
- ↑ Lorenzo, Mark (2017). Endless Loop: The History of the BASIC Programming Language. Philadelphia: SE Books. p. 80. ISBN 978-1974-27707-0.
- ↑ Welsh, David; Welsh, Theresa (2007). Priming the Pump: How TRS-80 Enthusiasts Helped Spark the PC Revolution. p. 7.
- ↑ Reed, Matthew. "Level I BASIC". http://www.trs-80.org/level-1-basic/. Retrieved 27 August 2017.
- ↑ "Interview with Steven W. Leininger". http://www.trs-80.com/wordpress/interview-with-steven-w-leininger/. Retrieved 28 August 2017.
- ↑ Thomas, Wes (Sep–Oct 1977). "Radio Shack's $600 Home Computer". Creative Computing 3 (5): 94–95. https://archive.org/stream/CreativeComputingv03n05SeptOct1977/Creative_Computing_v03n05_Sept_Oct_1977#page/n93/mode/2up.
- ↑ Reed, Matthew. "Was there a Level I Model III?". http://www.trs-80.org/level1-model3/. Retrieved 27 August 2017.
- ↑ Lien, David (1977). User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 232–233. https://archive.org/stream/Level_1_Users_Manual_1977_David_Lien#page/n233/mode/1up. Retrieved 2 November 2017.
- ↑ Lien, David (1977). User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 123–132. https://archive.org/stream/Level_1_Users_Manual_1977_David_Lien#page/n124/mode/1up. Retrieved 2 November 2017.
- ↑ Lien, David (1977). User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 216–220. https://archive.org/stream/Level_1_Users_Manual_1977_David_Lien#page/n217/mode/1up. Retrieved 2 November 2017.
- ↑ Lien, David (1977). User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 105–108,137. https://archive.org/stream/Level_1_Users_Manual_1977_David_Lien#page/n233/mode/1up. Retrieved 9 August 2020.
External links
- TRS-80 Level I BASIC Simulator
- Conklin Systems - He Changed Our World - tribute to the Level I BASIC user manual's personification of the computer
Original source: https://en.wikipedia.org/wiki/Level I BASIC.
Read more |