Tiny BASIC - Implementation in Interpreted Language

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 (1906–1978)

    This is of the loon—I do not mean its laugh, but its looning,—is a long-drawn call, as it were, sometimes singularly human to my ear,—hoo-hoo-ooooo, like the hallooing of a man on a very high key, having thrown his voice into his head. I have heard a sound exactly like it when breathing heavily through my own nostrils, half awake at ten at night, suggesting my affinity to the loon; as if its language were but a dialect of my own, after all.
    Henry David Thoreau (1817–1862)