HOME

TheInfoList



OR:

Locomotive Basic is a proprietary dialect of the
BASIC programming language BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of General-purpose programming language, general-purpose, high-level programming languages designed for ease of use. Dartmouth BASIC, The original version was created by John ...
written by
Locomotive Software 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. It wrote or contributed sign ...
on the
Amstrad CPC The Amstrad CPC (short for ''Colour Personal Computer'') 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 Sin ...
(where it was built-in on
ROM Rom, or ROM may refer to: Biomechanics and medicine * Risk of mortality, a medical classification to estimate the likelihood of death for a patient * Rupture of membranes, a term used during pregnancy to describe a rupture of the amniotic sac * R ...
) and the later Locomotive BASIC-2 as a GEM application on the Amstrad
PC1512 The Amstrad PC1512 was Amstrad's mostly IBM PC-compatible computer system, first manufactured in 1986. It was later succeeded by the PC1640. Features Whereas IBM's PC (and almost all PC compatibles) had a power supply in a corner of the main cas ...
and 1640. It was the main descendant of
Mallard BASIC 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#CP/M Plus, CP/M Plus, and the Acorn Computers, Acorn BBC Micro's Z ...
, the interpreter for
CP/M 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. Initial ...
supplied with the
Amstrad PCW The Amstrad PCW series is a range of personal computers produced by British company Amstrad from 1985 to 1998, and also sold under licence in Europe as the "Joyce" by the German electronics company Schneider in the early years of the series' life. ...
. 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 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#CP/M Plus, CP/M Plus, and the Acorn Computers, Acorn BBC Micro's Z ...
for
Acorn Computers Acorn Computers Ltd. was a British computer company established in Cambridge, England, in 1978. The company produced a number of computers which were especially popular in the United Kingdom, UK, including the Acorn Electron and the Acorn Archi ...
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 BBC BASIC is a version of the BASIC programming language released in 1981 as the native programming language for the BBC Micro home/personal computer, providing a standardized language for a UK computer literacy project of the BBC. It was wri ...
, though adding additional functions to do things that would have required
assembly language In computer programming, assembly language (or assembler language, or symbolic machine code), often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence be ...
on the BBC.


Features

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 your 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 The AY-3-8910 is a 3-voice programmable sound generator (PSG) designed by General Instrument in 1978, initially for use with their 16-bit CP1610 or one of the PIC1650 series of 8-bit microcomputers. The AY-3-8910 and its variants were used i ...
with 3 melodic channels and 1 noise channel. The same chip was also used on late-model
ZX Spectrum The ZX Spectrum () is an 8-bit computing, 8-bit home computer that was developed by Sinclair Research. It was released in the United Kingdom on 23 April 1982, and became Britain's best-selling microcomputer. Referred to during development as t ...
s, as well as the
Atari ST The Atari ST is a line of personal computers from Atari Corporation and the successor to the Atari 8-bit family. The initial model, the Atari 520ST, had limited release in April–June 1985 and was widely available in July. It was the first pers ...
and
MSX MSX is a standardized home computer architecture, announced by Microsoft and 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, then vice-p ...
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 ''RoboCop'' is a 1987 American science fiction action film directed by Paul Verhoeven and written by Edward Neumeier and Michael Miner. The film stars Peter Weller, Nancy Allen, Daniel O'Herlihy, Ronny Cox, Kurtwood Smith, and Miguel Ferre ...
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 An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
. 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 In computing, PEEK and POKE are commands used in some high-level programming languages for accessing the contents of a specific memory cell referenced by its memory address. PEEK gets the byte located at the specified memory address. POKE sets ...
, CALL provided an interface to assembly language programming from BASIC.


Contemporary rivals

Unlike the
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in the Guinness ...
's built in BASIC (
Commodore BASIC 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 of 1977 to the C128 of 1985. The core is based on 6502 M ...
), 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 Assembler may refer to: Arts and media * Nobukazu Takemura, avant-garde electronic musician, stage name Assembler * Assemblers, a fictional race in the ''Star Wars'' universe * Assemblers, an alternative name of the superhero group Champions of A ...
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 Sinclair BASIC is a dialect of the programming language BASIC used in the 8-bit home computers from Sinclair Research and Timex Sinclair. The Sinclair BASIC interpreter was made by Nine Tiles Networks Ltd. History Sinclair BASIC was orig ...
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 Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lati ...
, recognized and tokenised them. However, there were abbreviations like "?" for "PRINT" and a few shortcuts. Programs could be saved onto
Compact Cassette The Compact Cassette or Musicassette (MC), also commonly called the tape cassette, cassette tape, audio cassette, or simply tape or cassette, is an analog magnetic tape recording format for audio recording and playback. Invented by Lou Ottens ...
or
floppy disk A floppy disk or floppy diskette (casually referred to as a floppy, or a diskette) is an obsolescent type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined w ...
and retrieved as binary or
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
files.


References


External links


Locomotive BASIC referenceCommand reference with code examplesCommand reference
(incomplete)
Additional code examples
at
Rosetta Code Rosetta Code is a wiki-based programming website with implementations of common algorithms and solutions to various programming problems in many different programming languages. It is named for the Rosetta Stone, which has the same text inscribe ...
{{DEFAULTSORT:Locomotive Basic Amstrad CPC BASIC interpreters BASIC programming language family