Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Locomotive BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== BASIC and version differences == Internal version numbers of the BASIC ROM differ from the accepted, published versions discussed here. Although not unique, the platform was unusual among contemporaries in that it used the ASCII character set rather than its own idiosyncratic form - an arguable strength as it instantly made the CPC platform a more serious offering, somewhat underpinning Amstrad's marketing claims of it being capable of professional business use. In common with many other dialects, multiple program statements are separated on a single line using the colon <code>:</code>. <code>WHILE/WEND</code> is the only loop construct other than <code>FOR/NEXT</code>. Reserved words (functions, commands, statements etc.) are capitalized in a program by virtue of being tokenized. This reduces program size and accelerates execution. Listing a program then decodes the token to its reserved word which are all in upper case in the token table (it was this method which revealed the presence of DEC$ in BASIC 1.0 - see below). When saving a basic program, the fully tokenized form is saved in a binary format. Alternatively, saving with option "A" creates a fully text compatible ascii file e.g. <CODE>SAVE "MYPROG",A</CODE> === BASIC 1.0 === Supplied with the Amstrad CPC464, it was a good release with only a single notable bug, being the <CODE>DEC$()</CODE> function (it provides <CODE>PRINT USING</CODE> style output but as a string rather than screen output). No time was available to fix this before the firmware had to go for ROM chip production. Consequently, the function was simply left un-documented and pre-fixed to force a syntax error when encountered. The curious programmer found the word <code>dec$</code> capitalised in their code indicating it was a recognised reserved word - inexplicable at the time, until the history of the bug and disassemblies of the BASIC ROM became available. [[File:CPC464 dec$.png|300px|center|dec$ tokenization and error betrays reserved word origins]] Exploration of the BASIC 1.0 ROM can find the remnants of the function and its crippled token table entry. === BASIC 1.1 === Supplied with the CPC664/6128, besides fixing DEC$, it introduced (among others) the following additional keywords: COPYCHR$, CURSOR, FILL, FRAME, GRAPHICS PAPER, GRAPHICS PEN and MASK It also introduced a clumsy but adequate method of trapping disc errors with the <CODE>DERR</CODE> function. Errors still had to be trapped in the usual way with <CODE>ON ERROR GOTO ...</CODE> but the single "Broken In" error 32 could now be expanded to provide more detail. Examining DERR gives up to ten further indicators. Values returned are the AMSDOS error number plus 128, e.g. 14 is reported as a DERR value of 142 (14+128). Possible errors included the usual file not found, disk full etc. as well as the more specific "142 - The stream is not in a suitable state" and "149 - Disc changed while files were open". DERR is a function of BASIC 1.1 and so was not available on the FDI1 expanded CPC464, with its combination of AMSDOS and BASIC 1.0. Disc errors on the CPC464 were obtainable but relied on <CODE>PEEK</CODE>ing into the AMSDOS system area, such program being incompatible with CPC664/6128 due to the AMSDOS variable addresses having moved.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)