Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Level I BASIC

From Wikipedia, the free encyclopedia
Level I BASIC
Designed bySteve Leininger
First appeared1977
Influenced by
Tiny BASIC,Palo Alto Tiny BASIC
Influenced
TRS-80 Level II BASIC

Level I BASIC is a dialect of theBASIC programming language that shipped with the firstTRS-80, the TRS-80 Model I.

Background

[edit]

Tandy employee Steve Leininger wrote the first draft of theNIBL (National Industrial Basic Language)BASIC interpreter for theSC/MP while employed atNational Semiconductor.[1] Unable to take that source code with him, he initially hired a consultant to write aninterpreter. When the consultant failed to deliver,[2] Leininger,Don French, and BASIC manual author David A. Lien[3] adaptedLi-Chen Wang's public domain version ofTiny BASIC for the prototype TRS-80 Model I. Leininger said, "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".[4] The result required only 2 KB of memory for theinterpreter, 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 PresidentCharles Tandy tried to enter his salary but was unable to do so, because Tiny BASIC uses2-byte signed integers with a maximum value of 32,767. The result was a request forfloating-point math for the production version.[5] This led to the replacement of the existing 16-bit integer code with a version using 32-bitsingle-precision floating-point numbers. Leininger further extended the language to support input/output routines (keyboard, CRT, and reading and writing from cassettes). The language fits within 4 KB ofROM.[6]

Further development

[edit]

When the TRS-80 was introduced, three versions of BASIC were announced:

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.[8]

Language features

[edit]

Level I BASIC supports the following keywords:[9]

  • Commands:NEW,RUN,LIST,CLOAD,CSAVE,CONT (to continue or resume a program from abreakpoint)
  • Statements:PRINT,INPUT,READ,DATA,RESTORE,LET,REM
  • 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 does nottokenize keywords likeMicrosoft BASIC but uses abbreviations to reduce the amount of memory used by keywords, such asF. forFOR,G. forGOTO,P. forPRINT, andT. forTHEN.

The language supports 26 single-precision variables A to Z, twostrings A$ and B$ (limited to 16 characters each), and one pre-definedarray A(). The language lacks a DIM statement for dimensioning the array, the size of which is determined by available memory not used by the program listing (4 bytes per item).[10] As the language lacks many common math functions, the manual providessubroutine listings forsquare root,exponentiation,exponentials,logarithms,arithmetic sign, andtrigonometry functions.[11]

Graphics support is minimal:CLS, for CLear Screen;SET(X,Y), which lights a location on the display;RESET(X,Y), which turns it off; andPOINT(X,Y), which returns 1 if a location was lit, 0 if it was not. The coordinates can be any expression and ranges from 0 to 127 for theX-axis and 0 to 47 for theY-axis. Only black-and-white display is supported.[12]

References

[edit]
  1. ^"NIBL".Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte.1 (10). November 1976.
  2. ^Lorenzo, Mark (2017).Endless Loop: The History of the BASIC Programming Language. Philadelphia: SE Books. p. 80.ISBN 978-1974-27707-0.
  3. ^Lien, David A. (1983)."A Look Back".80 Micro. p. 12. RetrievedSeptember 17, 2025.
  4. ^"Interview with Steven W. Leininger".TRS-80.com. Retrieved28 August 2017.
  5. ^Welsh, David; Welsh, Theresa (2007).Priming the Pump: How TRS-80 Enthusiasts Helped Spark the PC Revolution. p. 7.
  6. ^Reed, Matthew."Level I BASIC".TRS-80.org. Retrieved27 August 2017.
  7. ^Thomas, Wes (Sep–Oct 1977)."Radio Shack's $600 Home Computer".Creative Computing.3 (5):94–95.
  8. ^Reed, Matthew."Was there a Level I Model III?".TRS-80.org. Retrieved27 August 2017.
  9. ^Lien, David (1977).User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 232–233. Retrieved2 November 2017.
  10. ^Lien, David (1977).User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 123–132. Retrieved2 November 2017.
  11. ^Lien, David (1977).User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 216–220. Retrieved2 November 2017.
  12. ^Lien, David (1977).User's Manual for Level I (First ed.). Fort Worth, TX: Tandy Corporation. pp. 105–108, 137. Retrieved9 August 2020.

External links

[edit]
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
Retrieved from "https://en.wikipedia.org/w/index.php?title=Level_I_BASIC&oldid=1319594042"
Categories:

[8]ページ先頭

©2009-2026 Movatter.jp