Even before the ZX80 was introduced in February 1980, the constant downward price-pressure in the industry was allowing the already inexpensive design to be further reduced in complexity and cost. In particular, many of the separate circuits in the ZX80 were re-implemented in a single uncommitted logic array from Ferranti, which allowed the price to be reduced to only £49.95 while increasing the size of the ROM to 8 KB. This work was assigned to Steve Vickers, who joined Nine Tiles in January 1980. Whilst Grant worked on the code interfacing with hardware, Vickers used the larger space to introduce floating-point arithmetic and a suite of trig functions, which were expected of any BASIC from that era, producing 8K BASIC. The initial version did not support the ZX Printer and had a bug in its square root function. Nine Tiles provided a new version to address these, but Sinclair was slow to include the new version in the ROMs. The new ROMs were eventually offered to owners of the earlier ZX80 as well.
In February 1982, Nine Tiles began to have disagreements with Sinclair over owed royalties for the various manuals that Nine Tiles had produced. Around the same time, Vickers and his Sinclair counterpart, Richard Altwasser, left their respective companies to start the Jupiter Ace project. When the Spectrum was launched the ROM was still not complete, and although Nine Tiles continued working on it until April 1982, by that point 75,000 Spectrums had already been sold and the project was cancelled. The missing functionality was later added by additional code in the ZX Interface 1. After Nine Tiles and Sinclair went their own ways, several new versions of 48 BASIC were created.
Amstrad purchased Sinclair Research in 1986. As Sinclair had never owned the copyright to the language, Amstrad had to arrange a new license with Nine Tiles. Several other versions also appeared in this period as various extensions and clones of the Spectrum were introduced. These included +3 BASIC, BASIC64 and Timex Extended Basic.
In contrast to most machines of the era, the editor does not allow freeform editing at any point on the screen. Instead, when the user presses EDIT, the current line of code is copied back to the bottom of the screen. The user can move horizontally through this line using the cursor keys and commits their changes by pressing NEW LINE again. In contrast, on machines like the Commodore 64 or Atari 8-bit computers, the up and down keys can be used to move among the lines in the program and edit them in-place.
The most notable feature of the editor is that keywords are entered using single keystrokes. For instance, on the ZX81, the P key on the keyboard would cause the entire keyword PRINT to be entered into the currently editing line. Once a keyword has been entered, the cursor changes to an "L" to indicate what follows will be interpreted as normal text. For instance, pressing P again at this point would enter a single letter "P".
Keys generally had two separate keywords assigned to them – one above it and one below. Pressing the key in "K" mode would enter the keyword above the key, like PRINT for P. If the system was in "L" mode, one could return to "K" by pressing the shift key – the systems did not initially support lowercase text, so the shift was not otherwise needed. The keywords below the keys required a second keystroke, ⇧ Shift+NEW LINE, which put the editor into "function mode", changing the cursor to an "F". Entering common code often resulted in a significant number of keystrokes.
The system has the advantage of representing all multi-character keywords as a single character in memory, which was a significant savings in the early machines that shipped with only 1 KB of RAM. This single-character representation included multi-character items like <>. This has the added advantages of simplifying the runtime, as it can immediately determine whether a character in the source code is a keyword or text, and also means that keywords are never entered directly, meaning that one can, for instance, have a variable named "PRINT", as the system can determine that it is not the same as the keyword.
As the systems evolved and added new keywords, the entry system became increasingly difficult to use. 48 BASIC in the Spectrum required every key to host up to four keywords. Entering keywords was a time-consuming process of looking over the relatively small type on the keyboard for the appropriate key, and then correctly entering the multiple keystrokes needed to enter it properly. For instance, entering BEEP required one to type CAPS SHIFT+SYMBOL SHIFT to access extended mode (later models include a separate EXTENDED MODE key), keeping SYMBOL SHIFT held down, and then and pressing Z. To improve the complex entry on the Spectrum, the keywords were colour-coded to indicate the required mode:
This concept had run its course, and later machines running 128 BASIC (ZX Spectrum 128, +2, +3, +2A, and +2B) featured a more traditional editor where the user typed-in the keyword as individual characters, similar to other home computers of the era. This required a new tokenizer to convert the line into a similar internal format.
One uncommon feature of Sinclair BASIC is the way it stores variables in memory. Typically, interpreters use a fixed-size entry to hold data, making it easy to scan the variable table. Due to the extremely limited memory of the ZX series, any wasted space had to be avoided, and this led to the use of a variable-length format. The data types included numbers stored in a 5-byte values, strings with a length and then the characters, and arrays of both of those types. The data was stored in the table itself, which contrasts with most BASICs of the era, where strings and array entries were stored in a separate heap.
The first byte for a variable entry always held the type in the first three bits, and the first character of the name in the next five bits. As was the case in most microcomputer dialects, A, A$, A() and A$() were all different variables and could store different values. Most variables could only have a single-character name; the exception are numeric variables (not arrays), where an alternate format held the first character of the name in those same five bits, but was then followed by additional characters ending with one with its high-bit set. Long variable names were whitespace-independent, and case-insensitive in later versions, so LET Number Of Apples = 5 is the same as LET numberofapples = 5 referred to the same variable.
The downside to this approach is that scanning the table to look up the value of a variable reference is more complex. In addition to testing whether the name matches using the subset of the first byte, if the entry is not the one that is being looked for, the type has to be read from the upper three bits and then the next location of a variable in storage calculated using the type. For instance, if the program encounters the variable "A" and the table starts with the entry for "B$", it fails to match A with B, then reads the type to see it is a string, and then has to read the following length byte and skip forward by that amount of bytes to find the next entry in the table. To make this somewhat easier, arrays also stored a two-byte length, so the entire structure could be skipped over more easily.
A unique feature was the "short float", or integer type. Any numeric variable could store either type, the storage itself did not change and used 5 bytes in either case. Integers were indicated by setting the exponent byte to zero, while floating-point values were stored with an excess-128 format exponent. This meant that it could not store zero as a float and lost one possible exponent magnitude. It also did not use any less memory, as the values were still 5-byte in memory. The advantage to this format is performance; the math library included tests to look for the zero exponent, and if it was seen, it would not attempt to perform various operations on the remaining 3 bytes under certain conditions.
The ZX81 8K BASIC used the shorter forms GOTO, GOSUB, CONT and RAND, whereas the Spectrum 48 BASIC used the longer forms GO TO, GO SUB, CONTINUE and RANDOMIZE. The ZX80 4K BASIC also used these longer forms but differed by using the spelling RANDOMISE. The ZX81 8K BASIC was the only version to use FAST, SCROLL, SLOW and UNPLOT. The ZX80 4K BASIC had the exclusive function TL$(); it was equivalent to the string operator (2 TO ) in later versions.
128 BASIC, present on ZX Spectrum 128, +2, +3, +2A, and +2B, stored keywords internally in one-byte code points, but used a conventional letter-by-letter BASIC input system. It also introduced two new commands:
The original Spanish ZX Spectrum 128 included four additional BASIC editor commands in Spanish, one of which was undocumented:
Unlike the LEFT$(), MID$() and RIGHT$() functions used in the ubiquitous Microsoft BASIC dialects for home computers, parts of strings in Sinclair BASIC are accessed by numeric range. For example, a$(5 TO 10) gives a substring starting with the 5th and ending with the 10th character of the variable a$. Thus, it is possible to replace the LEFT$() and RIGHT$() commands by simply omitting the left or right array position respectively; for example a$( TO 5) is equivalent to LEFT$(a$,5). Further, a$(5) alone is enough to replace MID$(a$,5,1).
On the 16K/48K ZX Spectrum (48 BASIC), there are 88 keywords in Sinclair BASIC, denoting commands (of which there are 50), functions and logical operators (31), and other keywords (16, including 9 which are also commands or functions):
Several ZX Spectrum interpreters exist.
Garfield, Simon (28 February 2010). "Sir Clive Sinclair: "I don't use a computer at all"". The Guardian. Retrieved 23 May 2011. He is keen to credit [...], not least Nine Tiles, the company that made the Basic operating software. https://www.theguardian.com/technology/2010/feb/28/clive-sinclair-interview-simon-garfield
Adamson & Kennedy, p. 63. sfn error: no target: CITEREFAdamsonKennedy (help)
Adamson & Kennedy 1986, p. 64. - Adamson, Ian; Kennedy, Richard (1986). Sinclair and the 'sunrise' Technology. Penguin. https://rk.nvg.ntnu.no/sinclair/computers/zx81/zx81_sst.htm
Adamson & Kennedy 1986, p. 70. - Adamson, Ian; Kennedy, Richard (1986). Sinclair and the 'sunrise' Technology. Penguin. https://rk.nvg.ntnu.no/sinclair/computers/zx81/zx81_sst.htm
"ZX80 – 8K BASIC ROM Upgrade". www.fruitcake.plus.com. http://www.fruitcake.plus.com/Sinclair/ZX80/ROMUpgrade/ZX80_ROMUpgrade.htm
"World of Spectrum - Documentation - ZX Spectrum +3 - Chapter 7". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128+3Manual/chapter7.html
"World of Spectrum - Documentation - ZX Spectrum 128 Manual Page 6". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128Manual/sp128p06.html
Smith, Tony (23 April 2012). "Happy 30th Birthday, Sinclair ZX Spectrum". The Register. https://www.theregister.com/2012/04/23/retro_week_sinclair_zx_spectrum_at_30?page=2
Adamson & Kennedy 1986, p. 88. - Adamson, Ian; Kennedy, Richard (1986). Sinclair and the 'sunrise' Technology. Penguin. https://rk.nvg.ntnu.no/sinclair/computers/zx81/zx81_sst.htm
"World of Spectrum - Documentation - ZX Spectrum 128 Manual Page 6". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128Manual/sp128p06.html
"World of Spectrum - Documentation - ZX Spectrum 128 Manual Page 6". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128Manual/sp128p06.html
"World of Spectrum - Documentation - ZX Spectrum +3 - Chapter 7". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128+3Manual/chapter7.html
Dunn, Paul (7 December 2022), SpecBAS, retrieved 12 December 2022 https://github.com/ZXDunny/SpecBAS
"CSDb". Commodore 64 Scene Database. Retrieved 12 December 2022. https://csdb.dk/search/?seinsel=releases&search=spectrum+emulator&all=1
Vickers 1983, p. 7–8. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
"Picture of ZX80". https://upload.wikimedia.org/wikipedia/commons/5/54/Sinclair_ZX80_%281980%29_-_Computer_History_Museum.jpg
"Spectrum 128 ROM Disassembly - Spanish Spectrum 128". www.fruitcake.plus.com. http://www.fruitcake.plus.com/Sinclair/Spectrum128/ROMDisassembly/Spectrum128ROMDisassembly3.htm
Sinclair (1985). ZX Spectrum 128 Introducción y Guía de Funcionamiento. Sinclair Research Ltd and Investronica, S. A. p. 9. http://archive.org/details/128_20220808_202208
Optional parameters are enclosed in [square brackets]
These assume the computer is in K (keyword) mode, which it normally is at the start of a line when entering BASIC. On the Spectrum 16K and 48K, Extended Mode is entered by pressing CAPS SHIFT and SYMBOL SHIFT simultaneously rather than the EXTENDED MODE key that is present on the Spectrum+ and later models.
Vickers 1983, p. 59. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 70. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
“False” in Sinclair BASIC equates to 0 (zero), everything else equates to “true”. Functions that return true-or-false values thus actually return 0 for false and 1 for true, while AND usually returns the first of the conditions supplied for true, or 1 if no numerical values were given. For example, 6 AND 7 returns 6, while NOT 6=7 returns 1.
Vickers 1983, p. 85. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 69–70. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 101. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 70. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 116. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 135. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 93. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
The available numbers for colours are:
12345670blueredmagentagreencyanyellowwhiteblack
In all colour-related commands, the number 8 may be used to indicate “transparent” while in INK and PAPER may also be set to 9 for “contrast” — that is, to put a dark colour on a light background or vice versa automatically.
Vickers 1983, p. 113. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
INK, PAPER, FLASH, BRIGHT, OVER and INVERSE set attributes for outputting text and graphics to the screen. They can be used either as commands, to apply to all subsequent output until set again, or within a PRINT statement, to apply only from that point until the end of the statement.
Vickers 1983, p. 110–111. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
CAT, ERASE, FORMAT and MOVE were originally designed to be used with peripherals, but at the launch of ZX Spectrum, they had not been completely implemented, such that their use generated an error message (Invalid Stream). Later with the aid of the ZX Interface 1 shadow ROM, they were used for the ZX Microdrive. (The shadow ROM was paged when the BASIC interpreter detected a syntax error, which is why most ZX Microdrive commands use a "*"). /wiki/ZX_Microdrive
Cambridge Communication 1983, p. 15. - Cambridge Communication (1983). Sinclair ZX Spectrum Microdrive and Interface 1 manual. Sinclair Research.
Vickers 1983, p. 91. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 123. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 103. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
"World of Spectrum - Documentation - ZX Spectrum manual - Chapter 24". worldofspectrum.org. https://worldofspectrum.org/ZXBasicManual/zxmanchap24.html
Vickers 1983, p. 168. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
CAT, ERASE, FORMAT and MOVE were originally designed to be used with peripherals, but at the launch of ZX Spectrum, they had not been completely implemented, such that their use generated an error message (Invalid Stream). Later with the aid of the ZX Interface 1 shadow ROM, they were used for the ZX Microdrive. (The shadow ROM was paged when the BASIC interpreter detected a syntax error, which is why most ZX Microdrive commands use a "*"). /wiki/ZX_Microdrive
Vickers 1983, p. 103. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 91. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 19. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 151. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 68. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 41. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 142. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 60. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 79–81. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 11–123. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
CAT, ERASE, FORMAT and MOVE were originally designed to be used with peripherals, but at the launch of ZX Spectrum, they had not been completely implemented, such that their use generated an error message (Invalid Stream). Later with the aid of the ZX Interface 1 shadow ROM, they were used for the ZX Microdrive. (The shadow ROM was paged when the BASIC interpreter detected a syntax error, which is why most ZX Microdrive commands use a "*"). /wiki/ZX_Microdrive
Cambridge Communication 1983, p. 18. - Cambridge Communication (1983). Sinclair ZX Spectrum Microdrive and Interface 1 manual. Sinclair Research.
Vickers 1983, p. 66. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
INK, PAPER, FLASH, BRIGHT, OVER and INVERSE set attributes for outputting text and graphics to the screen. They can be used either as commands, to apply to all subsequent output until set again, or within a PRINT statement, to apply only from that point until the end of the statement.
Vickers 1983, p. 60. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
CAT, ERASE, FORMAT and MOVE were originally designed to be used with peripherals, but at the launch of ZX Spectrum, they had not been completely implemented, such that their use generated an error message (Invalid Stream). Later with the aid of the ZX Interface 1 shadow ROM, they were used for the ZX Microdrive. (The shadow ROM was paged when the BASIC interpreter detected a syntax error, which is why most ZX Microdrive commands use a "*"). /wiki/ZX_Microdrive
Cambridge Communication 1983, p. 19. - Cambridge Communication (1983). Sinclair ZX Spectrum Microdrive and Interface 1 manual. Sinclair Research.
Vickers 1983, p. 31. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 32. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 37. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 25. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Unlike many other BASIC dialects, Sinclair Basic did not include the ELSE operator in the IF–THEN[–ELSE] clause. A workaround would be to use an IF–THEN–GO TO construct instead, bypassing the lines that would have been in an ELSE clause with the GO TO
Vickers 1983, p. 159. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
The available numbers for colours are:
12345670blueredmagentagreencyanyellowwhiteblack
In all colour-related commands, the number 8 may be used to indicate “transparent” while in INK and PAPER may also be set to 9 for “contrast” — that is, to put a dark colour on a light background or vice versa automatically.
INK, PAPER, FLASH, BRIGHT, OVER and INVERSE set attributes for outputting text and graphics to the screen. They can be used either as commands, to apply to all subsequent output until set again, or within a PRINT statement, to apply only from that point until the end of the statement.
Vickers 1983, p. 110. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 131. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 16. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 59. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
INK, PAPER, FLASH, BRIGHT, OVER and INVERSE set attributes for outputting text and graphics to the screen. They can be used either as commands, to apply to all subsequent output until set again, or within a PRINT statement, to apply only from that point until the end of the statement.
Vickers 1983, p. 112. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 57. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 13. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 101. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 144. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 15. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 151. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 67. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 16. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 142–143. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 142. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 151. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 147. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
CAT, ERASE, FORMAT and MOVE were originally designed to be used with peripherals, but at the launch of ZX Spectrum, they had not been completely implemented, such that their use generated an error message (Invalid Stream). Later with the aid of the ZX Interface 1 shadow ROM, they were used for the ZX Microdrive. (The shadow ROM was paged when the BASIC interpreter detected a syntax error, which is why most ZX Microdrive commands use a "*"). /wiki/ZX_Microdrive
Cambridge Communication 1983, p. 39. - Cambridge Communication (1983). Sinclair ZX Spectrum Microdrive and Interface 1 manual. Sinclair Research.
Vickers 1983, p. 16. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 31–32. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
“False” in Sinclair BASIC equates to 0 (zero), everything else equates to “true”. Functions that return true-or-false values thus actually return 0 for false and 1 for true, while AND usually returns the first of the conditions supplied for true, or 1 if no numerical values were given. For example, 6 AND 7 returns 6, while NOT 6=7 returns 1.
Vickers 1983, p. 85. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
CAT, ERASE, FORMAT and MOVE were originally designed to be used with peripherals, but at the launch of ZX Spectrum, they had not been completely implemented, such that their use generated an error message (Invalid Stream). Later with the aid of the ZX Interface 1 shadow ROM, they were used for the ZX Microdrive. (The shadow ROM was paged when the BASIC interpreter detected a syntax error, which is why most ZX Microdrive commands use a "*"). /wiki/ZX_Microdrive
Cambridge Communication 1983, p. 22. - Cambridge Communication (1983). Sinclair ZX Spectrum Microdrive and Interface 1 manual. Sinclair Research.
“False” in Sinclair BASIC equates to 0 (zero), everything else equates to “true”. Functions that return true-or-false values thus actually return 0 for false and 1 for true, while AND usually returns the first of the conditions supplied for true, or 1 if no numerical values were given. For example, 6 AND 7 returns 6, while NOT 6=7 returns 1.
Vickers 1983, p. 85. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 159. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
INK, PAPER, FLASH, BRIGHT, OVER and INVERSE set attributes for outputting text and graphics to the screen. They can be used either as commands, to apply to all subsequent output until set again, or within a PRINT statement, to apply only from that point until the end of the statement.
Vickers 1983, p. 112. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
The available numbers for colours are:
12345670blueredmagentagreencyanyellowwhiteblack
In all colour-related commands, the number 8 may be used to indicate “transparent” while in INK and PAPER may also be set to 9 for “contrast” — that is, to put a dark colour on a light background or vice versa automatically.
INK, PAPER, FLASH, BRIGHT, OVER and INVERSE set attributes for outputting text and graphics to the screen. They can be used either as commands, to apply to all subsequent output until set again, or within a PRINT statement, to apply only from that point until the end of the statement.
Vickers 1983, p. 110. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 129. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 130. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 67. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 121. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 123. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 163. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 13. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 101. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 74. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 41. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 16. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 42. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 37. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 73. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 14. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 142. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 101. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
The Spectrum’s display memory starts at address 16384 and is 6912 bytes long
Vickers 1983, p. 143. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 59. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 68. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 32. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 14. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 60. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 103. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 69. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Unlike many other BASIC dialects, Sinclair Basic did not include the ELSE operator in the IF–THEN[–ELSE] clause. A workaround would be to use an IF–THEN–GO TO construct instead, bypassing the lines that would have been in an ELSE clause with the GO TO
Vickers 1983, p. 25. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 32, 51. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 93. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 180. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
A string inside a string must have its quotes doubled in Sinclair BASIC
Vickers 1983, p. 59. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
Vickers 1983, p. 141. - Vickers, Steven (1983). Sinclair ZX Spectrum BASIC Programming (2 ed.). Sinclair Research.
"Sinclair ZX80 User Manual 4K Basic for ZX80". https://www.petervis.com/Sinclair/Sinclair_ZX80_Manual/4k-basic.html
"ZX80 – 8K BASIC ROM Upgrade". www.fruitcake.plus.com. http://www.fruitcake.plus.com/Sinclair/ZX80/ROMUpgrade/ZX80_ROMUpgrade.htm
"World of Spectrum - Documentation - ZX Spectrum +3 - Chapter 7". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128+3Manual/chapter7.html
"World of Spectrum - Documentation - ZX Spectrum 128 Manual Page 6". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128Manual/sp128p06.html
"World of Spectrum - Documentation - ZX Spectrum +3 - Chapter 7". worldofspectrum.org. https://worldofspectrum.org/ZXSpectrum128+3Manual/chapter7.html
"Timex tech info – Basic 64 for TC2048". timex.comboios.info. http://timex.comboios.info/tmxtechb64-2048.html
"Microsete N.º46, Maio 1987" (PDF). loadzx.com. https://loadzx.com/wp-content/uploads/simple-file-list/LITERATURA/JORNAIS/Microsete/Microsete-n46.pdf
"Timex Computer 3256, Timex Portugal". k1.spdns.de. https://k1.spdns.de/Vintage/Sinclair/82/Timex%20Computer%203256%20(unreleased)/
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"Beta Basic at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/7956/ZX-Spectrum/Beta_Basic
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"YS MegaBasic at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/8997/ZX-Spectrum/YS_MegaBasic
"Zebra OS64 at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/4000090/Timex/Zebra_OS64
"Sinclair BASIC history - Sinclair Wiki". sinclair.wiki.zxnet.co.uk. https://sinclair.wiki.zxnet.co.uk/wiki/Sinclair_BASIC_history
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"The Incomplete Spectrum ROM Assembly". Archived from the original on 1 September 2015. https://web.archive.org/web/20150901085346/http://www.wearmouth.demon.co.uk
"ULAplus". sites.google.com. Archived from the original on 25 May 2013. Retrieved 21 March 2016. https://web.archive.org/web/20130525190223/https://sites.google.com/site/ulaplus/
"ZX Interface 2 - SE BASIC (3rd Party ROM Cartridge)". www.fruitcake.plus.com. Archived from the original on 25 March 2015. Retrieved 23 March 2016. https://web.archive.org/web/20150325030638/http://www.fruitcake.plus.com/Sinclair/Interface2/Cartridges/Interface2_RC_New_3rdParty_SEBASIC.htm
"OpenSE BASIC". SourceForge. 16 April 2013. https://sourceforge.net/projects/sebasic/
"OpenSE BASIC at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/27510/ZX-Spectrum/OpenSE_BASIC
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"World of Spectrum - HiSoft COLT Compiler". World of Spectrum. https://worldofspectrum.org/software
"HiSoft COLT Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/8254/ZX-Spectrum/HiSoft_COLT_Compiler
"World of Spectrum - HiSoft BASIC". World of Spectrum. https://worldofspectrum.org/software
"HiSoft BASIC at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/8249/ZX-Spectrum/HiSoft_BASIC
"World of Spectrum - Laser Compiler". World of Spectrum. https://worldofspectrum.org/software
"Laser Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/8329/ZX-Spectrum/Laser_Compiler
"World of Spectrum - Softek 'IS' BASIC Compiler". World of Spectrum. https://worldofspectrum.org/software
"Integer Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/8282/ZX-Spectrum/Integer_Compiler
"World of Spectrum - Integer Compiler". World of Spectrum. https://worldofspectrum.org/software
"World of Spectrum - Softek 'FP' Full Compiler". World of Spectrum. https://worldofspectrum.org/software
"Softek 'FP' Full Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/8693/ZX-Spectrum/Softek_FP_Full_Compiler
"World of Spectrum - ZIP Compiler". World of Spectrum. https://worldofspectrum.org/software
"ZIP Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware". Spectrum Computing. Retrieved 13 December 2022. https://spectrumcomputing.co.uk/entry/9452/ZX-Spectrum/ZIP_Compiler
Berry, Stephen (1984). "QL Keywords". Archived from the original on 22 February 2017. Retrieved 27 June 2023. https://web.archive.org/web/20170222113142/http://www.dilwyn.me.uk/docs/ebooks/olqlug/QL%20Manual%20-%20Keywords.htm
"Sam Coupe Scrapbook: Sam BASIC". www.mono.org. Retrieved 13 December 2022. https://www.mono.org/~unc/Coupe/Tech/basic.html
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"Sparky eZX BASIC Project". rk-internet.com. http://rk-internet.com/eZXSparky/
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"Philip Kendall - Basic". www.shadowmagic.org.uk. http://www.shadowmagic.org.uk/spectrum/basic.html
"Philip Kendall – CheckBasic". www.shadowmagic.org.uk. http://www.shadowmagic.org.uk/spectrum/checkbasic.html
"Binsic Is Not Sinclair Instruction Code". 25 June 2012. https://cartesianproduct.wordpress.com/binsic-is-not-sinclair-instruction-code/
"ZX Spin and BASin - ULAplus". sites.google.com. https://sites.google.com/site/ulaplus/home/zx-spin-and-basin
"Sinclair BASIC". World of Spectrum Classic. Retrieved 18 April 2025.
https://worldofspectrum.net/legacy-info/sinclair-basic/
"ZXDunny/SpecBAS". 5 June 2021 – via GitHub. https://github.com/ZXDunny/SpecBAS
"ZX-Basic: Backwardly compatible, but enhanced compiler of Sinclair BASIC programs". https://zxbasic.readthedocs.io/en/docs/about/
"ZX-Basicus: analyzer/synthesizer/optimizer/interpreter of Sinclair BASIC programs for the ZX Spectrum 48K". jafma.net. https://jafma.net/software/zxbasicus/