Main Page | See live article | Alphabetical index

Locomotive BASIC programming language

Locomotive Basic is a proprietary dialect of the BASIC programming language used only on the Amstrad CPC (where it was built-in on ROM) and the Amstrad PCW (on which it is loaded from disc).It was published in two versions: 1.0 which only came with the CPC model 464, and 1.1 which shipped with all other versions. A special update—or rather, a ROM extension—was avaiable on the Amstrad CPC Plus series machines, which added specialised BASIC commands for taking advantage of the extra capabilities of those machines.

It was a rather simple but powerful BASIC implementation by the standards of the day, featuring dedicated commands for handling graphics (such as DRAW, PLOT, INK, PAPER, and CIRCLE,and FILL in v1.1), even allowing the creation of multiple screens, windows, and the like, although the color system and palette handling was awkward.Intereseting enough,a table giving the numeric codes for the 27 system colors was printer over the built in 3" disk drive casing. Also,it granted an almost full control over the CPC sound chip, an AY-3-8912 with 3 melodic channels and 1 noise channel (which was also used on the Sinclair Spectrum,ATARI ST and MSX computers,with none of them having such a complete built-in SOUND command). Everything, from selecting a particular channel or a combination of channels, setting envelopes, volume, pitch, noise, and so on could be done with a single SOUND command, with up to 7 parameters. The only thing that could not be done with BASIC was perhaps playing back digital sampled sounds, like in the game Robocop.

Disk, tape, and file management were managed by BASIC itself,and were usually good enough for simple file management,with commands such as GET,PUT,ERASE,etc. In fact,during those years,the BASIC supplied with low-cost homecomputers also acted as a very simple and crude operating system. Also available were some special commands for memory allocation and handling,like MEMORY and a parametric LOAD command,allowing,for example,to load a file containing "raw" picture data into video memory,causing it to be displayed,with a couple of BASIC instructions.

Locomotive BASIC competed with the Commodore 64's BASIC, which had no dedicated commands for graphics or sound. In general, Locomotive Basic allowed doing pretty much anything that was within the standard capabilities of the machine. This was not unimportant, as on most other machines of the era using graphics or sound was limited to assembler programmers. The only things going clearly beyond BASIC capabilities were the overscan modes used in games and demos, weird 27-color graphics modes, digital sound playback, and smooth scrolling.

Unlike the Sinclair Spectrum or Commodore 64 BASIC, Locomotive BASIC didn't rely on the keyboard having command shortcuts or specialized keys for choosing symbols or colors, save for the "?" abbreviation for the PRINT command and a few scarce and undocumented shortcuts, none too practical anyway: it was a 100% type-in language. Programs could be saved on disk or tape and retrieved as binary or ASCII files.

Drawbacks of Locomotive basic included the lack of structured programming (like almost all other common languages of the era, it was line based), and its rather slow speed, especially when plotting graphics. However,there were several games (even commercial games) for the CPC written in Locomotive BASIC, as well as business applications or utilites written entirely in BASIC.