Jump to content

Category:Locomotive Basic: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 8:
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. 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.)
 
As on many other 8-bit machines of the era, BASIC programs are often extended with Z80 machine code which is <tt>READ</tt> from <tt>DATA</tt> statements, <tt>[[wp:PEEK and POKE|POKE]]</tt>-d to RAM, and then <tt>CALL</tt>-ed—an approach that was especially popular with type-in games in CPC magazines. The CPC also has a more convenient form of BASIC extensions, RSX<ref>http://www.cpcwiki.eu/index.php/RSX</ref> commands ('''r'''esident '''s'''ystem e'''x'''tensions). They are easily recognized by being prefixed with a pipe character and have the advantage of being freely relocatable in memory. Some RSX commands, such as "|ren" to rename files, are part of the AMSDOS ROM, but RSX routines can also reside in RAM, e.g. to provide new graphics primitives or provide other new capabilities to BASIC.
 
Memory on the CPC 464 and 664 is subdivided into four 16 kB blocks (0 to 3), with block 3 at &c000 normally reserved for the screen. The CPC 6128 features a second 64 kB bank (blocks 4 to 7) which can be accessed from BASIC with [[wp:Bank switching|bank switching]] in block 1 (&4000 and &7fff), e.g.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.