And you thought BASIC was a bad language?
But BASIC was fun, especially on some of the 8-bit microcomputers of
the 1980s. Most of these machines had BASIC in ROM and within three
seconds after you switched the machine on, you were greeted with a
prompt and you were ready to type in a BASIC program. On some
machines, like the ZX-Spectrum or the BBC Micro you were immediately
ready to enter commands to draw lines on the screen.
- Read about CERBERUS-2080, a modern 8-bit
home computer that can run BASIC.
- Read about the first computer our family had, the TI-99/4A.
- Read about one of the first programs I ever wrote, to compute the
day of the week. for any given date.
- See my story
about the xor-lines pattern.
- Read the story of BASICODE, a pioneering
achievement in program portability of the Dutch radio. This was back in the old
days of 8-bit machines with cassette storage and awkward BASIC
dialects.
When you run Linux, you can choose between quite a few BASIC
interpreters that are written by amateurs. But, when I wrote my own
Basic interpreter in 1997, none of these came close to QBASIC under
MSDOS 6.22. They were either buggy or incomplete or slow. Did you ever
notice that bwbasic is so awfully slow? If you are accustomed to an
old Commodore 64, probably not. But on a Pentium it ought to be at
least 2 orders of magnitude faster! My attempt to write a BASIC
interpreter is still very unfinished, but it is fast!. You
can download it here. This is
distributed under the GNU General Public License. It offers most
functionality of BWBASIC, except PRINT USING and random access
files. In the long run it should have offered much more, but it was
never developed further. Twenty years later, I had to add an extra
include line to the main C source file to make it compile, but after
that it will run and pass the regression test on a modern 64-bit Linux
system.
In the meantime, many different Basic versions have been developed,
including some open source versions that will run under Linux. Some versions I tried are:
- bas, written by
Michael Haardt. This comes close to the syntax of the Microsoft
Basics of the 1980s. It even has support for binary random access
files (with FIELD, LSET and RSET commands). It also supports block
structures like DO..WHILE..LOOP, IF..THEN..ELSE..ENDIF end
SELECT..CASE. It also supports named subroutines and functions with
parameters, but not the full semantics. For one thing. parameters are
always passed by value and not by reference as ANSI Basic (and
QBASIC) do. It has no graphics support, but it has some terminal
control. It also supports some BBC-Basic constructs (DEFPROC,
multi-line DEFFFN, REPEAT..UNTIL), so it may be easy to port some
BBC Basic programs to it. The real nice thing is that it supports
matrix operations as most Basic on mainframes did before the age of
microcomputers.
- yabasic.. It is a fairly
full-featured Basic interpreter with control structures and named
subroutines. It also supports graphics. But its syntax deviates
from any other BASIC versions in many areas. It has multi-line IF
statements, but if you want a single-line IF statement (without
ENDIF), you must not use the word THEN. This means that even trivial
programs (that would run unmodified between BBC Basic and Microsoft
Basic) need to be adapted.
- Brandy, a clone of BBC Basic. I picked
Matrix Brandy as
it runs better on my 64-bit Linux system than the regular
version. It supports graphics as found on the RISC PC (but not all
of it), no sound and of course it has no built-in assembler and it
can't run machine code. Other than that it is a fairly
full-featured interpreter, with RETURN parameters and array
operations, as you find them on the Risc PC.
- Needless to say, R.T. Russell, author of the Z-80 version of BBC Basic
and of BBC Basic for Windows, has released a free portable version of
BBC Basic, called
BBC Basic for SDL2.0. This is a very full-featured version,
complete with graphics, sound and a built-in assembler and it's from
ter original author of many BBC Basic ports.
Back to my home page