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:
“Most observers of the French Revolution, especially the clever and noble ones, have explained it as a life-threatening and contagious illness. They have remained standing with the symptoms and have interpreted these in manifold and contrary ways. Some have regarded it as a merely local ill. The most ingenious opponents have pressed for castration. They well noticed that this alleged illness is nothing other than the crisis of beginning puberty.”
—Novalis [Friedrich Von Hardenberg] (17721801)
“Denotation by means of sounds and markings is a remarkable abstraction. Three letters designate God for me; several lines a million things. How easy becomes the manipulation of the universe here, how evident the concentration of the intellectual world! Language is the dynamics of the spiritual realm. One word of command moves armies; the word liberty entire nations.”
—Novalis [Friedrich Von Hardenberg] (17721801)