Locomotive BASIC

Last updated
Locomotive BASIC
Locomotive BASIC amstrad cpc.PNG
First appeared1984;39 years ago (1984)
OS AMSDOS
License Proprietary
Influenced by

Locomotive Basic is a proprietary dialect of the BASIC programming language written by Locomotive Software on the Amstrad CPC (where it was built-in on ROM) and the later Locomotive BASIC-2 as a GEM application on the Amstrad PC1512 and 1640. It was the main descendant of Mallard BASIC, [1] the interpreter for CP/M supplied with the Amstrad PCW.

Contents

There are two versions of Locomotive BASIC: 1.0 which only came with the CPC model 464, and 1.1 which shipped with all other versions. BASIC 1.1 was also shipped with the Amstrad CPC Plus series machines, as part of the included game cartridge.

Development

Development was based on existing work recently undertaken writing Mallard BASIC for Acorn Computers Z80 addon for the BBC Micro. It is reported to have taken around 12 weeks to enhance the existing code, and was "very influenced" by BBC BASIC, though adding additional functions to do things that would have required assembly language on the BBC.

Features

A program in Locomotive BASIC which draws a world map in Mode 1 (320x200px and 4 colours) Locomotive BASIC world map.gif
A program in Locomotive BASIC which draws a world map in Mode 1 (320x200px and 4 colours)
Printing colour bars on the screen in Mode 0 (16 colours) with BASIC Locomotive BASIC color bars.gif
Printing colour bars on the screen in Mode 0 (16 colours) with BASIC
Amstrad CPC colour palette with ink numbers Amstrad CPC ink numbers.png
Amstrad CPC colour palette with ink numbers

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, and PAPER in all versions; plus FILL in v1.1), even allowing the creation of multiple screens, windows, and the like, although the color system and palette handling was awkward. A table giving the numeric codes for the 27 system colors was printed over the built-in 3" disk drive casing on the 664 and later machines. Simple as it was, it did stand out however among other BASICs of the time by offering a timer-based software interrupt mechanism using the EVERY or AFTER commands; this offered a timed repeating or one-off call respectively to the BASIC line number of the user's choice.

Also, when compared to other home computers of the time, the Amstrad via Locomotive BASIC granted a relatively high level of control over the CPC sound chip, an AY-3-8912 with 3 melodic channels and 1 noise channel. The same chip was also used on late-model ZX Spectrums, as well as the Atari ST and MSX computers, but none of those had such a complete built-in SOUND command. Many things, 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. Granted, especially complex and/or low-level techniques could not be done with BASIC due to their requiring more precise or direct access to the hardware, e.g. especially complex music from trackers (including simulated chords using arpeggios, etc.), the playback of digitally sampled sounds as in the game RoboCop for example, and so on.

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, SAVE, MERGE, RUN, CAT, LOAD etc. In fact, during those years, the BASIC supplied as standard with most low-cost home computers also acted as a more or less simple operating system.

Loading a picture from floppy disk in Locomotive BASIC Locomotive BASIC loading a picture from disk.gif
Loading a picture from floppy disk in Locomotive BASIC

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. Adding the right memory address(es) as parameter to the commands LOAD or SAVE would allow easy loading of raw uncompressed 16 KB screen pictures. CALLing another address gave a forced system reset (call 0), the famous "Press Any Key" (call &bb18) or for eliminating flicker in animation by allowing you to synchronize with the monitor's raster scan via "sync frame-flyback" (call &bd19); this was given its own dedicated command in Basic 1.1 - FRAME. With PEEK and POKE, CALL provided an interface to assembly language programming from BASIC.

Contemporary rivals

Unlike the Commodore 64's built in BASIC (Commodore BASIC), which had no dedicated commands for graphics or sound, Locomotive BASIC allowed doing pretty much anything that was within the standard capabilities of the machine. This was not unimportant, as some other machines of the era required programmers to use assembler in order to access the full sound and graphics capabilities of their system. MSX, Sinclair Spectrum and some others offered a similar, more or less complete command set for their sound and graphics capabilities. The only things going clearly beyond BASIC capabilities were the overscan modes used in games and demos, 27-color graphics modes, digital sound playback, and smooth scrolling.

