Home > Books > Amstrad CPC > About Basic

Wacci: Autumn 2001

B is for Basic: Discovering the joy of Amstrad CPC Basic

Sean McManus introduces Amstrad Basic and puts the case for it being the best 8-bit Basic version, in this article which was originally published in Amstrad CPC fanzine Wacci.

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 Piano Chords Tutor, another 10 liner from ACU. Play Chords Tutor online here now.

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.

More Amstrad CPC tutorials and software

Find all my Amstrad CPC tutorials here, and download my updated software disc here!

Credits

© Sean McManus. All rights reserved.

Visit www.sean.co.uk for free chapters from Sean's coding books (including Mission Python, Scratch Programming in Easy Steps and Coder Academy) and more!

Discover my latest books

Coding Compendium

Coding Compendium

A free 100-page ebook collecting my projects and tutorials for Raspberry Pi, micro:bit, Scratch and Python. Simply join my newsletter to download it.

Web Design in Easy Steps

Web Design IES

Web Design in Easy Steps, now in its 7th Edition, shows you how to make effective websites that work on any device.

100 Top Tips: Microsoft Excel

100 Top Tips: Microsoft Excel

Power up your Microsoft Excel skills with this powerful pocket-sized book of tips that will save you time and help you learn more from your spreadsheets.

Scratch Programming in Easy Steps

Scratch Programming IES

This book, now fully updated for Scratch 3, will take you from the basics of the Scratch language into the depths of its more advanced features. A great way to start programming.

Mission Python book

Mission Python

Code a space adventure game in this Python programming book published by No Starch Press.

Cool Scratch Projects in Easy Steps book

Cool Scratch Projects in Easy Steps

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

Walking astronaut from Mission Python book Top | Search | Help | Privacy | Access Keys | Contact me
Home | Newsletter | Blog | Copywriting Services | Books | Free book chapters | Articles | Music | Photos | Games | Shop | About