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 in response to the open letter published by Bill Gates complaining about users "pirating" Altair BASIC, which was sold for $150. The Tiny BASIC language was specified first and then programmers were invited to implement it for different microprocessors and to share their source code openly. Dr. Li-Chen Wang, author of Palo Alto Tiny BASIC, coined the term "copyleft" to describe this. Tiny BASIC is an example of a free software project that existed before the free software movement. Community response to Tiny BASIC was so overwhelming that what had been planned as three newsletters was relaunched as Dr. Dobb's Journal, the first regular periodical to focus on microcomputer software, which lasted in print form for 34 years.
Designed by | Dennis Allison |
---|---|
Influenced by | |
Dartmouth BASIC, 8008 BASIC | |
Influenced | |
Level I BASIC, Atom BASIC, BBC BASIC, Atari BASIC |
The small size and free source code made these implementations invaluable in the early days of microcomputers in the mid-1970s, when RAM was expensive and typical memory size was only 4 to 8 KB. While Altair BASIC would also run in 4 KB machines, that left only 790 bytes free for BASIC programs. More free space was a significant advantage of Tiny BASIC.
To meet these strict size limits, Tiny BASIC dialects were typically different from other implementations of BASIC in key ways:
- The source code was available for free
- Math was purely integer based
- Only 26 variables, named A to Z, were available
- The arguments of
IF
andGOTO
could be numeric expressions:IF
executed its subsequent statement on any non-zero valueGOTO
andGOSUB
could take an expression rather than a line number, providing an assigned GOTO rather than the switch statement of theON-GOTO/GOSUB
structure more typical of BASIC.
Because this was a community call for BASIC implementations, anyone could create a Tiny BASIC dialect, and the dialects varied widely in language structure. Some truncated keywords, some allowed abbreviations, some offered nonstandard ways of accessing RAM to work around the lack of arrays and string handling.
Tiny BASIC implementations are still used today, for programming microcontrollers such as the Arduino.
History
Dennis Allison, a member of the Computer Science faculty at Stanford University, wrote a specification for a simple version of the BASIC programming language.[2] He was urged to create the standard by Bob Albrecht of the Homebrew Computer Club, who 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. Allison's proposed design only used integer arithmetic and did not support arrays or string manipulation. The goal was for the program to fit in 2 to 3 kilobytes of memory.
The overall design for Tiny BASIC was published in the September 1975 issue of the People's Computer Company (PCC) newsletter, along with the intermediate language source code. The newsletter provided references to compiler texts, and singled out UIUC BASIC.[3] In June 1974, Alfred Weaver, Michael Tindall, and Ronald Danielson of the University of Illinois at Urbana-Champaign had proved it was possible to produce "A BASIC Language Interpreter for the Intel 8008 Microprocessor," in their paper of the same name, though their application was deployed to an 8008 simulator for the IBM 360/75 and required 16kB.[4]
Implementations of Tiny BASIC that met and often exceeded the design criteria were soon being forwarded to the PCC, most notably Tiny BASIC Extended by Dick Whipple and John Arnold which ran in 3K of RAM, added FOR...NXT loops, and allowed a single numeric array. The duo wrote Tiny BASIC Extended directly in machine code, using octal.[3]
Questions and comments poured in, and by the end of the year, Albrecht ("the dragon") promised to collect these into a separate newsletter and publish at least three editions. The first edition was published in January 1976 as "Dr. Dobb's Tiny BASIC Journal: Calisthenics & Orthodontia, Running Light Without Overbyte". It included a reprint of the original September article, Tiny BASIC Extended, and many notes and comments from users.
Response to the first issue was so impressive that the introduction to the second issue stated they had already decided to continue publishing the new newsletter under the name Dr. Dobb's Journal. Over the next several issues, additional versions of the language were published, and similar articles began appearing in other magazines like Interface Age.
By the middle of 1976, Tiny BASIC interpreters were available for the Intel 8080, the Motorola 6800 and MOS Technology 6502 processors. This was a forerunner of the free software community's collaborative development before the internet allowed easy transfer of files, and was an example of a free software project before the free software movement.[5] Computer hobbyists would exchange paper tapes, cassettes or even retype the files from the printed listings.[6]
Jim Warren, editor of Dr. Dobb's, wrote in the July 1976 ACM Programming Language newsletter about the motivations and methods of this successful project. He started with this: "There is a viable alternative to the problems raised by Bill Gates in his irate letter to computer hobbyists concerning 'ripping off' software. When software is free, or so inexpensive that it's easier to pay for it than to duplicate it, then it won't be 'stolen'." The Bill Gates letter was written to make software into products. The alternative method was to have an experienced professional do the overall design and then outline an implementation strategy. Knowledgeable amateurs would implement the design for a variety of computer systems. Warren predicted this strategy would be continued and expanded.[6]
The May 1976 issue of Dr. Dobbs had Li-Chen Wang's Palo Alto Tiny BASIC for the Intel 8080 microprocessor. The listing began with the usual title, author's name and date but it also had "@COPYLEFT ALL WRONGS RESERVED".[7] A fellow Homebrew Computer Club member, Roger Rauskolb, modified and improved Li-Chen Wang's program and this was published in the December 1976 issue of Interface Age magazine.[1] Roger added his name and preserved the COPYLEFT Notice.
Description
Basic concepts
Tiny BASIC was designed to use as little memory as possible, and this is reflected in the paucity of features as well as details of its interpreter system. Early microcomputers lacked the RAM and secondary storage for a BASIC compiler, which was more typical of timesharing systems.
Like most BASICs of the era, Tiny Basic was interactive with the user typing statements into a command line. As microcomputers of the era were often used with teletype machines or "dumb" terminals, direct editing of existing text was not possible and the editor instead used takeout characters, often the backslash, to indicate where the user backed up to edit existing text.
If the user typed a statement into the command line the system examined it to see if it started with a number. If it did not, the line was immediately parsed and operated on, potentially generating output via PRINT
. This was known as "direct mode".
If the line was entered with a leading number, the number was converted from decimal format, like "50", and converted to a 8-bit value, in this case, $32 hexidecimal. This number was used as an index into an array-like storage area where the rest of the line was stored in exactly the format it was typed. When the user typed LIST
into the command line the system would loop over the array, convert the line number back to decimal format, and then print out the rest of the text in the line.
When a program was present in memory and the user types in the RUN
command, the system enters "indirect mode". In this mode, a pointer is set to point to the first line of the program, for instance, 10 ($0A hex). The original text for that line is then retrieved from the store and run as if the user had just typed it in direct mode. The pointer then advances to the next line and the process continues.
Formal grammar
The grammar is listed below in Backus-Naur form, almost exactly as it was specified in the Design Note.[8] 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). A BREAK from the console will interrupt execution of the program.
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 ::= < (>|=|ε) | > (<|=|ε) | =
string ::= " ( |!|#|$ ... -|.|/|digit|: ... @|A|B|C ... |X|Y|Z)* "
Note that string wasn't defined in the Design Note.
This syntax, as simple as it was, added one innovation: GOTO
and GOSUB
could take an expression rather than just a line number, providing an assigned GOTO[9] rather than the switch statement of the GOTO/GOSUB ... OF ...
, a structure then supported in HP Time-Shared BASIC and predating ON ... GOTO
. The syntax allowing IF-THEN statement
(as opposed to just a line number to branch to) was not yet supported in Dartmouth BASIC as this time but had been introduced by Digital[10] and copied by Microsoft.
Implementation in a virtual machine
The Design Note specified a virtual machine, in which the Tiny BASIC interpreter is itself run on a virtual machine interpreter. The designer's idea to use an application virtual machine goes back to Val Schorre (with META II, 1964) and Glennie (Syntax Machine). The choice of a virtual machine approach economized on memory space and implementation effort, although the BASIC programs run thereon were executed somewhat slowly.[11]
Dialects that used the virtual machine included Tiny BASIC Extended, Tom Pittman's Tiny BASIC[12] and NIBL. Other dialects such as Denver Tiny BASIC (DTB) and Palo Alto Tiny BASIC were direct interpreters. Some programmers, such as Fred Greeb with DTB, treated the IL program as pseudocode for the algorithm to implement in assembly language; Denver Tiny BASIC did not use a virtual machine, but it did closely follow the IL program.
This is a representative excerpt from the 120-line IL program:
S1: TST S3,'GO' ;GOTO OR GOSUB?
TST S2,'TO' ;YES...TO, OR...SUB
CALL EXPR ;GET LABEL
DONE ;ERROR IF CR NOT NEXT
XFER ;SET UP AND JUMP
S3: TST S8,'PRINT' ;PRINT.
A common pattern in the program is to test for a keyword or part of a keyword, then act on that information. Each test is an assertion as to what is next in the line buffer. If the assertion fails, control jumps to a subsequent label (usually looking for a new keyword or token). Here the system advances its buffer cursor over any spaces and tests for GO and if it fails to find it then jumps to line S3. If it finds it, execution continues with the next IL command. In this case, the system next tests for TO, skipping to line S2 if it fails (a test for SUB, to see if this is instead a GOSUB command). If it passes, control continues; in this case, calling an IL subroutine that starts at label EXPR, which parses an expression. In Tiny BASIC, GOTO X*10+100
(a computed GO TO) is as legal as GOTO 100
and is the alternative to the ON-GOTO of larger BASIC implementations. The subroutine EXPR pushes the result of the expression onto the arithmetic stack (in this case, the line number). DONE verifies no other text follows the expression and gives an error if it does. XFER pops the number from the stack and transfers execution (GOes TO) the corresponding line number, if it exists.
The following table gives a partial list of the 32 commands of the virtual machine in which the first Tiny BASIC interpreter was written.[13]
- 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
- DONE
- Report a syntax error if after deleting leading blanks the cursor is not positioned to reach a carriage return
- XFER
- Test value at the top of the AE stack to be within ranqe. If not, report an error. If so, attempt to position cursor at that line. If it exists, begin interpretation there; if not, report an error.
- JUMP lbl
- Continue execution of the IL at the label specified
- RTN
- Return to the IL location specified at the top of the control stack
- PRS
- Print characters from the BASIC text up to but not including the closing quotation mark
- PRN
- Print number obtained by popping the top of the expression stack
- SPC
- Insert spaces to move the print head to next zone
- NLINE
- Output a CRLF[14] to the printer
Tom Pittman, discussing the IL, says: "The TINY BASIC interpreter was designed by Dennis Allison as a recursive descent parser. Some of the elegant simplicity of this design was lost in the addition of syntactical sugar to the language but the basic form remains. The IL is especially suited to Recursive Descent parsing of TINY BASIC because of the general recursive nature of its procedures and the simplicity of the TINY BASIC tokens. The IL language is effectively optimized for the interpretation of TINY. Experience has shown that the difficulty of adding new features to the language is all out of proportion with the nature of the features. Usually it is necessary to add additional machine language subroutines to support the new features. Often the difficulty outweighs the advantages."[15]
Deviations from the design
Defining Tiny BASIC for the Homebrew Computer Club, Pittman wrote, "Tiny BASIC is a proper subset of Dartmouth BASIC, consisting of the following statement types only: LET, PRINT, INPUT, IF, GOTO, GOSUB, RETURN, END, CLEAR, LIST, RUN. Arithmetic is in 16-bit integers only with the operators + - * / and nested parentheses. There are only the 26 single letter variable names A, B, ...Z, and no functions. There are no strings or arrays... Tiny BASIC specifies line numbers less than 256."[16] He then went on to describe his implementation: "This language has been augmented to include the functions RND, USR, and PEEK and POKE, giving the user access to all his system components in the 6800 from the BASIC program."
Many implementers brought their own experiences with HP Time-Shared BASIC or DEC BASIC-PLUS to their designs and relaxed the formal Tiny BASIC language specification. Of the seven prominent implementations published by 1977:
- All added some sort of random number function, typically RND().
- All enabled LET to be optional and most let expressions in assignment statements contain relational operators.
- All but 6800TB supported statement delimiters in lines, typically : although TBX used $ and PATB used ;.
- In IF statements, all but MINOL removed the need for expressions to contain relational operators (e.g.,
IF X THEN LET Y=X
was valid). The majority removed THEN, made it optional, or supported implied GOTO. - Many modified PRINT to support print zones, using
,
to go to the next zone and;
to not advance the cursor. - All but 6800TB and DTB added NEW.
- All but 6800TB and MINOL added a function to return memory size: TBX had SZE, DTB and PATB had SIZE, L1B had MEM, and NIBL had TOP.
- Four implementations added arrays, whether a single, undimensioned array in PATB and L1B or DIMensionable arrays in TBX and DTB.
- Four implementations added the REMark statement.
- Only PATB, NIBL, and L1B offered FOR-TO-STEP/NEXT, although TBX supported
FOR 1,10$NXT
. - Only NIBL had any nod towards structured programming, with DO/UNTIL, despite Allison's lament in Issue 2 about problems with BASIC.
As an alternative to tokenization, to save RAM, TBX,[17] DTB,[18] and MINOL[19] truncated keywords: PR for PRINT, IN for INPUT, RET for RETURN. The full, traditional keywords were not accepted. In contrast, PATB allowed accepted traditional keywords but also allowed any keyword to be abbreviated to its minimal unique string, with a trailing period. For instance, PRINT could be typed P., although PR. and other variations also worked. This system was retained in Level I BASIC for the TRS-80, which used PATB, and was also later found in Atari BASIC and the BASIC of various Sharp Pocket Computers.[20]
Dialects
The most prominent dialects of Tiny BASIC were the original Design Note, Tiny BASIC Extended, Palo Alto Tiny BASIC, and 6800 Tiny BASIC. However, many other versions of Tiny BASIC existed.
List of prominent dialects
Tiny BASIC was first published in a newsletter offshoot of the People's Computer Company, a newsletter which became Dr. Dobb's Journal, a long-lived computing magazine. About ten versions were published in the magazine.
Date Published | Issue | Dialect | Author | Processor | Size |
---|---|---|---|---|---|
December, 1975 | 1[21] | Design Note | Dennis Allison | N/A | N/A |
February, 1976 | 2[17] | Tiny BASIC Extended (TBX) | Dick Whipple & John Arnold | 8080 | 2.9K |
March, 1976 | 3[18] | Denver Tiny BASIC (DTB) | Fred Greeb | 8080 | 2.75K |
March, 1976 | 3[22] | 6800 Tiny BASIC (6800TB) | Tom Pittman | 6800 | 2K[23] |
April, 1976 | 4[19] | MINOL | Eric T. Mueller | 8080 | 1.75K |
May, 1976 | 5[24] | Palo Alto Tiny BASIC (PATB) | Li-Chen Wang | 8080 | 1.77K |
November, 1976 | 10[25] | National Industrial Basic Language (NIBL) | Mark Alexander & Steve Leininger | SC/MP | 4K |
October, 1980 | 49[26] | Enhanced 6800 Tiny BASIC | Robert Hudson | 6800 | N/A |
February, 1985 | 100[27] | TBI68K | Gordon Brandly | 68000 | N/A |
January, 2006 | 351[28] | Return of Tiny BASIC | Tom Pittman | N/A (C) | N/A |
TBX was also known as Texas Tiny BASIC.[29]
Both SCELBAL[30] and 6800 Tiny BASIC were announced in the magazine but did not publish their source code.
Palo Alto Tiny BASIC
One of the most popular of the many versions of Tiny BASIC was Palo Alto Tiny BASIC, or PATB for short, by Li-Chen Wang. PATB first appeared in the May 1976 edition of Dr. Dobbs, written in a custom assembler language with non-standard mnemonics. This led to further ports that worked with conventional assemblers on the 8080.[20] The first version of the interpreter occupied 1.77 kilobytes of memory and assumed the use of a Teletype Machine (TTY) for user input/output. An erratum to the original article appeared in the June/July issue of Dr. Dobb's (Vol. 1, No 6). This article also included information on adding additional I/O devices, using code for the VDM video display by Processor Technology as an example.
Wang was one of the first to use word copyleft, in June 1976. In Palo Alto Tiny BASIC's distribution notice, he had written "@COPYLEFT ALL WRONGS RESERVED".[31] Tiny BASIC was not distributed under any formal form of copyleft distribution terms but was presented in a context where source code was being shared and modified. In fact, Wang had earlier contributed edits to Tiny BASIC Extended before writing his own interpreter.[17] He encouraged others to adapt his source code and publish their adaptions, as with Roger Rauskolb's version of PATB published in Interface Age.[1]
One of the most notable changes in PATB is the addition of the FOR...NEXT loop. In the original TB, loops could only be implemented using IF
and GOTO
. As in Microsoft BASIC, the upper and lower bounds of the loop were set on loop entry, and did not change during the loop, so if one of the bounds was based on a variable expression, changing the variable did not change the bound. The STEP
modifier was optional, as in MS.[20]
Another significant change was the ability to place several statements on a single line. For reasons not explained, PATB used the semicolon ;
to separate statements, rather than the already common colon :
.
Other changes include the addition of a single numeric array, with the variable name @
, STOP
in addition to END
, and the use of #
for not-equals in comparisons, as opposed to <>
.[20][lower-alpha 1]
PATB used words for error messages instead of numbers. To reduce the amount of memory required, there were only three messages and they consisted of single words. The system would respond with WHAT?
for syntax errors, HOW?
for run-time errors like GOTOs to a line that didn't exist or numeric overflows, and SORRY
for out-of-memory problems.[20]
Wang also wrote a STARTREK program in his Tiny BASIC that appeared in the July 1976 issue of the People's Computer Company Newsletter.[32][33]
MINOL
Written by a junior in high school, MINOL was the only implementation that didn't support the full Design Note, lacking operator precedence, having only three relops (<, =, #), omitting GOSUB
and RETURN
. It only supported unsigned 8-bit precision (in contrast to signed 16-bit precision for every other implementation) and line numbers from 0 to 254.
No spaces were permitted except in strings; !
returns a random number, $
before an expression loads a string at that address; OS
returns to operating system. Memory was addressable as if it were a two-dimensioned array of high and low bytes (e.g., "(0,0)" to "(255,255)"); CALL
calls a machine language subroutine.[19]
Miscellaneous dialects
Many dialects appeared in various other publications.
Inspired by PCC's call for Tiny BASICs, Robert Uiterwyk wrote MICRO BASIC 1.3 for the SWTPC (a 6800 system), which SWTPC published in the June 1976 issue of the SWTPC newsletter. Uiterwyk had handwritten the language on a legal tablet. He later expanded the language to 4K, adding support for floating point; this implementation was unique among BASIC interpreters by using Binary Coded Decimal to 9 digits of precision, with a range up to 10E99, and by being published for free as a "Floppy ROM" magazine insert. An 8K version added string variables and trigonometry functions. Both the 4K and 8K versions were sold by SWTPC. In January, 1978, Uiterwyk sold the rights of the source code to Motorola.[34][35]
Thomas F. Waitman wrote a Tiny BASIC in 1976 for the Hewlett-Packard HP-2640 and HP-2645 terminals (which used the Intel 8008 and 8080 processors), which was published in the Hewlett-Packard Journal.
Published in the December 1976 issue of Interface Age was LLL (Lawrence Livermore Laboratory) BASIC, the first draft of which was developed by Steve Leininger from Allison's specification before Leininger left National Semiconductor for Tandy Corporation. The final interpreter was developed by John Dickenson, Jerry Barber, and John Teeter at the University of Idaho on a contract with LLL. Taking 5K, it included a floating point package, developed by David Mead, Hal Brand, and Frank Olken. The program was placed into the public domain by LLL, which developed the system under the auspices of the U.S. Energy Research and Development Administration.[36]
4K BASICs
Altair BASIC, 4K BASIC, could run within a 4kB RAM machine, leaving only about 790 bytes free for program code.[37][38] The Tiny BASIC initiative started in response to the $150 charge for Altair 4K BASIC.
In 1975, Steve Wozniak joined the newly formed Homebrew Computer Club, which had fellow members Li-Chen Wang (Palo Alto Tiny BASIC) and Tom Pittman (6800 Tiny BASIC). Wozniak concluded that his machine would have to have a BASIC of its own, which would, hopefully, be the first for the MOS Technology 6502 processor. As the language needed 4 kB RAM, he made that the minimum memory for the design.[39] Integer BASIC was originally published on Compact Cassette in 1976.
In 1977, Radio Shack (as it was known then) released their first computer, the TRS-80, a Z80 system with Level I BASIC in a 4kB ROM. Tandy-employee Steve Leininger had written the first draft of the NIBL (National Industrial Basic Language) interpreter for the SC/MP while employed at National Semiconductor.
[25] Unable to take that source code with him, he adapted Li-Chen Wang's Palo Alto Tiny BASIC for the original prototype of the TRS-80 Model I. He extensively revised the interpreter, adding floating-point support, simple black-and-white graphics, and READ/DATA/RESTORE
statements.[40]
Originally developed in 1979, Sinclair 4K BASIC, written by John Grant, used as its language definition the 1978 American National Standards Institute (ANSI) Minimal BASIC standard, but was itself an incomplete 4Kb implementation with integer arithmetic only.[41]
Microcontroller dialects
Tiny BASIC implementations have been adapted for processor control and for microcontrollers such as the Arduino:
- Stephen A. Ness wrote XYBASIC for the Mark Williams Company in 1977, a 4K integer implementation. The language was often used for process control applications.[42]
- Arduino BASIC - Adapted from Gordon Brandly's 68000 Tiny BASIC, ported to C by Mike Field.
- Tiny Basic Plus - Adapted from Arduino BASIC by Scott Lawrence.[43]
- Half-Byte Tiny Basic - Adapted from Arduino BASIC.[44]
- Tiny Basic on the Micro: Bit - Adapted from Palo Alto Tiny BASIC.[45]
Dialects compared
The following table compares the language feature of Tiny BASIC implementations against other prominent BASICs that preceded them.
Dialect | Programmer(s) | Processor | Type | INPUT | LET | GOTO | IF ...THEN | GOSUB | RETURN | END | RUN | LIST | CLEAR | NEW | REM | FOR/NEXT | READ/DATA/RESTORE | Added BASIC commands | Customizations | Expressions | relop | Functions | RND | Memory Function | Line numbers | Statement delimiter | Errors | Precision | Arithmetic | Variables | Arrays | Strings | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DTSS Dartmouth BASIC (version 2)[46] | (Dartmouth students) | GE-225 | Compile-and-go | N/A [!] | LET var = expression | ;|} | GO TO number | IF expression relop expression THEN line-number | GOSUB number | RETURN | END | RUN | LIST--start | — | NEW [prompts for program name] | REM | FOR/TO/STEP/NEXT | READ, DATA | READ, DATA, STOP | N/A | precedence, ^ | < <= = >= > <> | INT, SIN, COS, TAN, ATN, EXP, LOG, ABS, SQR, DEF FN | RND(0) 0..1 | — | 1 to 99999 | None | 22 defined | 9 digits | ±999,999,999; E notation base 2 -256 to +255 (E±76). | A-Z, A0-Z9 | DIM (one letter name, two dimensions); if omitted, assumed to go from 0 to 10; up to 1500 elements across all arrays | None |
DEC BASIC-8[47] | (DEC staff) | PDP-8 | Compile-and-go | INPUT var-list | LET var = expression | ;|} | GO TO number | IF expression relop expression [THEN/GO TO] line-number | GOSUB number | RETURN | END | RUN | LIST (first (, last)) | — | NEW [prompts for program name] | REM | FOR/TO/STEP/NEXT | READ, DATA, RESTORE | STOP, OLD, SAVE, UNSAVE | DELETE (first (, last)), BYE | precedence, ^ | < <= = >= > <> | INT, SGN, SIN, COS, TAN, ATN, EXP, LOG, ABS, SQR, DEF FN | RND(0) 0..1 | — | 1 to 2045 | None | 23 defined | ? | ±134,217,727; 14E-38<N<1.7E38 | A-Z, AA-Z9 | DIM (one letter name, two dimensions) | None |
UIUC BASIC[48] | Alfred Weaver, Michael Tindall, Ronald Danielson | 8008 | Interpreter | INPUT <variable> {, <variable>}* | LET var = formula | <formula> {, <string> | <formula>}* | GO TO number | IF expression THEN line-number | GOSUB number | RETURN | END | RUN | not documented | not documented | not documented | REM | FOR/TO/STEP/NEXT | — | DEF FN, STOP | N/A | precedence, ^ | < <= = >= > # AND OR NOT | FNA..Z, SIN, COS, LOG, SQR, EXP, ATN | — | — | 0 to 999 | None | not documented | 4-byte mantissa and 1-byte exponent [Datapoint 2200 floating point arithmetic package] | not documented | A-Z, A0-Z9 | DIM (one letter name, three dimensions) | None |
Altair 4K BASIC[49] | Bill Gates, Paul Allen, Monte Davidoff | 8080 | Interpreter | INPUT ("string",) var-list | (LET) var = expression | ;} | GOTO number | IF expression THEN line-number/statement | GOSUB number | RETURN | END | RUN | LIST (start) | — | NEW | REM | FOR/TO/STEP/NEXT | READ, DATA, RESTORE | STOP | — | precedence | < <= = >= > <> | ABS, INT, SGN, SQR, TAB, USR | RND(X) <0, new using X as seed; =0, repeat; >0, next | — | 1 to 65535 | : | 12 defined | 40 bit operand floating | ? | ? | DIM (one dimension) | None |
Design Note[50] | Dennis Allison | N/A | Interpreter | INPUT var-list | LET var = expression | PRINT expr-list | GOTO expression | IF expression relop expression THEN statement | GOSUB expression | RETURN | END | RUN | LIST | [eq. to NEW] | — | — | — | — | — | — | precedence | < <= = >= > <> >< | None | None | — | 1 to 255 | None | 8 defined | 16 bit | ± 32767 | A-Z | None | None |
Tiny BASIC Extended[51] | Dick Whipple & John Arnold | 8080 | Interpreter | IN | (LET) var = expression | ;} | GO TO | IF expression [no THEN] statement | GO SUB | RET | END | RUN | LST (first (, last)) | — | NEW | — | FOR-NXT (no STEP) | DTA (array LET) | — | — | precedence | < <= = >= > <> >< | TB() spaces in print | RN (random 0-10000) | SZE | 1 to 65535 | $ | 14 defined | 16 bit | ± 32767 | A-Z | DIM, 1- or 2-dimensions, 255x255 max | None |
Denver Tiny BASIC[52] | Fred Greeb | 8080 | Interpreter | IN | (LET) var = expression | ;} | GOTO | IF expression [no THEN] statement | GOSUB | RET | END | RUN | LIST (first last) | [eq. to NEW] | — | — | — | — | TAPE [SAVE], LOAD | CLRS [CLS] | precedence | < <= = >= > <> >< | RND(0), RND(1) | SIZE | 2 to 255 | : | 20 defined | 16 bit | ± 32767 | A-Z, A1 to A6 to Z6 | DIM, 1 dimension | None | |
6800 Tiny BASIC[53] | Tom Pittman | 6800 | Interpreter | INPUT (expression) var-list | LET var = expression | ;} | GOTO expression | IF expression relop expression THEN statement | GOSUB expression | RETURN | END | RUN | LIST (first last) | [eq. to NEW] | — | REM | — | — | — | — | precedence | < <= = >= > <> >< | USR() | RND() | — | 1 to 65535 | None | 53 defined | 16 bit | ± 32767 | A-Z | None | None |
MINOL[54] | Eric T. Mueller | 8080 | Interpreter | IN | (LET) var = expression | PR expr-list {;} | [GOTO 0 jumps back to start of direct statement] | IF expression relop expression ; statement | N/A | N/A | END | RUN | LIST | CLEAR [only variables] | NEW | — | — | — | — | No spaces permitted except in strings | No operator precedence | < = # | $ [CHR$] | ! [RND] | — | 1 to 254 | : | 6 defined | 8 bit | 0 to 255 | A-Z | (H,L) memory location | single char |
Palo Alto Tiny BASIC[55] | Li-Chen Wang | 8080 | Interpreter | INPUT [(expression) var]* | (LET) var = expression | PRINT expr-list | GOTO expression | IF expression [no THEN] statement | GOSUB expression | RETURN | STOP | RUN | LIST (start) | — | NEW | REM | FOR/TO/STEP/NEXT | — | STOP | — | precedence | < <= = >= > # | ABS() | RND() | SIZE | 1 to 32767 | ; | 3 defined | 16 bit | ± 32767 | A-Z | @(1 array of 1 dimension) | None |
NIBL[56] | Mark Alexander & Steve Leininger | SC/MP | Interpreter | INPUT ($)var | (LET) var = expression | PR/PRINT expr-list | GOTO expression | IF expression (THEN) statement | GOSUB expression | RETURN | END | RUN | LIST (start) | CLEAR [variables & stack] | NEW | REM | FOR/TO/STEP/NEXT | — | DO/UNTIL | Memory addressing (@ [PEEK/POKE], STAT, PAGE) | precedence | < <= = >= > <> | MOD(), AND, OR, NOT, | RND(A,Z) | TOP | 0 to 32767 | : | 13 four-char defined | 16 bit | ± 32767 | A-Z | memory addressing | INPUT$, PRINT$, $exp=exp |
Level I BASIC[57] | Steve Leininger | Z80 | Interpreter | INPUT (#digit) [(expression) var]* | (LET) var = expression | PRINT (#digit) expr-list | GOTO number | IF expression THEN statement | GOSUB number | RETURN | END | RUN (start) | LIST (start) | — | NEW | REM | FOR/TO/STEP/NEXT | READ, DATA, RESTORE | STOP, CONT, ON-GOTO/GOSUB | CLOAD, CSAVE, CLS, SET, RESET, | precedence | < <= = >= > <> >< | ABS(), INT(), MEM, POINT(X,Y) | RND() | MEM | 1 to 32767 | : | 3 defined | 16 bit | ± 32767 | A-Z | A(1 array of 1 dimension) | A$, B$ |
MICRO BASIC 1.3[58] | Robert Uiterwyk | 6800 | Interpreter | INPUT var-list | (LET) var = expression | ;} | GOTO expression | IF expression relop expression THEN statement | GOSUB expression | RETURN | END | RUN | LIST (first (, last)) | — | NEW | — | FOR/TO/NEXT (no STEP) | — | TAB() | — | precedence | < <= = >= > <> >< | RND, SIZE | RND [returns 1-32762] | SIZE (statement that prints bytes used and bytes free) | 1 to 65535 | None | 17 defined | 16 bit [later BCD!] | ± 32767 | A-Z | DIM (two dimensions, max size of 255) | None |
SCientific ELementary BAsic Language (SCELBAL)[59] | Mark Arnold & Nat Wadsworth | 8008 | Interpreter | INPUT var-list | (LET) var = expression | ;|} | GOTO number | THEN statement | GOSUB number | RETURN | END | RUN | LIST | — | SCR[atch] | REM | FOR/TO/STEP/NEXT | — | SAVE, LOAD | UDF [USR] | precedence, ^ | < <= = >= > <> | INT, SGN, ABS, SQR, CHR [usable only in PRINT], TAB | RND(0) 0..1 | — | 1 to 999999 | None | 18 defined | 32 bit operand floating or fixed point | ±134,217,727; 14E-38<N<1.7E38 | ? | DIM (one letter name, one dimension; up to 4 arrays of up to 64 entries in total) | None |
Apple I BASIC[60] | Steve Wozniak | 6502 | Interpreter | INPUT ("string",) var-list | (LET) var = expression | ;} | GOTO expression | IF expression relop expression THEN line-number/statement | GOSUB expression | RETURN | END | RUN (start) | LIST (first (, last)) | — | SCR | REM | FOR/TO/STEP/NEXT | — | AUTO, DEL, POKE | TAB (command), CALL | precedence | < <= = >= > <> # AND OR NOT MOD | SGN, ABS, PEEK(), LEN() | RND(X) 0..X (or X..0!) | HIMEM, LOMEM | 1 to 32767 | None [early version, then :] | 16 defined | 16 bit | ± 32767 | A-Z followed by any number of alphanumeric | DIM (one dimension) | dimensioned |
LLL BASIC[61] | (University of Idaho staff) | 8080 | Interpreter | INPUT var-list | (LET) var = expression | ;} | GO TO number | IF expression relop expression (THEN) statement | GO SUB number | RETURN | END | RUN | LIST | — | SCR | REM | FOR/TO/NEXT (no STEP) | — | STOP | CALL, GET(), PUT() | precedence | < <= = >= > <> >< | No RND? | — | 0 to 32767 | : | 14 defined | 32 bit operand floating point | ? | A-Z, A0-Z9 | DIM (integers only, one letter name, one dimension, max size of 255) | None |
See also
Notes
- Hash was also used for not-equals in HP Time-Shared BASIC.
References
- Rauskolb, Roger (December 1976). "Dr. Wang's Palo Alto Tiny BASIC". Interface Age. 2 (1): 92–108. The source code begins with the following nine lines:
;********************************* ; ; TINY BASIC FOR INTEL 8080 ; VERSION 2.0 ; BY LI-CHEN WANG ; MODIFIED AND TRANSLATED ; TO INTEL MNEMONICS ; BY ROGER RAUSKOLB ; 10 OCTOBER,1976 ; @COPYLEFT ; ALL WRONGS RESERVED ; ;*********************************
- Allison, Dennis (July 1976). "Design notes for TINY BASIC". SIGPLAN Notices. ACM. 11 (7): 25–33. doi:10.1145/987491.987494. The ACM Special Interest Group on Programming Languages (SIGPLAN) reprinted the Tiny Basic design notes from the January 1976 Tiny BASIC Journal.
- "TB Code Sheet". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (1). December 1975.
- A BASIC Language Interpreter for the Intel 8008 Microprocessor. Department of Computer Science, University of Illinois at Urbana-Champaign (published 1974). June 1974.
- "Open hardware: How and why it works".
The open software movement was founded by Dennis Allison in his release of Tiny BASIC in 1975
- Warren, Jim C. (July 1976). "Correspondence". SIGPLAN Notices. ACM. 11 (7): 1–2. ISSN 0362-1340.
- Wang, Li-Chen (May 1976). "Palo Alto Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (5): 12–25. Source code begins with the following six lines.
TINY BASIC FOR INTEL 8080 VERSION 1.0 BY LI-CHEN WANG 10 JUNE, 1976 @COPYLEFT ALL WRONGS RESERVED
The June date in the May issue is correct. The magazine was behind schedule, the June and July issues were combined to catch up. - Allison, Dennis (1976). "Build Your Own BASIC". Dr. Dobb's Journal. Vol. 1 no. 1. p. 9.
- Allison, Dennis (1976). "Quick Reference Guide for Tiny BASIC". Dr. Dobb's Journal. Vol. 1 no. 1. p. 6.
- BASIC-PLUS Language Manual (PDF). Maynard, Massachusetts: Digital Equipment Corporation. 1972. pp. 3–13.
- Allen, Dennis. "TINY BASIC". People's Computer Company. 4 (3).
- Veit, Holger. "Tom Pittman's 6800 tiny BASIC". Retrieved 2 May 2017.
- Dr. Dobb's Journal, Volume 1, Number 1, 1976, p. 12.
- The CRLF there symbolizes a carriage return followed by a line feed.
- Pittman, Tom. "Tiny BASIC Experimenter's Kit". Retrieved August 9, 2020.
- (PDF) https://archive.computerhistory.org/resources/access/text/2015/02/102740021-05-14-acc.pdf. Retrieved 13 Aug 2020. Missing or empty
|title=
(help) - "Tiny BASIC Extended". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (2). February 1976.
- "Denver Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (3). March 1976.
- "MINOL". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (4). April 1976.
- Rauskolb, Roger (December 1976). "Dr. Wang's Palo Alto Tiny BASIC" (PDF). Interface Age. pp. 92–108.
- "Design Note". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (1). December 1975.
- "6800 Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (3). March 1976.
- "TINY BASIC User Manual+".
- Wang, Li-Chen (May 1976). "Palo Alto Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (5): 12–25.
- "NIBL". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (10). November 1976.
- "Enhanced & Modified 6800 Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. October 1980.
- "TBI68K". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. February 1985.
- "Return of Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. January 2006.
- "Texas Tiny BASIC (TBX) Marries TV-Cassette Operating System (TVCOS)". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (5): 28–31. May 1976.
- Arnold, Mark; Wadsworth, Nat (February 1976). "SCELBAL - A Higher Level Language for 8008/8080 Systems". Dr. Dobb's Journal. pp. 30–53.
- Wang, Li-Chen (May 1976). "Palo Alto Tiny BASIC". Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte. 1 (5): 12–25. (NB. Source code begins with the following six lines. "TINY BASIC FOR INTEL 8080; VERSION 1.0; BY LI-CHEN WANG; 10 JUNE, 1976; @COPYLEFT; ALL WRONGS RESERVED". The June date in the May issue is correct. The magazine was behind schedule, the June and July issues were combined to catch up.)
- "People's Computer Company" (PDF). Retrieved 25 December 2019.
- Turnbull, Pete. "Startrek.asc". Retrieved 25 December 2019.
- "Robert Uiterwyk's BASIC".
- "Robert Uiterwyk's Micro Basic".
- "Part 1 Of LLL 8080 BASIC Interpreter" (PDF).
- "4 Altair Language Systems". Altair BASIC.
- Altair BASIC (PDF). MITS. 25 August 1975.
- Wozniak, Steven (1 May 2014). "How Steve Wozniak Wrote BASIC for the Original Apple From Scratch". Gizmodo.CS1 maint: ref=harv (link)
- Welsh, David; Welsh, Theresa (2007). Priming the Pump: How TRS-80 Enthusiasts Helped Spark the PC Revolution. p. 7.
- "ZX80 – 8K BASIC ROM UPGRADE".
- Ness, Stephen. "XYBASIC". Ness Software. Retrieved 4 August 2020.
- "TinyBasicPlus".
- "It's here! Half-Byte Tiny Basic 2 for Arduino and compatibles".
- "Running Tiny Basic on the Micro: Bit".
- "BASIC" (PDF).
- "TSS/8 TIME-SHARING SYSTEM USER'S GUIDE" (PDF).
- "A BASIC LANGUAGE INTERPRETER FOR THE INTEL 8008 MICROPROCESSOR" (PDF).
- "MITS ALTAIR BASIC REFERENCE MANUAL" (PDF).
- "Dr. Dobb's Journal of Computer Calisthenics and Orthodontia: Running Light Without Overbyte" (PDF).
- "Dr. Dobb's Journal of Computer Calisthenics and Orthodontia: Running Light Without Overbyte" (PDF).
- "Dr. Dobb's Journal of Computer Calisthenics and Orthodontia: Running Light Without Overbyte" (PDF).
- "Dr. Dobb's Journal of Computer Calisthenics and Orthodontia: Running Light Without Overbyte" (PDF).
- "Dr. Dobb's Journal of Computer Calisthenics and Orthodontia: Running Light Without Overbyte".
- "Interface Age".
- "Dr. Dobb's Journal of Computer Calisthenics and Orthodontia: Running Light Without Overbyte" (PDF).
- "Help for TRS-80 Level I BASIC".
- "Robert Uiterwyk's MICRO BASIC".
- "SCELBAL - A HIGHER LEVEL LANGUAGE FOR 8008/8080 SYSTEMS" (PDF).
- "PRELIMINARY APPLE BASIC USERS MANUAL" (PDF).
- "Interface Age" (PDF).
External links
- Tiny Basic User Manual and Experimenter's Kit – by Tom Pittman
- Robert Uiterwyk's BASIC and Robert Uiterwyk's Micro Basic – A MC6800 tiny BASIC later sold with the SWTPC 6800 computer
- MINOL – Erik Mueller's MINOL – Tiny BASIC with strings for Intel 8080
- Tiny BASIC – A version for the curses character screen handling library
- tinyBasic – An implementation written in iziBasic
- Tiny BASIC – A live web version, ported to Run BASIC from iziBasic
- Palo Alto BASIC less than in 500 lines – Example BASIC interpreter written in Ruby.
- TinyBasic – A port of Tom Pittman's TinyBasic C interpreter to Java, C# and Adobe Flex. Includes live web versions.
- TinyBASIC Windows – A Windows version of TinyBASIC