Implementation in Interpreted Language
For some implementations, an interpreted language (IL) is used. (At least two later versions, Palo Alto Tiny BASIC and 68000 Tiny BASIC, are direct interpreters). 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 |
RTN | Return to the IL location specified at the top of the control stack |
DONE | Report 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 |
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 to the printer |
Source: Dr. Dobb's Journal, Volume 1, Number 1, 1976, p.12.
Read more about this topic: Tiny BASIC
Famous quotes containing the words interpreted and/or language:
“One of the grotesqueries of present-day American life is the amount of reasoning that goes into displaying the wisdom secreted in bad movies while proving that modern art is meaningless.... They have put into practise the notion that a bad art work cleverly interpreted according to some obscure Method is more rewarding than a masterpiece wrapped in silence.”
—Harold Rosenberg (19061978)
“There is no such thing as a language, not if a language is anything like what many philosophers and linguists have supposed. There is therefore no such thing to be learned, mastered, or born with. We must give up the idea of a clearly defined shared structure which language-users acquire and then apply to cases.”
—Donald Davidson (b. 1917)