Tiny BASIC

Tiny BASIC

Tiny BASIC is a dialect of the BASIC programming language that can fit into as little as 2 or 3 KB of memory. This small size made it invaluable in the early days of s (the mid-1970s), when typical memory size was 4–8 KB.

History

The language was first developed solely as a standards document, written primarily by Dennis Allison, a member of the Computer Science faculty at Stanford University. He was urged to create the standard by Bob Albrecht of the Homebrew Computer Club. He had seen BASIC on minicomputers and felt it would be the perfect match for new machines like the MITS Altair 8800, which had been released in January 1975.

Bob and Dennis published the design document in the newsletter of the People's Computer Company. In December 1975, Dick Whipple and John Arnold created an interpreter for the language that required only 3K of RAM. Bob and Dennis decided to publish this version and corrections to the original design documents in a newsletter dedicated to Tiny BASIC, which they called "Dr. Dobb's Journal of Tiny BASIC Calisthenics and Orthodontia". The newsletter's title was changed to "Dr. Dobb's Journal of Computer Calisthenics & Orthodontia" for the second issue. In the 1976 issues several versions of Tiny BASIC, including design descriptions and full source code, were published (as of 2005 the newsletter still exists, in the form of professional programmers' magazine "Dr. Dobb's Journal").

Tiny BASIC grammar

