ArticleslgStudy

computer science

Beta BASIC

Beta BASIC is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Beta BASIC rather than just read about it. In short: Beta BASIC is a BASIC interpreter for the Sinclair Research ZX Spectrum microcomputer, written by Dr Andrew Wright in 1983 and sold by his one-man software house BetaSoft. BetaSoft also produced a regular newsletter/magazine, BetaNews.

Beta BASIC — main illustration
Beta BASIC — illustration

Key takeaways

  • Beta BASIC belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Beta BASIC to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Beta BASIC from memory before moving on to harder problems.

Reference excerpt

Beta BASIC is a BASIC interpreter for the Sinclair Research ZX Spectrum microcomputer, written by Dr Andrew Wright in 1983 and sold by his one-man software house BetaSoft. BetaSoft also produced a regular newsletter/magazine, BetaNews. Originally it started as a BASIC toolkit but over time it grew into a full replacement.

Facilities Beta BASIC completely replaced Sinclair BASIC, which as common for the time was also the OS providing a command line interface (CLI). Thus Beta BASIC provided a new and improved CLI and editor. It supported Sinclair's idiosyncratic single-key entry system for BASIC keywords but also allowed keywords to be spelled out letter-for-letter. This also removed the necessity for memorising the sometimes arcane key combinations necessary to enter less-commonly-used BASIC keywords. However, the single-key entry system was also extended by mapping the Spectrum's 'graphics' characters to Beta BASIC's new keywords. To switch from keyword entry to typed entry, it was merely necessary to type a single space, causing the cursor mode to change from K (keyword) to L (lowercase) or C (capital). (The KEYWORDS statement could also be used to alter this behaviour, for example by disabling the K mode.) The editor, when listing, could optionally automatically prettyprint code. It was possible to do this manually in Sinclair BASIC, but automatic indentation has the advantage of highlighting certain types of coding error - primarily those to do with failing to correctly close constructs. Other editing improvements included automatic highlighting of the current-line indicator - a small tweak but disproportionately helpful - and the ability to move the cursor up and down as well as left and right, a huge boon when editing long lines. Combined with the 64-column display (see "New functionality" section below), these improvements made Beta BASIC a much more productive environment even for coding standard Sinclair BASIC and making no use of BetaSoft's language additions. Beta BASIC was also a standalone interpreter in its own right, bypassing the Spectrum ROM, which it used as a library. It occasionally made calls into the ROM to access functions that were not worth re-implementing either because the ROM routines were good enough or for reasons of space - Beta BASIC had to run in the 48 KB of memory available on a Spectrum and still leave room for the user's code.

Language changes For its time, Beta BASIC was sophisticated. It provided full structured programming with named procedures and functions, complete with local variables, allowing for programming using recursion. Although it supported line numbers, they were not necessary and it offered a mode of operation which completely suppressed the display of line numbers. On the 128K Spectrum machines, Beta BASIC provided extended facilities allowing programmers to access the machine's extra memory, which took the form of a RAM disk. As well as allowing the programmer to save and load programs, blocks of memory or screen images into the RAM disc and catalogue the contents of the RAM disk, Beta BASIC also provided commands for the creation and use of arrays held in the RAM disk, allowing programs running in the 30 KB or so of free memory on the Spectrum to manipulate arrays approaching 80 KB - a significant extra amount of space by 1980s standards and more than almost any other 8-bit BASIC, which were generally limited to 64 KB of program and data combined.

New functionality Beta BASIC also drove the Spectrum's 256x192 pixel display directly, eliminating the restrictions of the ROM's 32-column text display. Beta BASIC offered scalable screen fonts, with a special soft font which was only 4 pixels wide but still legible. This meant that Beta BASIC could display 64 columns of text across the screen, making it more comparable to traditional 80-column displays of computer terminals and typical hobbyist and professional CP/M machines. (A few home computers of the 80s could also display 80 columns.) If the user was prepared to tolerate characters being displayed without gaps between them, an 85 column display was possible. This was not very readable but did allow easy porting of BASIC applications designed for an 80-column screen. Text size could be controlled programmatically so that part of a program's display might use 64-column text, part 32-column text and enlarged or reduced intermediate sizes.

Limitations Beta BASIC suffered from some limitations. As with other 8-bit microprocessors, the Spectrum could only address 64 KB of contiguous memory due to the addressing restrictions of the Spectrum's Zilog Z80 CPU. Of this, 16 KB was taken by the Sinclair BASIC ROM, leaving 48 KB for RAM. The screen took some of this, as did the areas used for holding the interpreter's own internal data structures. Beta BASIC took around 11-12 KB of the remainder, in some cases leaving only 20 KB or so for user programs. The replacement of Sinclair's editor meant that it was not possible to use the 128K Spectrum ROM's full-screen BASIC editor. No compiler was available for Beta BASIC code and existing Sinclair BASIC compilers such as HiSoft BASIC could not handle the extended keywords and facilities of Beta BASIC. Another remaining Sinclair BASIC limitation was that only single-letter variable names could be used for strings, arrays and other types. Very few other 8-bit BASICs included support for structured programming; the most widely used of these was BBC BASIC. Beta BASIC named procedures did not need to be called with the PROC keyword like in BBC BASIC and thus became new language keywords, allowing the language to be extended in itself. However, BBC BASIC was considerably quicker - the fastest BASIC interpreter of the time. Beta BASIC was not especially fast, though it included faster replacements for particularly slow ROM routines, such as the circle and arc drawing code.

Versions BetaBasic V1.0 - 1983 BetaBasic V1.8 - 1984 BetaBasic V1.9 - 1984 BetaBasic V3.0 - 1985 BetaBasic V3.1 - 1985 BetaBasic V4.0 - 1987 Special versions were produced for users of Interface 1 and the ZX Microdrive, and subsequently for those with the Opus Discovery, DISCiPLE and PlusD disk interfaces as well. A version for the Amstrad Spectrum +3 was also under consideration for a while, but Wright discarded the project.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Beta BASIC

Start with the simplest possible case. Write down what Beta BASIC claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Beta BASIC before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Beta BASIC ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Beta BASIC

In research
Beta BASIC appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Beta BASIC in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Beta BASIC is common in secondary-school and first-year university syllabi. It links to neighbouring topics BASIC extensions, BASIC interpreters, BASIC programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for Beta BASIC outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Beta BASIC” →

How to study Beta BASIC in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Beta BASIC means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Beta BASIC out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Beta BASIC in simple terms?

Beta BASIC is a BASIC interpreter for the Sinclair Research ZX Spectrum microcomputer, written by Dr Andrew Wright in 1983 and sold by his one-man software house BetaSoft. BetaSoft also produced a regular newsletter/magazine, BetaNews.

Why does Beta BASIC matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Beta BASIC?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Beta BASIC.

Tags

  • BASIC extensions
  • BASIC interpreters
  • BASIC programming language family
  • ZX Spectrum software

Keep exploring