It's Sean!

UK freelance journalist, author
and writer Sean McManus

Printed from www.sean.co.uk. © Sean McManus.

NEW: Sign up for my newsletter!

Home > Books > Amstrad CPC > About Basic

Wacci: Autumn 2001

B is for Basic

Sean McManus introduces Amstrad Basic and puts the case for it being the best 8-bit Basic version.

Amstrad CPC keyboard, showing bright green keys, and the Amstrad logo in silver By the time the Amstrad came along, Basic was the default programming language on most home computers including the competing Acorn, Commodore and Sinclair machines. The language itself dates back to 1964 and was invented by John G. Kemeny and Professor Thomas Kurtz at Dartmouth College. Their goal was to create a language (a Beginners' All-Purpose Symbolic Instruction Code) that would enable users to write programs easily. It should be forgiving, and allow for obvious information to be omited and provide useful error messages. It should shield users from needing to know anything about the hardware, and it should be extensible so more advanced users could make the most of the machine. Compared to machine code (which locks up the machine if you get it wrong, without any error messages), Basic is a doddle.

And the language did inspire people. In the eighties it seemed we would conquer the world by learning to program our home computers. A public domain scene was built around enthusiasts writing programs to meet their needs, either because there wasn't anything specific enough on the market or because they relished the challenge of coding from scratch. Bedroom games programmers were becoming famous and getting signed up with major software houses, and Basic was the first step to stardom. I knew someone in a small business who taught himself to program his Spectrum so that he could run his stock management on it. Data was loaded from tape and the print-outs had all the archival qualities of a till receipt. But all this, we thought, was going to be the future.

Programming was well-supported by magazines, with Amstrad Action carrying listings and coding tips until its closure. In the early days, Amstrad Computer User published listings that ran not only over pages and pages of an issue, but also serialised programs between issues. It seems incredible now that people typed these in, but many of them found that playing with these programs gave them the first insight into how they might write their own. Nor were these programs sub-standard. Some of the authors had clearly been inspired by Amsoft's games to create something better and cheaper for computer users, and given the standard on the market at the time, it was relatively easy to impress.

Over time, published listings got shorter and ACU started a regular 10 liners section. The brief was to create something impressive, useful or interesting in ten lines or fewer. The quality varied a lot and the end result was usually of more interest to other programmers than end users. While people could type in the multipage games listings in the early days and enjoy playing them, the 10 line games were too simple to have lasting appeal. To appreciate any beauty in them, you had to like looking at how they were written. Some useful utilities appeared on these listings pages, but there were many trivial demonstrations that catered much more for the author's urge to show off than for any unsatisfied programming need among readers.

magazine cutting showing my program Digital from Amstrad Computer User in February 1991

One of my 10-liners in Amstrad Computer User

Screenshot of Digital

My chords program, another 10 liner from ACU.

One reason that the CPC could sustain a community of programmers for so long after the other 8 bit machines had been found out for being toys is that the version of Basic that came with the machine was so good. It was written by Locomotive Software, a team who worked for Acorn previously. It allowed programmers to do nearly everything that the machine's own built-in programs could do, although machine code programmers would later teach the machine new tricks. The demonstration tape which ran on machines in shops, which was designed to amaze and delight its audience with various light shows and software demos, was itself largely written in Basic and some of the early games on the machine were also coded in Basic.

The few omissions in what Basic could do were mostly included in Basic 1.1, an updated language with a few new commands which featured on later computers. These new commands included a fill routine and a command to find out what text character was on-screen at a particular point. Had these appeared earlier, they might have been more useful, but most programmers were aiming for cross-compatibility between the early machines and the later ones with the programs they wrote so the new commands were largely ignored. Magazines and software houses insisted on compatibility, and even PD libraries preferred programs that worked across most machines unless there was a good reason why they shouldn't. Memory management remained clumsy, a missed opportunity to make it easier to exploit the potential of the 128K machines.

But Basic was slow. It's an interpreted language, which means that each time a command is run, the computer has to translate it into machine code before it can do anything with it. This translation meant that Basic would never be enough for actions that need speed like graphics handling. Luckily Amstrad Basic could be combined with machine code by using RSXs. These were commands preceded by a bar that could be added to Basic by running a machine code program. When the command was entered, the machine code was run.

Programming Basic enabled many Amstrad users to invent their own worlds on their home computers. It was an intellectual sport, where there was pride in pushing the machine and making it do something new. And for many people, programming the machine was more satisifying than playing the games that were available for it.

As it turned out, learning Basic wasn't the way to conquer the world. Computers became too complex for that and applications like spreadsheets and database programs became powerful enough to meet even the most esoteric requirements. The point and click interface means that most home computers don't even have a programming language installed now for people to use if they want to begin coding. Nor are computers standardised enough for Basic to enable users to leverage all the hardware's features.

But those Amstrad users who learned to program will never fear the lack of software for the machine. If ever they need it to do something new, they'll flop open the manual, play their favourite album and let the good times roll.

Postscript

I've revived the idea of 10 line programs in my 10 Block Scratch demos. If you like the idea of using a computer to learn music theory, as I did with my CPC Chords Tutor, check out Clef Hero for the Raspberry Pi.

Books by Sean McManus

Scratch Programming in Easy Steps

Scratch Programming in Easy Steps

Raspberry Pi For Dummies

Raspberry Pi For Dummies

Learn to program with the Scratch programming language, widely used in schools and colleges.

Set up your Pi, master Linux, learn Scratch and Python, and create your own electronics projects.

Earworm: a novel about the music business

Earworm

Cool Scratch Projects in Easy Steps

Cool Scratch Projects in Easy Steps

An entertaining techno-thriller that takes a slice through the music business: from the boardroom to the stage; from the studio to the record fair.

Discover how to make 3D games, create mazes, build a drum machine, make a game with cartoon animals and more!

More books

Recommended articles

Stylised coloured photo of a synth

Discover my music and home recording articles

Interested in starting home recording? Follow me as I start recording, using instruments such as the Novation MiniNova and Korg Kaossilator, and share my synth and sample-based music online.

Scratch cat and rainbow circle

10-block demos for Scratch programming

Lots of people of all ages are learning to program with Scratch. Discover some useful tricks and techniques in my 10-block Scratch demos, including special effects you can drop into your games.

Paper Raspberry Pi case

Download free book chapters and more!

Download a free case for your Raspberry Pi, and free chapters from my books about the Raspberry Pi, Scratch, web design and more!

©Sean McManus. www.sean.co.uk.