Category:Locomotive Basic: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 5: Line 5:


'''Locomotive BASIC''' is a variant of BASIC that is built into the ROM of the [[wp:Amstrad CPC|Amstrad CPC]] series of home computers introduced in 1984. In the 1980s, the CPC was a popular, slightly more expensive alternative to the Commodore C64/C128. It was not just suited for games but also office work because of its high resolution display and [[wp:CP/M|CP/M]] support.
'''Locomotive BASIC''' is a variant of BASIC that is built into the ROM of the [[wp:Amstrad CPC|Amstrad CPC]] series of home computers introduced in 1984. In the 1980s, the CPC was a popular, slightly more expensive alternative to the Commodore C64/C128. It was not just suited for games but also office work because of its high resolution display and [[wp:CP/M|CP/M]] support.

The CPC was based on a Zilog Z80 CPU running at 4 MHz and came with a built-in cassette deck (CPC 464) or 3" disk drive (CPC 664 and
6128) as storage devices and a green screen or color monitor which also housed its power supply. Amstrad CPC sales were particularly strong in the UK, Germany, France, and Spain.


The easiest way to use Locomotive BASIC today is [https://benchmarko.github.io/CPCBasic/cpcbasic.html CPCBasic], a very fast implementation in JavaScript which also allows easy pasting of code from Rosetta Code. Note that programs will run much faster in CPCBasic than on a real CPC, so animations may require an extra delay for each frame, e.g. a delay loop:<lang locobasic>for delay=1 to 10000:next</lang> or the "frame" command which will wait for the next frame.
The easiest way to use Locomotive BASIC today is [https://benchmarko.github.io/CPCBasic/cpcbasic.html CPCBasic], a very fast implementation in JavaScript which also allows easy pasting of code from Rosetta Code. Note that programs will run much faster in CPCBasic than on a real CPC, so animations may require an extra delay for each frame, e.g. a delay loop:<lang locobasic>for delay=1 to 10000:next</lang> or the "frame" command which will wait for the next frame.
Line 32: Line 29:
to run your first Locomotive BASIC program.
to run your first Locomotive BASIC program.


==Features==
==CPC Features==

The CPC was based on a Zilog Z80 CPU running at 4 MHz and came with a built-in cassette deck (CPC 464) or 3" disk drive (CPC 664 and
6128) as storage devices and a green screen or color monitor which also housed its power supply. Amstrad CPC sales were particularly strong in the UK, Germany, France, and Spain.

Locomotive BASIC was comparatively advanced for its time (with e.g. software interrupts and comprehensive graphics and audio commands) and is very cleanly implemented, just like the rest of the Amstrad CPC ROM. No doubt this was partly because the CPC debuted relatively late during the era of 8-bit machines, so Locomotive Software had more of an opportunity to consider the good and bad software design decisions in existing home computers.


Locomotive BASIC was comparatively advanced for its time (with e.g. software interrupts and comprehensive graphics and audio commands) and is very cleanly implemented, just like the rest of the Amstrad CPC ROM. No doubt this was partly because the CPC debuted relatively late during the era of 8-bit machines, so Locomotive Software had more of an opportunity to consider the good and bad software design decisions in existing home computers. System calls are made with <tt>CALL</tt> via dedicated jump blocks in RAM, so they are unaffected by changes to the ROM between CPC models. This makes software very compatible between the original three CPC models and ''mostly'' compatible for the later, considerably less popular "Plus" models that came out in 1990. Together with AMSDOS, the '''Ams'''trad '''D'''isk '''O'''perating '''S'''ystem, Locomotive BASIC is also used for disk and tape operations. (Some commands however, e.g. <tt>disckit3</tt> for formatting disks, are only available under CP/M.)
System calls are made with <tt>CALL</tt> via dedicated jump blocks in RAM, so they are unaffected by changes to the ROM between CPC models. This makes software very compatible between the original three CPC models and ''mostly'' compatible for the later, considerably less popular "Plus" models that came out in 1990. Together with AMSDOS, the '''Ams'''trad '''D'''isk '''O'''perating '''S'''ystem, Locomotive BASIC is also used for disk and tape operations. (Some commands however, e.g. <tt>disckit3</tt> for formatting disks, are only available under CP/M.)


===Screen modes===
===Screen modes===