Unlike Sinclair BASIC or Commodore 64 BASIC, which had various keyboard command shortcuts or specialized keys for choosing symbols or colors, Locomotive BASIC keywords were typed in full and the interpreter parsed, recognized and tokenised them. However, there were abbreviations like "?" for "PRINT" and a few shortcuts. Programs could be saved onto Compact Cassette or floppy disk and retrieved as binary or ASCII files.

Related Research Articles

Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the original Apple II model. It is also referred to as FP BASIC because of the Apple DOS command used to invoke it, instead of INT for Integer BASIC.

<span class="mw-page-title-main">Amstrad CPC</span> Home computers produced by Amstrad

The Amstrad CPC is a series of 8-bit home computers produced by Amstrad between 1984 and 1990. It was designed to compete in the mid-1980s home computer market dominated by the Commodore 64 and the ZX Spectrum, where it successfully established itself primarily in the United Kingdom, France, Spain, and the German-speaking parts of Europe.

A disk operating system (DOS) is a computer operating system that resides on and can use a disk storage device, such as a floppy disk, hard disk drive, or optical disc. A disk operating system provides a file system for organizing, reading, and writing files on the storage disk, and a means for loading and running programs stored on that disk. Strictly, this definition does not include any other functionality, so it does not apply to more complex OSes, such as Microsoft Windows, and is more appropriately used only for older generations of operating systems.

<span class="mw-page-title-main">GW-BASIC</span> Dialect of the BASIC programming language

GW-BASIC is a dialect of the BASIC programming language developed by Microsoft from IBM BASICA. Functionally identical to BASICA, its BASIC interpreter is a fully self-contained executable and does not need the Cassette BASIC ROM found in the original IBM PC. It was bundled with MS-DOS operating systems on IBM PC compatibles by Microsoft.

<span class="mw-page-title-main">CP/M</span> Discontinued family of computer operating systems

CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system created in 1974 for Intel 8080/85-based microcomputers by Gary Kildall of Digital Research, Inc. CP/M is a disk operating system and its purpose is to organize files on a magnetic storage medium, and to load and run programs stored on a disk. Initially confined to single-tasking on 8-bit processors and no more than 64 kilobytes of memory, later versions of CP/M added multi-user variations and were migrated to 16-bit processors.

<span class="mw-page-title-main">MSX</span> Family of standardized home computer architectures released between 1983 and 1992

MSX is a standardized home computer architecture, announced by ASCII Corporation on June 16, 1983. It was initially conceived by Microsoft as a product for the Eastern sector, and jointly marketed by Kazuhiko Nishi, the director at ASCII Corporation. Microsoft and Nishi conceived the project as an attempt to create unified standards among various home computing system manufacturers of the period, in the same fashion as the VHS standard for home video tape machines. The first MSX computer sold to the public was a Mitsubishi ML-8000, released on October 21, 1983, thus marking its official release date.

<span class="mw-page-title-main">SAM Coupé</span> 8-bit British home computer released in late 1989

The SAM Coupé is an 8-bit British home computer manufactured by Miles Gordon Technology (MGT), based in Swansea in the United Kingdom and released in December 1989.

Commodore BASIC, also known as PET BASIC or CBM-BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET (1977) to the Commodore 128 (1985).

<span class="mw-page-title-main">Enterprise (computer)</span> Zilog Z80-based home computer

The Enterprise is a Zilog Z80-based home computer announced in 1983, but due to a series of delays, was not commercially available until 1985. It was developed by British company Intelligent Software and marketed by Enterprise Computers.

<span class="mw-page-title-main">Commodore DOS</span>

Commodore DOS, also known as CBM DOS, is the disk operating system used with Commodore's 8-bit computers. Unlike most other DOSes, which are loaded from disk into the computer's own RAM and executed there, CBM DOS is executed internally in the drive: the DOS resides in ROM chips inside the drive, and is run there by one or more dedicated MOS 6502 family CPUs. Thus, data transfer between Commodore 8-bit computers and their disk drives more closely resembles a local area network connection than typical disk/host transfers.