The grammar is listed below in Backus-Naur form. In the listing, an asterisk ("*") denotes zero or more of the object to its left — except for the first asterisk in the definition of "term", which is the multiplication operator; parentheses group objects; and an epsilon ("ε") signifies the empty set. As is common in computer language grammar notation, the vertical bar ("|") distinguishes alternatives, as does their being listed on separate lines. The symbol "CR" denotes a carriage return (usually generated by a keyboard's "Enter" key).

line ::= number statement CR | statement CR statement ::= PRINT expr-list IF expression relop expression THEN statement GOTO expression INPUT var-list LET var = expression GOSUB expression RETURN CLEAR LIST RUN END expr-list ::= (string|expression) (, (string|expression)* ) var-list ::= var (, var)* expression ::= (+|-|ε) term ((+|-) term)* term ::= factor ((*|/) factor)* factor ::= var | number | (expression) var ::= A | B | C .... | Y | Z number ::= digit digit* digit ::= 0 | 1 | 2 | 3 | ... | 8 | 9 relop ::= < (>|=|ε) | > (<|=|ε) | = A BREAK from the console will interrupt execution of the programSource: "Dr. Dobb's Journal of Computer Calisthenics & Orthodontia", Volume 1, Number 1, 1976, p.9.

Implementation in interpreted language

For the implementation, an interpreted language (IL) is used. An interpreter written in IL interprets a line of Tiny Basic code and executes it. The IL is run on an abstract machine, which interprets IL code. The idea to use an interpreted language goes back to Val Schorre (with META II, 1964) and Glennie (Syntax Machine). See also virtual machine, CLI.

The following table gives a partial list of the commands of the "interpreted language" in which the Tiny BASIC interpreter is written. The length of the whole interpreter program is only 120 IL operations. Thus the choice of an interpretive approach economized on memory space and implementation effort, although the BASIC programs run thereon were executed somewhat slowly. The CRLF in the last line symbolizes a carriage return followed by a line feed.

TST "lbl", "string"If "string" matches the BASIC line, advance cursor over "string" and execute the next IL instruction; if the test fails, execute the IL instruction at the label "lbl"
CALL "lbl"Execute the IL subroutine starting at "lbl"; save the IL address following the CALL on the control stack
RTNReturn to the IL location specified at the top of the control stack
DONEReport a syntax error if after deleting leading blanks the cursor is not positioned to reach a carriage return
JUMP "lbl"Continue execution of the IL at the label specified
PRSPrint characters from the BASIC text up to but not including the closing quotation mark
PRNPrint number obtained by popping the top of the expression stack
SPCInsert spaces to move the print head to next zone
NLINEOutput a CRLF to the printer
Source: "Dr. Dobb's Journal", Volume 1, Number 1, 1976, p.12.

ee also

*Palo Alto Tiny BASIC, by Li-Chen Wang

External links

* [http://www.IttyBittyComputers.com/IttyBitty/TinyBasic/TBuserMan.htm "Tiny Basic User Manual"] and [http://www.IttyBittyComputers.com/IttyBitty/TinyBasic/TBEK.txt "Experimenter's Kit"] &ndash; by [http://www.IttyBittyComputers.com/IttyBitty/TinyBasic/index.htm Tom Pittman]
* [http://www.swtpc.com/mholley/BASIC_2/Uiterwyk.htm Robert Uiterwyk's MICRO BASIC] &ndash; A MC6800 tiny BASIC later sold with the SWTPC 6800 computer
* [http://www.signiform.com/erik/pubs/minol.htm MINOL] &ndash; Eri k Mueller's MINOL &ndash; Tiny BASIC with strings for Intel 8080
* [http://www.multicians.org/raf-tbl-definition.html TBL] &ndash; A similar IL to Tiny BASIC's, used in the first successful compilers for PL/I, Fortran, etc, on limited memory minicomputers
* [http://members.shaw.ca/gbrandly/68ktinyb.html M68000 Tiny BASIC] &ndash; Based on Li-Chen Wang's Palo Alto Tiny BASIC, and published in the 100th edition of "Dr. Dobb's"
* [http://smallbasic.sourceforge.net/sb/tiny.txt Tiny BASIC] &ndash; An implementation written in SmallBASIC
* [http://www.aldweb.com/articles.php?lng=en&pg=7407 tinyBasic] &ndash; An implementation written in [http://www.aldweb.com/articles.php?lng=en&pg=5350 iziBasic]
* [http://www.runbasic.com/?_page=tinybasic.bas Tiny BASIC] &ndash; A live web version, ported to Run BASIC from iziBasic
* [http://www.thisiscool.com/tinybasic.htm TinyBasic] &ndash; A port of [http://www.ittybittycomputers.com/IttyBitty/TinyBasic/TinyBasic.c Tom Pittman's TinyBasic C interpreter] to Java, C# and Adobe Flex. Includes live web versions.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Tiny BASIC — El Tiny BASIC es una versión muy sencilla y simplificada de un interpretador para el lenguaje de programación BASIC que originalmente fue programado en assembler y cabía en tan solo 2 a 3 KB de memoria. Este pequeño tamaño lo hizo invaluable en… …   Wikipedia Español

  • BASIC — Información general Paradigma estructurado imperativo Apareció en 1964 Diseñado por John George Kemeny; Thomas Eugene Kurtz …   Wikipedia Español

  • Tiny — may refer to:* Tiny (car), a British cyclecar manufactured by Nanson, Barker Co at Esholt, Yorkshire between 1912 and 1915 * Tiny, Ontario, a township in south central Ontario, CanadaPeople: * Tiny Tim (musician) (1932 1996), American musician *… …   Wikipedia

  • BASIC-256 — с …   Википедия

  • BASIC — This article is about the programming language. For the think tank, see British American Security Information Council. For the group of countries, see BASIC countries. For other uses, see Basic (disambiguation). BASIC Screenshot of Atari BASIC,… …   Wikipedia

  • Tiny programming language — Tiny is an extremely simple programming language used in computer science courses to teach compiler construction techniques to students. The language itself is so basic that it only includes reading of integer numbers, addition and subtraction… …   Wikipedia

  • Tiny Encryption Algorithm — TEA Zwei Feistel Runden (ein Zyklus) von TEA Entwickler Roger Needham, David Wheeler Veröffentlicht 1994 Schlüssellänge …   Deutsch Wikipedia

  • Tiny Encryption Algorithm — Infobox block cipher name = TEA caption = Two Feistel rounds (one cycle) of TEA designers = Roger Needham, David Wheeler publish date = 1994 derived from = derived to = XTEA key size = 128 bits block size = 64 bits structure = Feistel network… …   Wikipedia

  • Tiny Encryption Algorithm — En criptografía, el Tiny Encryption Algorithm (TEA) (Algoritmo Diminuto de Cifrado) es un algoritmo para el cifrado por bloques notable por su simplicidad de descripción e implementación (generalmente unas pocas líneas de código). Fue diseñado… …   Wikipedia Español

  • Dartmouth BASIC — BASIC Paradigm(s) imperative Appeared in 1964 Designed by John Kemeny, Thomas Kurtz Influenced by FORTRAN, ALGOL Influenced Cf …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”