SPLatBASIC sneak preview example
This is a an example of a simple control application written in SPLatBASIC. It illustrates a few of the features that make SPLatBASIC
ideal for programming static embedded controls
The example uses an early in-house release (December 2009) of SPLatBASIC. The language is not yet complete but already exhibits
many of the features that make it a stand-out, especially very easy coding of Finite State Machines and tightly integrated
cooperative multitasking .
I assume you have a basic working knowledge of some dialect of BASIC. This is an illustrative example, not a tutorial or programming manual.
Using this document
Throughout this document you will find this symbol.
Hover your mouse over it for a pop-up that explains something in more detail.
Normal hyperlinks just take you to another page. Example Next
Disclaimer
This is a preview of a language and programing system under development. It is real in the sense that the program was written
as decribed and runs in prototype hardware. We expect to release products and programming tools with this technology around 2Q2010.
However, the specific language features shown may very well change, expand or vanish, so nothing here should be taken as a promise to
deliver anything as shown.
Copyright © 2009 SPLat Controls Pty Ltd
|
What does "static embedded controls" mean?. Let's decode
that expression, last word first.
Controls: A control (or controller) is an electronic
device that control some piece of equipment, a "machine".
Embedded: This means that the controller is embedded in
the machine it controls, and is regarded as a component part of
the machine.
Static: This means that the controller is programmed to
perform a predetermined function, which does not change during
the life of the product it is embedded into. This differs markedly
from systems where there is no way of knowing from moment to
moment exactly what software is going to be running.
SPLatBASIC is a compiled language. It compiles to code that targets
a threaded code Virtual Machine (VM). The VM is based on Forth, but
has morphed away from pure Forth. The VM incorporates an integral
cooperative multitasking operating system. More precisely, it is a
hybrid of cooperative and preemptive. "Normal" application tasks
run as fibres in a single thread. Tasks are run sequentially, and a
task runs until it voluntarily yields. Several instructions, e.g.
Pause() include an implied yield. Very high priority processes can
run on other threads and preempt the application thread. This is
typically system interrupt handlers and application level interrupt
handlers. Thus SPLatBASIC allows interrupt handlers to be written in
BASIC (with restrictions on permitted instructions).
When you hover your mouse over the

you will get an expanded explanation