Locomotive Software was a small British software house that did most of its development for Amstrad's home and small business computers of the 1980s. It was founded by Richard Clayton and Chris Hall on 14 February 1983.

Mallard BASIC is a BASIC interpreter for CP/M produced by Locomotive Software and supplied with the Amstrad PCW range of small business computers, the ZX Spectrum +3 version of CP/M Plus, and the Acorn BBC Micro's Zilog Z80 second processor.

<span class="mw-page-title-main">Super Expander</span>

The VIC-1211 Super Expander is a cartridge for the VIC-20 home computer. It was designed to provide several extensions to the BASIC interpreter on the computer, mostly to help with programming graphics and sound. It also provided 3 kB of extra RAM. The cartridge was created by Commodore Business Machines (CBM) and released in 1981.

<span class="mw-page-title-main">BASICODE</span>

BASICODE was a computer project intended to create a unified standard for the BASIC programming language. BASIC was available on many popular home computers, but there were countless variants that were mostly incompatible with each other. The project was initiated in 1980 by Hobbyscoop, a radio program of the Dutch broadcasting organisation Nederlandse Omroep Stichting (NOS).

MSX-DOS is a discontinued disk operating system developed by Microsoft's Japan subsidiary for the 8-bit home computer standard MSX, and is a cross between MS-DOS v1.25 and CP/M-80 v2.2.

<span class="mw-page-title-main">SymbOS</span>

SYmbiosis Multitasking Based Operating System (SymbOS) is a multitasking operating system for Zilog Z80-based 8-bit computer systems.

BSAVE and BLOAD are commands in many varieties of the BASIC programming language. BSAVE copies RAM to a binary file, and BLOAD copies the contents of the file to RAM. The term "BSAVE image" could mean any of various raw image formats of video display controllers, or more generally any file containing the raw contents of a section of memory.

<span class="mw-page-title-main">AmigaOS</span> Operating system for Amiga computers

AmigaOS is a family of proprietary native operating systems of the Amiga and AmigaOne personal computers. It was developed first by Commodore International and introduced with the launch of the first Amiga, the Amiga 1000, in 1985. Early versions of AmigaOS required the Motorola 68000 series of 16-bit and 32-bit microprocessors. Later versions were developed by Haage & Partner and then Hyperion Entertainment. A PowerPC microprocessor is required for the most recent release, AmigaOS 4.

<span class="mw-page-title-main">Home computer</span> Class of microcomputers

Home computers were a class of microcomputers that entered the market in 1977 and became common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a single, non-technical user. These computers were a distinct market segment that typically cost much less than business, scientific, or engineering-oriented computers of the time, such as those running CP/M or the IBM PC, and were generally less powerful in terms of memory and expandability. However, a home computer often had better graphics and sound than contemporary business computers. Their most common uses were word processing, playing video games, and programming.

The IBM Personal Computer Basic, commonly shortened to IBM BASIC, is a programming language first released by IBM with the IBM Personal Computer, Model 5150 in 1981. IBM released four different versions of the Microsoft BASIC interpreter, licensed from Microsoft for the PC and PCjr. They are known as Cassette BASIC, Disk BASIC, Advanced BASIC (BASICA), and Cartridge BASIC. Versions of Disk BASIC and Advanced BASIC were included with IBM PC DOS up to PC DOS 4. In addition to the features of an ANSI standard BASIC, the IBM versions offered support for the graphics and sound hardware of the IBM PC line. Source code could be entered with a full-screen editor, and limited facilities were provided for rudimentary program debugging. IBM also released a version of the Microsoft BASIC compiler for the PC concurrently with the release of PC DOS 1.10 in 1982.

References

  1. Smith, Tony (12 February 2014). "You're NOT fired: The story of Amstrad's amazing CPC 464". The Register . Retrieved 17 February 2014.