Skip to content

gazlan/Tiny-Basic-Interpreter

Repository files navigation

//////////////////////////////////////////////////////////////////////////
// Tiny Basic Interpreter recompiled with MSVC 6.0
// http://www.noniandjim.com/Jim/uproc/tinymsdos.zip
// (c) [email protected], 2018
//////////////////////////////////////////////////////////////////////////
// Tiny Basic Interpreter
// Copyright (c) 1995 Jim Patchell
// Requires the use of Parsifal Software's Anagram LALR compiler.
// http://www.parsifalsoft.com/
//////////////////////////////////////////////////////////////////////////

Tiny Basic
http://www.noniandjim.com/Jim/uproc/uproc.html

Well, this tiny basic is not really all that tiny, in that the amount of
memory it occupies is pretty large. But, this is because it is implemented in
a way that it is easy to change, rather than compactness.

This Tiny Basic is implemented using Anagram from Parsifal Software. Anagram
is a LALR(1) parser generator. Of all the parser generators I have used (yacc,
bison) or have tried to use, Anagram is the one I have had the most success
with. Heck, I don't know my terminal production from a hole in the ground, and
yet I have written successfully a number of parsers using this tool. Tiny
Basic is the most complicated one I have ever done. I probably could not do
anything more complicated. This one was hard enough.

Now, just how Basic is my Tiny Basic...well, all I can say is that it has the
look and feel of basic, but it does differ in many ways. What I was really
after was a scripting language for a project I did that could be run as a
thread under the multi tasking kernel I wrote (see above).

How it runs as a thread is mostly due to how I compiled the module. Tiny Basic
is compiled such that all globals within that module are referenced via
address register A5. This means several things. First, the Tiny Basic module
cannot reference any external globals. Also, any external module cannot
reference any of the globals in Tiny Basic. When the thread is created, a
chunk of memory is allocated that will be used to store the global variables
for Tiny Basic. In this way, I can have as many Tiny Basic threads running as
I need, as long as I have plenty of memory. Also, this means that there is
only one copy of Tiny Basic (code section) in memory at any time.

Here you will find two copies. A version that is written to be used in an
embedded 68000 environment, and a test version, that runs under MS-DOS.

Tiny Basic Demo for MS-DOS
http://www.noniandjim.com/Jim/uproc/tinymsdos.zip

Tiny Basic Version for 68000 RTOS
http://www.noniandjim.com/Jim/uproc/tinyembedded.zip

If you go to the Parsifal web site, you can download a 30 day free trial
version of Anagram. You should note that the code generated by Anagram
requires no other external libraries. Anagram is one of the few parser
generators that is suitable for embedded systems (yacc and bison will work
also).

This Tiny Basic code is free. You may use it in your projects freely. I would
like to receive credit...

Releases

No releases published

Packages

No packages published