These are defined by using $ after the variable name, e.g., str$="Hello". To assign a 16-bit value to a signed integer directly, you should give the number in a hexadecimal format, e.g., uint=&c0000. These can store values between -32,768 and 32,767. You can force all variables starting with specific letters to be this type by using the DEFINT keyword. In many cases you don't want to use these, as they are slower than using the integer type, and use more memory (5 bytes, as opposed to 2).ĭefined using % after the variable name, e.g., integer%=500. You can force all variables starting with specific letters to be this type by using the DEFREAL keyword. This is the default type for a Locomotive BASIC variables, but can be clarified using ! after the variable name, e.g., real!=500.0. This also featured exceptionally advanced random-access file handling, a feature missing from the CPC. those not concerned with CPC-specific firmware and hardware features - were upgraded to become Mallard BASIC, the CP/M language shipped with the PCW. The 'pure BASIC' parts of Locomotive BASIC - i.e. Some parts of 'BASIC' were actually housed in the firmware ROM, but were not officially accessible to other programs. The AUTO command show the whole line if it exist, it only printed a * on the 464.Extra, optional 'plotting mode' parameter for DRAW/PLOT commands (supported only through control codes on BASIC 1.0).in FOR loops with negative start/end values) Some number-handling bugs removed (e.g.COPYCHR$ function (fetch character from screen).FILL command (fill area with solid colour).Better handling of string arguments to RSXs (|DIR,"*.BAS" rather than DATA statements can appear anywhere within a line in BASIC 1.0, they had to be at the end of a line.DEC$ bug removed (in BASIC 1.0, it required two opening brackets and was undocumented).Changes were minor but significant for the programmer, and included: The language was revised and debugged for the 664, 6128 and Plus machines to become BASIC 1.1. The existence of this is cited as one of the reasons Locomotive requested that Amstrad change the CPC's processor from a 6502 to a Z80. The CPC implementation of Locomotive BASIC was developed directly from Locomotive Software's existing Z80 BASIC. If you are interested in more information about the different versions of the CPC's BASIC and the technical details, you can have a look at the article " Technical information about Locomotive BASIC".Īnother helpful and further resource of information about BASIC and a similar comprehension to this is Grimware's Website about the CPC History With DEF FN, ON variable GOTO and ON variable GOSUB, Locomotive BASIC provided the rudiments of "structured programming", though nowhere near the extent of the PROCedures of BBC Basic.Īll in all, if you compare BASIC interpreters of that era, the Locomotive's seems to be the best 'all-rounder' regarding the combination of speed and complexity, and still some of its features were unmatched by others. Many successful programs, including games such as Radzone and applications such as PowerPage, made use of this technique. Both through this (combined with CALL, PEEK and POKE) and the firmware's RSX system, it was easy to mix BASIC and assembly code, thereby speeding up programs by coding the slowest parts directly in machine code. The latter allowed for loading of raw screen data, thus providing easy picture showing. That was something unmatched by other computers of that era.Īlso there was simple interface for memory management, with MEMORY and LOAD commands. With the SOUND command, you could select channels, set envelopes, pitch, noise and volume. It had extensive sound commands, granting control of the AY-3-8912 via the firmware's volume and tone envelope system. Unlike the competing Commodore 64, it featured a comprehensive graphic capabilities with its PLOT, DRAW, PAPER, INK, PEN, BORDER and (in BASIC 1.1) FILL commands. The language benefited both from a clean, well-thought out implementation of the core language by Locomotive, and by the excellent firmware of the CPC, which lent most of its advanced features to the BASIC. Locomotive BASIC, was one of the best and fastest BASIC implementations of the era.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |