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
Sinclair BASIC
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!
{{Use dmy dates|date=June 2023}} {{Use British English|date=November 2018}} {{Short description|Dialect of the programming language BASIC}} {{For|the implementation of BASIC used on the Sinclair QL|SuperBASIC}} {{Infobox programming language | logo = | logo caption = | screenshot = | screenshot caption = | file ext = | paradigm = [[Imperative programming|Imperative]] | released = {{Start date and age|1980}} | designer = John Grant, [[Steve Vickers (computer scientist)|Steve Vickers]] | developer = Nine Tiles Networks,<br />[[Sinclair Research]] | latest release version = | latest release date = | latest preview version = | latest preview date = | typing = | implementations = | dialects = | influenced by = | influenced = | programming language = | platform = [[ZX80]], [[ZX81]], [[ZX Spectrum|ZX Spectrum, +, 128, +2, +3]], [[Timex Sinclair 2068|T/S 2068]], [[Timex Computer 3256|TC 3256]] | operating system = | license = [[Proprietary software|Proprietary]] | website = | wikibooks = }} '''Sinclair BASIC''' is a [[dialect (computing)|dialect]] of the programming language [[BASIC]] used in the [[8-bit computing|8-bit]] [[home computer]]s from [[Sinclair Research]], [[Timex Sinclair]] and [[Amstrad]]. The Sinclair BASIC [[interpreter (computing)|interpreter]] was written by Nine Tiles Networks Ltd.<ref name="Garfield"/> Designed to run in only 1 KB of [[dynamic random-access memory|RAM]], the system makes a number of decisions to lower memory usage. This led to one of Sinclair BASIC's most notable features, that the keywords were entered using single keystrokes; each of the possible keywords was mapped to a key on the keyboard, when pressed, the token would be placed into memory while the entire keyword was printed out on-screen. This made code entry easier whilst simplifying the [[Parsing|parser]]. The original [[ZX80]] version supported only [[integer]] mathematics, which partially made up for some of the memory-saving design notes which had negative impact on performance. When the system was ported to the [[ZX81]] in 1981, a full [[floating-point arithmetic|floating point]] implementation was added. This version was very slow, among the slowest BASICs on the market at the time, but given the limited capabilities of the machine, this was not a serious concern. The low speed was not mainly due to an inefficient interpreter though, it was an effect of the fact that 70-80% of the machine cycles were consumed by the video hardware. So the Z80 in the ZX81 clocked at 3.25 MHz was "in effect" running at well below 1 MHz from the perspective of the BASIC system. Performance became a more serious issue with the release of the [[ZX Spectrum]] in 1982, which ran too slowly to make full use of the machine's new features. This led to an entirely new BASIC for the following [[Sinclair QL]], as well as a number of 3rd-party BASICs for the Spectrum and its various clones. The original version continued to be modified and ported in the post-Sinclair era. ==History== [[Clive Sinclair]] initially met with John Grant, the owner of Nine Tiles, in April 1979 to discuss a BASIC for Sinclair's new computer concept.{{sfn|Adamson|Kennedy|p=63}} Sinclair was inspired to make a new machine after watching his son enjoy their [[TRS-80]], but that machine's £500 price tag appeared to be a serious limit on its popularity. He wanted a new kit that would expand on their previous [[MK14]] and feature a built-in BASIC at the target price of £79.95. To meet this price point, the machine would ship with only 1 KB of RAM and 4 KB of ROM. Grant suggested using the [[Forth (programming language)|Forth]] language instead, but the budget precluded this. Grant wrote the BASIC interpreter between June and July 1979, but the code initially came in at 5 KB and he spent the next month trimming it down. It was initially an incomplete implementation of the 1978 [[American National Standards Institute]] (ANSI) [[Minimal BASIC]] standard with integer arithmetic only, termed '''4K BASIC'''.{{sfn|Adamson|Kennedy|1986|p=64}} 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 (computer scientist)|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 [[trigonometry|trig]] functions, which were expected of any BASIC from that era, producing '''8K BASIC'''.{{sfn|Adamson|Kennedy|1986|p=70}} 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.<ref name=8Kupgrade>{{Cite web|url=http://www.fruitcake.plus.com/Sinclair/ZX80/ROMUpgrade/ZX80_ROMUpgrade.htm|title=ZX80 – 8K BASIC ROM Upgrade|website=www.fruitcake.plus.com}}</ref> When Sinclair lost the contest to build the [[BBC Computer]], he moved ahead with plans to produce a low-cost colour-capable machine that emerged as the [[ZX Spectrum]] of April 1982. ROM space would once again be increased, this time to 16 KB. In keeping with his philosophy of making systems for the lowest possible expenditure, Sinclair wanted the absolute minimum changes to the existing 8K BASIC. Although Nine Tiles felt that something much better would be needed for the new machine, the schedule would not allow it, and yet another expansion of the original code was produced. Due to the RAM also being increased, to 48 KB, this version was known as 48K BASIC and eventually '''48 BASIC''' with the introduction of the ZX Spectrum 128 at which time the 16 KB Spectrum was no longer sold and most existing ones in use had been upgraded to 48 KB.<ref name="worldofspectrum.org" /><ref name=":0" /> The new version was available near the end of 1981, but it was "depressingly slow" and "snail like". Additionally, as no prototypes were available until the end of the year, it lacked support for the new line of peripherals Sinclair was planning.<ref name=reg>{{cite magazine |first=Tony |last=Smith |title=Happy 30th Birthday, Sinclair ZX Spectrum |date=23 April 2012 |magazine=The Register |url=https://www.theregister.com/2012/04/23/retro_week_sinclair_zx_spectrum_at_30?page=2}}</ref> 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.{{sfn|Adamson|Kennedy|1986|p=88}} 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. In 1983, as part of introducing the Spectrum to the US market as the TS2068, [[Timex Sinclair|Timex]] modified it as '''T/S 2000 BASIC'''. The new version was incapable of running many Spectrum programs due to the memory location of machine's functions moving. A similar, but somewhat more compatible version, was introduced as part of the Spanish Spectrum 128 of 1985, '''128 BASIC'''.<ref name=":0" /> 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 [[List of ZX Spectrum clones|clones]] of the Spectrum were introduced. These included '''+3 BASIC''', '''BASIC64''' and '''Timex Extended Basic'''.<ref name=":0" /><ref name="worldofspectrum.org" /> As of 2015, interpreters exist for modern [[operating system]]s,<ref>{{Citation |last=Dunn |first=Paul |title=SpecBAS |date=2022-12-07 |url=https://github.com/ZXDunny/SpecBAS |access-date=2022-12-12}}</ref> and older systems,<ref>{{Cite web |title=CSDb |url=https://csdb.dk/search/?seinsel=releases&search=spectrum+emulator&all=1 |access-date=2022-12-12 |website=Commodore 64 Scene Database}}</ref> that allow Sinclair Basic to be used easily. ==Description== ===Program editing=== Like most home-computer BASICs, Sinclair BASIC is anchored around its [[line editor]]. When the machine is booted, it runs BASIC and displays an [[inverse video]] "K" at the bottom of the screen to indicate the entry point. When a line is entered and the {{keypress|NEW LINE}} key is pressed, it either runs immediately if it does not have a [[line number]] prefix, or clears the screen and performs the equivalent of a {{code|LIST}} command, placing a ">" cursor after the line number in the most recently entered line. 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 {{key press|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 key]]s and commits their changes by pressing {{key press|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 {{key press|P}} key on the keyboard would cause the entire keyword {{code|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 {{key press|P}} again at this point would enter a single letter "P". Keys generally had two separate keywords assigned to them{{snd}} one above it and one below. Pressing the key in "K" mode would enter the keyword above the key, like {{code|PRINT}} for {{key|P}}. If the system was in "L" mode, one could return to "K" by pressing the [[shift key]]{{snd}} the systems did not initially support [[lowercase]] text, so the shift was not otherwise needed. The keywords below the keys required a second keystroke, {{key press|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 {{code|<>}}. 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 {{code|BEEP}} required one to type {{keypress|CAPS SHIFT|SYMBOL SHIFT}} to access extended mode (later models include a separate {{keypress|EXTENDED MODE}} key), keeping {{keypress|SYMBOL SHIFT}} held down, and then and pressing {{keypress|Z}}. To improve the complex entry on the Spectrum, the keywords were colour-coded to indicate the required mode:{{sfn|Vickers|1983|p=7–8}} * {{font color|white|gray|White}}: key only * {{font color|red|gray|Red}} on the key itself: {{keypress|SYMBOL SHIFT}} plus the key * {{font color|green|black|Green}} above the key: {{keypress|EXTENDED MODE}} followed by the key * {{font color|red|black|Red}} below the key: {{keypress|EXTENDED MODE}} followed by {{keypress|SYMBOL SHIFT}} plus the key 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. The resulting in-memory storage of the program was otherwise similar to [[Microsoft BASIC]], in that only the keywords are presented as tokens, while non-keywords{{snd}} like string and numeric constants and variable names{{snd}} are left in their original typed-in format. However, that typed-in format was not [[ASCII]], but an internal character code that contains both printable characters and the keyword tokens. Although portions of the table, the capital letters A to Z, for instance, are in the same order as in ASCII, their characters correspond to different numeric values, i.e. their [[code point]]s' offset from zero is different from ASCII's offset of 65. Other characters, like punctuation, may have been moved about even more. The [[ZX Spectrum character set]] is the most prominent example of such a character code. Related computers running Sinclair BASIC used similar variants, e.g. the [[ZX80 character set|ZX80]] or [[ZX81 character set]]s. All of these different but related character sets included Sinclair BASIC tokens. ===Data types=== 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 (data structure)|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, <code>A</code>, <code>A$</code>, <code>A()</code> and <code>A$()</code> 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 <syntaxhighlight lang="basic" inline>LET Number Of Apples = 5</syntaxhighlight> is the same as <syntaxhighlight lang="basic" inline>LET numberofapples = 5</syntaxhighlight> 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. ===Keyword details=== The ZX81 '''8K BASIC''' used the shorter forms <code>GOTO</code>, <code>GOSUB</code>, <code>CONT</code> and <code>RAND</code>, whereas the Spectrum '''48 BASIC''' used the longer forms <code>GO TO</code>, <code>GO SUB</code>, <code>CONTINUE</code> and <code>RANDOMIZE</code>. The ZX80 '''4K BASIC''' also used these longer forms but differed by using the spelling <code>RANDOMISE</code>. The ZX81 '''8K BASIC''' was the only version to use <code>FAST</code>, <code>SCROLL</code>, <code>SLOW</code> and <code>UNPLOT</code>. The ZX80 '''4K BASIC''' had the exclusive function <code>TL$()</code>; it was equivalent to the string operator {{nowrap|<code>(2 TO )</code>}} in later versions. Unique code points are assigned in the [[ZX80 character set]], [[ZX81 character set]] and [[ZX Spectrum character set]] for each keyword or multi-character operator, i.e. <code><=</code>, <code> >=</code>, <code><></code>, <code>""</code> (tokenized on the ZX81 only), <code>**</code> (replaced with <code>↑</code> on the Spectrum). These are expanded by referencing a token table in ROM. Thus, a keyword uses one byte of memory only, a significant saving over traditional letter-by-letter storage. This also meant that the [[BASIC interpreter]] could quickly determine any command or function by evaluating one byte, and that the keywords need not be ''reserved words'' like in other BASIC dialects or other programming languages, e.g., it is allowed to define a variable named <code>PRINT</code> and output its value with <code>PRINT PRINT</code>. This is also related to the syntax requirement that every line start with a command keyword, and pressing the one keypress for that command at the start of a line changes the editor from command mode to letter mode. Thus, variable assignment requires <syntaxhighlight lang="basic" inline>LET</syntaxhighlight> (i.e., <syntaxhighlight lang="basic" inline>LET A=1</syntaxhighlight> not only <syntaxhighlight lang="basic" inline>A=1</syntaxhighlight>). This practice is also different from other BASIC dialects. Further, it meant that unlike other BASIC dialects, the interpreter needed no parentheses to identify functions; <code>SIN x</code> was sufficient, no <code>SIN(x)</code> needed (though the latter was allowed). The 4K BASIC ROM of the ZX80 had a short list of exceptions to this: the functions <code>CHR$()</code>, <code>STR$()</code>, <code>TL$()</code>, <code>PEEK()</code>, <code>CODE()</code>, <code>RND()</code>, <code>USR()</code> and <code>ABS()</code> did not have one-byte tokens but were typed in letter-by-letter and required the parentheses. They were listed as the INTEGRAL FUNCTIONS on a label above and to the right of the keyboard.<ref>{{Cite web|url=https://upload.wikimedia.org/wikipedia/commons/5/54/Sinclair_ZX80_%281980%29_-_Computer_History_Museum.jpg|title=Picture of ZX80}}</ref> '''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: * <code>PLAY</code>, which operated the 128k models' [[General Instrument AY-3-8910]] music chip * <code>SPECTRUM</code>, which switched the 128k Spectrum into a 48k Spectrum compatibility mode The original Spanish ZX Spectrum 128 included four additional BASIC editor commands in Spanish,<ref name="Disassembly"/><ref>{{Cite book |last=Sinclair |url=http://archive.org/details/128_20220808_202208 |title=ZX Spectrum 128 Introducción y Guía de Funcionamiento |publisher=Sinclair Research Ltd and Investronica, S. A. |year=1985 |pages=9}}</ref> one of which was undocumented: * <code>EDITAR</code> (to edit a line number or invoke the full screen string editor) * <code>NUMERO</code> (to renumber the program lines) * <code>BORRAR</code> (to delete program lines) * <code>ANCHO</code> (to set the column width of the [[RS-232]] device, but undocumented as the code was broken) Unlike the <code>LEFT$()</code>, <code>MID$()</code> and <code>RIGHT$()</code> functions used in the ubiquitous Microsoft BASIC dialects for home computers, parts of strings in Sinclair BASIC are accessed by numeric range. For example, {{nowrap|<code>A$(5 TO 10)</code>}} gives a substring starting with the 5th and ending with the 10th character of the variable <code>a$</code>. Thus, it is possible to replace the <code>LEFT$()</code> and <code>RIGHT$()</code> commands by simply omitting the left or right array position respectively; for example {{nowrap|<code>a$( TO 5)</code>}} is equivalent to <code>LEFT$(A$,5)</code>. Further, <code>a$(5)</code> alone is enough to replace <code>MID$(A$,5,1)</code>. ==Syntax== ===Keywords=== 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): {| class="wikitable sortable" ! scope="col"|Keyword ! scope="col"|Parameters<ref group="note">Optional parameters are enclosed in [square brackets]</ref> ! scope="col"|Entered using<ref group="note">These assume the computer is in {{font color|white|black| 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 {{keypress|CAPS SHIFT}} and {{keypress|SYMBOL SHIFT}} simultaneously rather than the {{keypress|EXTENDED MODE}} key that is present on the Spectrum+ and later models.</ref> ! scope="col"|Type ! scope="col"|Summary |- |<code>ABS</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|G}} |Function |Returns the [[absolute value]] of <code>number</code>{{sfn|Vickers|1983|p=59}} |- |<code>ACS</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|W}} |Function |Returns the [[Inverse trigonometric functions|arccosine]] of <code>number</code>{{sfn|Vickers|1983|p=70}} |- |<code>AND</code> | ||{{keypress|SYMBOL SHIFT|Y}} |[[Bitwise operation|Logical operator]] |Returns true if both conditions on either side of the <code>AND</code> keyword are true, else returns false<ref group="note" name="logical"/>{{sfn|Vickers|1983|p=85}} |- |<code>ASN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|Q}} |Function |Returns the [[inverse trigonometric functions|arcsine]] of <code>number</code>{{sfn|Vickers|1983|p=69–70}} |- |<code>AT</code> |<code>line, column;</code> |{{keypress|SYMBOL SHIFT|I}} |Other |Used in a <code>PRINT</code> statement to print at the line and column specified;{{sfn|Vickers|1983|p=101}} for example, <code>PRINT AT 5,10;"*"</code> puts a star in column 10 of line 5. |- |<code>ATN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|E}} |Function |Returns the [[inverse trigonometric functions|arctangent]] of <code>number</code>{{sfn|Vickers|1983|p=70}} |- |<code>ATTR</code> |<code>(line, column)</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|L}} |Function |Returns a [[byte]] containing information on the colours of the text cell on the screen, corresponding to the specified <code>line</code> and <code>column</code>; note that, unlike most Sinclair BASIC keywords, the parentheses are required; the first three bits indicate the ink (foreground) colour, the fourth, fifth and sixth bits the paper (background) colour, the seventh bit whether the colours are bright or not, and the eight, whether they are flashing{{sfn|Vickers|1983|p=116}} |- |<code>BEEP</code> |<code>duration, pitch</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|Z}} |Command |Produces sound from the computer's speaker; <code>duration</code> is in seconds, pitch is in [[semitone]]s above (positive value) or below (negative value) [[middle C]]{{sfn|Vickers|1983|p=135}} |- |<code>BIN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|B}} |Other |Indicates <code>number</code> is in [[Binary number|binary notation]]{{sfn|Vickers|1983|p=93}} |- |<code>BORDER</code> |<code>number</code> |{{keypress|B}} |Command |Sets the border of the screen to the colour specified by the <code>number</code><ref group="note" name="colournumbers"/>{{sfn|Vickers|1983|p=113}} |- |<code>BRIGHT</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|B}} |Command/other |Makes all following colours brighter if <code>number</code> is 1, or its normal shade if 0<ref group="note" name="colours"/>{{sfn|Vickers|1983|p=110–111}} |- |<code>CAT</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|9}} |Command |Displays contents of [[ZX Microdrive]] specified by <code>number</code><ref group="note" name="microdrivecommands"/>{{sfn|Cambridge Communication|1983|p=15}} |- |<code>CHR$</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|U}} |Function |Returns the character corresponding to the decimal <code>number</code> in the computer's [[ZX Spectrum character set|character set]]{{sfn|Vickers|1983|p=91}} |- |<code>CIRCLE</code> |<code>x, y, r</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|H}} |Command |Draws a circle with its centre at coordinates (<code>x</code>,<code>y</code>) and radius <code>r</code>{{sfn|Vickers|1983|p=123}} |- |<code>CLEAR</code> |<code>address</code> |{{keypress|X}} |Command |Clears the screen,{{sfn|Vickers|1983|p=103}} all variables and the <code>GO SUB</code> stack,<ref>{{Cite web|url=https://worldofspectrum.org/ZXBasicManual/zxmanchap24.html|title=World of Spectrum - Documentation - ZX Spectrum manual - Chapter 24|website=worldofspectrum.org}}</ref> and optionally sets the maximum RAM address to be used by BASIC{{sfn|Vickers|1983|p=168}} |- |<code>CLOSE #</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|5}} |Command |Closes the specified stream number for access<ref group="note" name="microdrivecommands"/> |- |<code>CLS</code> | |{{keypress|V}} |Command |Clears all text and graphics from the screen{{sfn|Vickers|1983|p=103}} |- |<code>CODE</code> |<code>string</code> |{{keypress|EXTENDED MODE}} then {{keypress|I}} |Function/other |Returns the number corresponding to the first character in <code>string</code> in the computer's [[ZX Spectrum character set|character set]];{{sfn|Vickers|1983|p=91}} also used to save arbitrary chunks memory to tape, disk, etc. and load them back in – see <code>LOAD</code>, <code>SAVE</code> and <code>VERIFY</code> for details |- |<code>CONTINUE</code> | |{{keypress|C}} |Command |Restarts a program after it has stopped due to an error or the user pressing the {{keypress|CAPS SHIFT|SPACE}} or {{keypress|BREAK}} keys{{sfn|Vickers|1983|p=19}} |- |<code>COPY</code> | |{{keypress|Z}} |Command |Sends the currently displayed screen to the printer{{sfn|Vickers|1983|p=151}} |- |<code>COS</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|W}} |Function |Returns the [[trigonometric functions|cosine]] of <code>number</code>{{sfn|Vickers|1983|p=68}} |- |<code>DATA</code> |<code>comma-separated values</code> |{{keypress|EXTENDED MODE}} then {{keypress|D}} |Command/other |Provides numbers and/or strings to use with the <code>READ</code> command{{sfn|Vickers|1983|p=41}} and allows saving the contents of an array to tape when used with the <code>SAVE</code> command{{sfn|Vickers|1983|p=142}} (as <code>SAVE filename DATA array name()</code>) |- |<code>DEF FN</code> |<code>name(variable) = operation</code> |{{keypress|EXTENDED MODE}} then {{keypress|1}} |Command |Defines a custom function that can be used with the <code>FN</code> command;function definitions must be of the form <code>f(x)=operations</code>, for example <code>f(x)=x*2</code> and the function name may not consist of more than one letter, plus a $-symbol if the function returns a string{{sfn|Vickers|1983|p=60}} |- |<code>DIM</code> |<code>variable(dimensions)</code> |{{keypress|D}} |Command |Declares an array with the specified <code>dimensions</code>, which may be multi-dimensional (for example, <code>DIM a(10,10)</code>; if used with strings, the last dimension indicates the length of each of the strings (thus, <code>DIM A$(2,5)</code> is an array of two strings each of five characters long, and <code>DIM B$(5)</code> is one string of five characters){{sfn|Vickers|1983|p=79–81}} |- |<code>DRAW</code> |<code>x, y [, r]</code> |{{keypress|W}} |Command |Draws a line in the current <code>INK</code> colour to coordinates (<code>x</code>,<code>y</code>) from the coordinates used by the previous <code>PLOT</code> or <code>DRAW</code> command; if the optional <code>r</code> is supplied, it indicates the radius of the circle segment to be drawn, in [[radian]]s{{sfn|Vickers|1983|p=11–123}} |- |<code>ERASE</code> |<code>drive;"filename"</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|7}} |Command |Deletes the specified file from a [[ZX Microdrive]]<ref group="note" name="microdrivecommands"/>{{sfn|Cambridge Communication|1983|p=18}} |- |<code>EXP</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|X}} |Function |Returns [[E (mathematical constant)|''e'']] to the power <code>number</code>{{sfn|Vickers|1983|p=66}} |- |<code>FLASH</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|V}} |Command/other |Makes all following text alternate its foreground (<code>INK</code>) and background (<code>PAPER</code>) colours<ref group="note" name="colours"/> |- |<code>FN</code> |<code>function(value)</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|2}} |Function |Calls the <code>function</code> defined earlier in the program using <code>DEF FN</code>{{sfn|Vickers|1983|p=60}} |- |<code>FORMAT</code> |<code>drive;"name"</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|0}} |Command |Formats the cartridge in the indicated [[ZX Microdrive|Microdrive]] and assigns it the identifier <code>name</code><ref group="note" name="microdrivecommands"/>{{sfn|Cambridge Communication|1983|p=19}} |- |<code>FOR</code> |<code>variable = start TO end</code> |{{keypress|F}} |Command |Starts a <code>FOR</code>-<code>NEXT</code> loop;{{sfn|Vickers|1983|p=31}} the variable name may only be one character long{{sfn|Vickers|1983|p=32}} |- |<code>GO SUB</code> |<code>number</code> |{{keypress|H}} |Command |Makes the program jump to the BASIC line specified by <code>number</code>; when the program encounters the command <code>RETURN</code>, it will jump back to the statement after the <code>GO SUB</code>{{sfn|Vickers|1983|p=37}} |- |<code>GO TO</code> |<code>number</code> |{{keypress|G}} |Command |Makes the program jump to the BASIC line specified by <code>number</code> |- |<code>IF </code> |<code>condition THEN</code> |{{keypress|U}} |Command |Evaluates the <code>condition</code>, and if true, executes the statement that follows the keyword <code>THEN</code> that must come after the condition,{{sfn|Vickers|1983|p=25}} for example {{Code|1=IF A=1 THEN LET B=2|2=basic}}<ref group="note" name="if-else"/> |- |<code>IN</code> |<code>address</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|I}} |Function |Returns a [[byte]] read from the hardware [[memory-mapped I/O|input/output port]] corresponding to the <code>address</code>{{sfn|Vickers|1983|p=159}} |- |<code>INK</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|X}} |Command/other |Sets the foreground colour for text and graphics<ref group="note" name="colournumbers"/><ref group="note" name="colours"/>{{sfn|Vickers|1983|p=110}} |- |<code>INKEY$</code> |<code></code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|Z}} |Function |Returns a string representing the key being pressed on the keyboard at the moment the function is called, or an empty string if none is,{{sfn|Vickers|1983|p=131}} but does not wait for a keypress |- |<code>INPUT</code> |<code>[prompt,] variable</code> |{{keypress|I}} |Command |Halts program execution until the user types in something on the keyboard and presses the <code>Enter</code> key, then stores the entered value in the specified <code>variable</code>; if the optional <code>prompt</code> is supplied, this will be shown on the screen{{sfn|Vickers|1983|p=16}} |- |<code>INT</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|R}} |Function |Returns the [[integer]] value of <code>number</code>, rounding down to the nearest whole number{{sfn|Vickers|1983|p=59}} (thus, <code>INT -1.1</code> returns −2, not −1) |- |<code>INVERSE</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|M}} |Command/other |Reverses the colours on all following text if <code>number</code> is 1, so that it uses the current ink colour for the background and the current paper colour for the text, or sets them back to normal if <code>number</code> is 0<ref group="note" name="colours"/>{{sfn|Vickers|1983|p=112}} |- |<code>LEN</code> |<code>string</code> |{{keypress|EXTENDED MODE}} then {{keypress|K}} |Function |Returns the number of characters (bytes) in <code>string</code>{{sfn|Vickers|1983|p=57}} |- |<code>LET</code> |<code>variable=value</code> |{{keypress|L}} |Command |Assigns <code>value</code> to the named variable{{sfn|Vickers|1983|p=13}} |- |<code>LINE</code> |<code></code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|3}} |Other | * When used in an <code>INPUT</code> statement before a string variable, will not put quotation marks ("") around its prompt,{{sfn|Vickers|1983|p=101}} for example {{Code|INPUT "Name: "; LINE n$|basic}} * When used in a <code>SAVE</code> statement so that when the BASIC program being saved is loaded again, it starts automatically at the line number indicated{{sfn|Vickers|1983|p=144}} |- |<code>LIST</code> |<code>[number]</code> |{{keypress|K}} |Command |Outputs the current BASIC program to the screen; if the optional <code>number</code> is provided, it omits all lines with a lower number{{sfn|Vickers|1983|p=15}} |- |<code>LLIST</code> |<code>[number]</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|V}} |Command |As <code>LIST</code> except the listing is output to the printer{{sfn|Vickers|1983|p=151}} |- |<code>LN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|Z}} |Function |Returns the [[natural logarithm]] of <code>number</code>{{sfn|Vickers|1983|p=67}} |- |<code>LOAD</code> |<code>"[filename]" <nowiki>[CODE [address[, length]]| DATA variable()]</nowiki></code> |{{keypress|J}} |Command |Loads a program or data into RAM from tape, [[ZX Microdrive]], disk, etc., deleting any existing BASIC program and variables;{{sfn|Vickers|1983|p=16}} if an empty string (<code>""</code>) is provided, this loads the first program found, else it will search the tape for the program named in the string; if the optional <code>CODE</code> is provided, will load the program into memory at the address it had when it was saved, or at the specified <code>address</code> (<code>length</code> is intended as a safety, to try and load the right program in case there are multiple on the tape with the right name but of different lengths);{{sfn|Vickers|1983|p=142–143}} if the optional <code>DATA variable()</code> is provided, will load the data from the tape into the array named <code>variable()</code>{{sfn|Vickers|1983|p=142}} |- |<code>LPRINT</code> |<code>text</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|C}} |Command |As <code>PRINT</code> except output is sent to the printer{{sfn|Vickers|1983|p=151}} |- |<code>MERGE</code> |<code>"[filename]"</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|T}} |Command |As <code>LOAD</code>, except it does not delete the current program and variables; if a line number exists in both, that of the newly loaded program overwrites the existing one. Using <code>MERGE</code> prevents a program saved using <code>LINE</code> from auto-running once loaded{{sfn|Vickers|1983|p=147}} |- |<code>MOVE</code> |<code>stream1 TO stream2</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|6}} |Command |Moves data from one stream (keyboard, screen, file, printer, network, etc.) to another<ref group="note" name="microdrivecommands"/>{{sfn|Cambridge Communication|1983|p=39}} |- |<code>NEW</code> | |{{keypress|A}} |Command |Erases the current BASIC program and all variables{{sfn|Vickers|1983|p=16}} |- |<code>NEXT</code> |<code>variable</code> |{{keypress|N}} |Command |Closes a <code>FOR</code>-<code>NEXT</code> loop; the variable must match that of the corresponding <code>FOR</code> command{{sfn|Vickers|1983|p=31–32}} – "empty" <code>NEXT</code>s to refer to the immediately preceding <code>FOR</code> in the program are not allowed |- |<code>NOT</code> |<code>condition</code> ||{{keypress|SYMBOL SHIFT|S}} |[[Bitwise operation|Logical operator]] |Returns true if the <code>condition</code> is false, else returns false<ref group="note" name="logical"/>{{sfn|Vickers|1983|p=85}} |- |<code>OPEN #</code> |<code>stream</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|4}} |Command |Opens a stream for reading from and/or writing to<ref group="note" name="microdrivecommands"/>{{sfn|Cambridge Communication|1983|p=22}} |- |<code>OR</code> | ||{{keypress|SYMBOL SHIFT|Y}} |[[Bitwise operation|Logical operator]] |Returns true if either of the conditions on either side of the <code>OR</code> keyword are true, else returns false<ref group="note" name="logical"/>{{sfn|Vickers|1983|p=85}} |- |<code>OUT</code> |<code>address, value</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|O}} |Command |Sends the <code>value</code> (a [[byte]]) to the hardware [[memory-mapped I/O|input/output port]] corresponding to the <code>address</code>.{{sfn|Vickers|1983|p=159}} |- |<code>OVER</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|N}} |Command/other |Will make following text overprint with an XOR operation what is already on the screen if <code>number</code> is 1, instead of erasing it, or erase it if <code>number</code> is 0<ref group="note" name="colours"/>{{sfn|Vickers|1983|p=112}} |- |<code>PAPER</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|C}} |Command/other |Sets the background colour for text and graphics<ref group="note" name="colournumbers"/><ref group="note" name="colours"/>{{sfn|Vickers|1983|p=110}} |- |<code>PAUSE</code> |<code>delay</code> |{{keypress|M}} |Command |Halts program execution for the specified delay, in <math>\tfrac {1}{50}</math> of a second in Europe or <math>\tfrac {1}{60}</math> in North America{{sfn|Vickers|1983|p=129}} (thus, <code>PAUSE 50</code> halts for one second in Europe) |- |<code>PEEK</code> |<code>address</code> |{{keypress|EXTENDED MODE}} then {{keypress|O}} |Function |Returns a byte representing the contents of the memory location pointed to by <code>address</code>{{sfn|Vickers|1983|p=130}} |- |<code>PI</code> |<code></code> |{{keypress|EXTENDED MODE}} then {{keypress|M}} |Function |Returns the value of [[pi]]{{sfn|Vickers|1983|p=67}} |- |<code>PLOT</code> |<code>x, y</code> |{{keypress|Q}} |Command |Draws a pixel in the current <code>INK</code> colour on the screen at the coordinates (<code>x</code>,<code>y</code>){{sfn|Vickers|1983|p=121}} |- |<code>POINT</code> |<code>(x,y)</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|8}} |Function |Returns 1 if the pixel pointed at graphical coordinates (<code>x</code>,<code>y</code>) is currently in the ink (foreground) colour, else returns 0{{sfn|Vickers|1983|p=123}} |- |<code>POKE</code> |<code>address, value</code> |{{keypress|O}} |Command |Sets the contents of <code>address</code> in RAM to <code>value</code>{{sfn|Vickers|1983|p=163}} |- |<code>PRINT</code> |<code>[AT x,y;] text</code> |{{keypress|P}} |Command |Prints <code>text</code> (which must be one or more strings or numbers separated with semicolons) to the screen.{{sfn|Vickers|1983|p=13}} If used with #0 or #1, it prints in the bottom two (input) lines of the screen; if used with <code>AT</code>, it prints at the specified text coordinates; otherwise, it prints either immediately following the output of any previous <code>PRINT</code> statement (if the previous statement ended in a semicolon), or in the first column of the line below the previous <code>PRINT</code> output,{{sfn|Vickers|1983|p=101}} defaulting to 0,0. |- |<code>RANDOMIZE</code> |<code>[number]</code> |{{keypress|T}} |Command |Initializes the [[random number generator]]; if used without a <code>number</code> (or with 0), it does this based on the computer's internal clock, else it uses the <code>number</code> supplied, which must be in the range [1,65535]{{sfn|Vickers|1983|p=74}} |- |<code>READ</code> |<code>variable</code> |{{keypress|EXTENDED MODE}} then {{keypress|A}} |Command |Takes a value from a <code>DATA</code> statement and stores it in the named <code>variable</code>: the first time <code>READ</code> is used, it gets the first value after the first <code>DATA</code>, the second time it gets the next one, and so on{{sfn|Vickers|1983|p=41}} |- |<code>REM</code> |text |{{keypress|E}} |Command |Begins a comment in the source code, meaning that everything after the <code>REM</code> statement is ignored, until the end of the line{{sfn|Vickers|1983|p=16}} – note this includes everything after a colon, which normally begins a new segment: {{Code|10 REM Nothing to see here: PRINT "Unprintable"|basic}} will not produce any output, for example. |- |<code>RESTORE</code> |<code>[number]</code> |{{keypress|EXTENDED MODE}} then {{keypress|S}} |Command |Resets where <code>READ</code> commands look for values in <code>DATA</code> statements: if used without a number, the next <code>READ</code> will use the first <code>DATA</code> in the program, with a number it will use the first <code>DATA</code> on or after the line whose number is indicated{{sfn|Vickers|1983|p=42}} |- |<code>RETURN</code> | |{{keypress|Y}} |Command |Returns execution to the first statement following the last <code>GO SUB</code> command that was executed{{sfn|Vickers|1983|p=37}} |- |<code>RND</code> |<code></code> |{{keypress|EXTENDED MODE}} then {{keypress|T}} |Function |Returns a pseudo-random number with eight [[significant figure]]s in the range [0,1){{sfn|Vickers|1983|p=73}} |- |<code>RUN</code> |<code>[number]</code> |{{keypress|R}} |Command |Starts the current BASIC program, from its first line if no <code>number</code> is specified, else from the line with that number (or the first one after, if it does not exist){{sfn|Vickers|1983|p=14}} |- |<code>SAVE</code> |<code>"filename" [DATA variable() {{pipe}} LINE number]</code> |{{keypress|S}} |Command |Saves the current BASIC program to tape or other storage device, with the <code>filename</code> specified; if the optional <code>LINE</code> followed by a line number is used, then the program will start automatically at the indicated line number when it is <code>LOAD</code>ed back in; with the optional <code>DATA</code>, the command saves the contents of the array named by the variable instead of the current BASIC program{{sfn|Vickers|1983|p=142}} |- |<code>SCREEN$</code> |<code>[(line, column)]</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT}}+{{keypress|}} |Function/other |As a function, identifies the character at the specified line and column on the screen.{{sfn|Vickers|1983|p=101}} Used after the filename in a <code>LOAD</code> or <code>SAVE</code> command, indicates that the contents of the [[display memory]] should be loaded or saved; this essentially makes it a shortcut for <code>CODE 16384,6912</code><ref group=note>The Spectrum’s display memory starts at address 16384 and is 6912 bytes long.</ref> but does not work with <code>VERIFY</code> because the contents of the display memory will be different by the time that command reads back the saved data;{{sfn|Vickers|1983|p=143}} |- |<code>SGN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|F}} |Function |Returns 1 if <code>number</code> is positive, 0 if it is 0, and −1 if it is negative{{sfn|Vickers|1983|p=59}} |- |<code>SIN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|Q}} |Function |Returns the [[Trigonometric functions|sine]] of <code>number</code>{{sfn|Vickers|1983|p=68}} |- |<code>STEP</code> |<code>number</code> |{{keypress|SYMBOL SHIFT|D}} |Other |Indicates the interval used by a <code>FOR</code> statement,{{sfn|Vickers|1983|p=32}} for example {{Code|1=FOR n=2 TO 6 STEP 2|2=basic}} will skip <code>n=3</code> and <code>n=5</code> in the loop |- |<code>STOP</code> | |{{keypress|SYMBOL SHIFT|A}} |Command |Ends execution of the current program, exiting to the BASIC editor; can also be given when the computer is waiting for input using the <code>INPUT</code> command;{{sfn|Vickers|1983|p=14}} once the program is stopped, it can be resumed with <code>CONTINUE</code> |- |<code>SQR</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|H}} |Function |Returns the [[square root]] of <code>number</code>{{sfn|Vickers|1983|p=60}} |- |<code>STR$</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|Y}} |Function |Converts a number to string. |- |<code>TAB</code> |<code>column</code> |{{keypress|EXTENDED MODE}} then {{keypress|P}} |Other |In a <code>PRINT</code> statement, makes sure that the text to be output begins in the column specified, wrapping to the next line as necessary, but never more than one line{{sfn|Vickers|1983|p=103}} |- |<code>TAN</code> |<code>number</code> |{{keypress|EXTENDED MODE}} then {{keypress|E}} |Function |Returns the [[Trigonometric functions|tangent]] of <code>number</code>{{sfn|Vickers|1983|p=69}} |- |<code>THEN</code> |<code>statement</code> |{{keypress|SYMBOL SHIFT|G}} |Other |Follows the condition in an <code>IF</code> statement to indicate what should happen when the condition evaluates to true<ref group="note" name="if-else"/>{{sfn|Vickers|1983|p=25}} |- |<code>TO</code> |<code></code> |{{keypress|SYMBOL SHIFT|F}} |Other |Indicates a range from the number to the left of <code>TO</code> to the number of the right of it, inclusive;{{sfn|Vickers|1983|p=32, 51}} when used with <code>FOR</code> both numbers must be supplied, while if used to slice strings, either may be left off to indicate the start or end of the string |- |<code>USR</code> |<code>string or address</code> |{{keypress|EXTENDED MODE}} then {{keypress|L}} |Function |When called with a single-character string, this returns the memory address at which the [[glyph]] for the user-defined graphic character corresponding to that character is defined.{{sfn|Vickers|1983|p=93}} If called with an address, it starts [[machine code]] execution at that address (thus making it one of the few Sinclair BASIC functions to have a [[Side effect (computer science)|Side effect]]) and returns the contents of the [[Zilog Z80|Z80]]’s BC [[Processor register|register]] pair.{{sfn|Vickers|1983|p=180}} |- |<code>VAL</code> |<code>string</code> |{{keypress|EXTENDED MODE}} then {{keypress|J}} |Function |Evaluates the <code>string</code> as a number and returns the result;{{sfn|Vickers|1983|p=}} this can perform calculations: <code>VAL "1+2"</code> returns 3, for example, and also evaluates variables and even other <code>VAL</code> statements: {{Code|1=LET A=1: VAL "A+VAL ""2"""|2=basic}}<ref group="note">A string inside a string must have its quotes doubled in Sinclair BASIC.</ref> also returns 3 |- |<code>VAL$</code> |<code>string</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|J}} |Function |Similar to <code>VAL</code> but evaluates the string as a string{{sfn|Vickers|1983|p=59}} |- |<code>VERIFY</code> |<code>"[filename]"</code> |{{keypress|EXTENDED MODE}} then {{keypress|SYMBOL SHIFT|R}} |Command |Reads a program or data from tape or other storage, much like <code>LOAD</code>, but instead of loading it into memory, compares it with the program or data that is already in memory. This is intended to be used immediately after a <code>SAVE</code> command, to make sure the program or data has been saved without corruption.{{sfn|Vickers|1983|p=141}} |} {{multiple image | width = | direction = vertical | image1 = Sinclair ZX Spectrum.jpg | caption1 = ZX Spectrum | image2 = ZX Spectrum+.jpg | caption2 = ZX Spectrum+ }} ==Official versions== ===4K BASIC=== ''4K BASIC'' for ZX80<ref>{{Cite web|url=https://www.petervis.com/Sinclair/Sinclair_ZX80_Manual/4k-basic.html|title = Sinclair ZX80 User Manual 4K Basic for ZX80}}</ref> (so named for residing in 4 [[kibibyte|KiB]] [[read-only memory]] (ROM)), was developed by John Grant of Nine Tiles for the ZX80. It has integer-only arithmetic. * System Commands: <code>NEW</code> <code>RUN</code> <code>LIST</code> <code>LOAD</code> <code>SAVE</code> * Control Statements: <code>GOTO</code> <code>IF</code> <code>THEN</code> <code>GOSUB</code> <code>STOP</code> <code>RETURN</code> <code>FOR</code> <code>TO</code> <code>NEXT</code> <code>CONTINUE</code> * Input/Output Statements: <code>PRINT</code> <code>INPUT</code> * Assignment Statement: <code>LET</code> * Other Statements: <code>CLEAR</code> <code>CLS</code> <code>DIM</code> <code>REM</code> <code>RANDOMIZE</code> <code>POKE</code> * Functions: <code>ABS</code> <code>CHR$</code> <code>CODE</code><code>PEEK</code> <code>RND</code> <code>STR$</code> <code>TL$</code> <code>USR</code> ===8K BASIC=== ''8K BASIC'' is the ZX81 BASIC (also available as an upgrade for the ZX80<ref name="8Kupgrade" />), updated with floating-point arithmetic by [[Steve Vickers (computer scientist)|Steve Vickers]], so named for residing in 8 KiB ROM. * Statements: <code>PRINT</code> <code>RAND</code> <code>LET</code> <code>CLEAR</code> <code>RUN</code> <code>LIST</code> <code>GOTO</code> <code>CONT</code> <code>INPUT</code> <code>NEW</code> <code>REM</code> <code>PRINT</code> <code>STOP</code> <code>BREAK</code> <code>IF</code> <code>STOP</code> <code>FOR</code> <code>NEXT</code> <code>TO</code> <code>STEP</code> <code>SLOW</code> <code>FAST</code> <code>GOSUB</code> <code>RETURN</code> <code>SAVE</code> <code>LOAD</code> <code>CLS</code> <code>SCROLL</code> <code>PLOT</code> <code>UNPLOT</code> <code>PAUSE</code> <code>LPRINT</code> <code>LLIST</code> <code>COPY</code> <code>DIM</code> <code>POKE</code> <code>NEW</code> * Functions: <code>ABS</code> <code>SGN</code> <code>SIN</code> <code>COS</code> <code>TAN</code> <code>ASN</code> <code>ACS</code> <code>ATN</code> <code>LN</code> <code>EXP</code> <code>SQR</code> <code>INT</code> <code>PI</code> <code>RND</code> <code>FUNCTION</code> <code>LEN</code> <code>VALSTR$</code> <code>NOT</code> <code>CODE</code> <code>CHR$</code> <code>INKEY$</code> <code>AT</code> <code>TAB</code> <code>INKEY$</code> <code>PEEK</code> <code>USR</code> ===48 BASIC=== ''48 BASIC'' is the BASIC for the original 16/48 KB [[random-access memory|RAM]] ZX Spectrum (and clones), with colour and more peripherals added by Steve Vickers and John Grant. It resides in 16 KB ROM and began to be called 48 BASIC with the introduction of the ZX Spectrum 128 at which time the 16 KB Spectrum was no longer sold and most existing ones in use had been upgraded to 48 KB.<ref name="worldofspectrum.org">{{Cite web|url=https://worldofspectrum.org/ZXSpectrum128+3Manual/chapter7.html|title=World of Spectrum - Documentation - ZX Spectrum +3 - Chapter 7|website=worldofspectrum.org}}</ref> ===128 BASIC=== ''128 BASIC'' is the BASIC for the ZX Spectrum 128.<ref name=":0">{{Cite web|url=https://worldofspectrum.org/ZXSpectrum128Manual/sp128p06.html|title=World of Spectrum - Documentation - ZX Spectrum 128 Manual Page 6|website=worldofspectrum.org}}</ref> It offers extra commands and uses letter-by-letter input. * New commands: <code>LOAD !</code> <code>SAVE !</code> <code>MERGE !</code> <code>ERASE !</code> <code>PLAY</code> <code>SPECTRUM</code> ===+3 BASIC=== ''+3 BASIC'' is the BASIC with disk support for the ZX Spectrum +3 and +2A.<ref name="worldofspectrum.org" /> * New commands: <code>FORMAT</code> <code>COPY</code> ===T/S 2000 BASIC=== ''T/S 2000 BASIC'' is used on the Spectrum-compatible [[Timex Sinclair 2068]] (T/S 2068) and adds the following six new keywords: * <code>DELETE</code> deletes BASIC program line ranges.<!-- {{keypress|CAPS SHIFT|0}} with the <code>K</code> cursor produces the command <code>DELETE</code>.--> * <code>FREE</code> is a function that gives the amount of free RAM. <code>PRINT FREE</code> will show how much RAM is free. * <code>ON ERR</code> is an error-handling function mostly used as <code>ON ERR GO TO</code> or <code>ON ERR CONT</code>. * <code>RESET</code> can be used to reset the behaviour of <code>ON ERR</code>. It was also intended to reset peripherals. * <code>SOUND</code> controls the [[General Instrument AY-3-8910|AY-3-8192]] [[sound chip]]. * <code>STICK</code> is a function that gives the position of the internal joystick (Timex Sinclair 2090). ===BASIC64=== ''BASIC64'' by [[Timex of Portugal]], is a [[software extension]]<ref>{{Cite web|url=http://timex.comboios.info/tmxtechb64-2048.html|title=Timex tech info – Basic 64 for TC2048|website=timex.comboios.info}}</ref> to allow better Basic programming with the 512×192 and dual display areas graphic modes available only on [[Timex Sinclair]] computers. This extension adds commands and does a complete memory remap to avoid the system overwriting the extended screen memory area. Two versions exist due to different memory maps – a version for [[TC 2048]] and a version for T/S 2068 and [[TC 2068]]. * <code>PRINT #</code> prints to a specific output channel. * <code>LIST #</code> lists the program to a specific output channel. * <code>CLS*</code> clears both display areas. * <code>INK*</code> sets ink colour for both display areas * <code>PAPER*</code> sets paper colour both display areas * <code>SCREEN$</code> selects the high / normal resolution modes. * <code>PLOT*</code> plots a pixel and updates the drawing position. * <code>LINE</code> draws a line from the previous PLOT position, supporting arc drawing * <code>CIRCLE*</code> draws a circle or oval, depending on screen mode. ===Timex Extended Basic=== ''Timex Extended Basic'' by Timex of Portugal is used on the [[Timex Computer 3256]], adding ''TEC – Timex Extended Commands'' commands supporting the AY-3-8912 sound chip, RS-232 network and the 512x192 pixel high resolution graphic mode.<ref>{{Cite web|url=https://loadzx.com/wp-content/uploads/simple-file-list/LITERATURA/JORNAIS/Microsete/Microsete-n46.pdf|title=Microsete N.º46, Maio 1987|website=loadzx.com}}</ref><ref>{{Cite web|url=https://k1.spdns.de/Vintage/Sinclair/82/Timex%20Computer%203256%20(unreleased)/|title=Timex Computer 3256, Timex Portugal|website=k1.spdns.de}}</ref> * RAM drive commands: <code>LOAD!</code> <code>SAVE!</code> <code>CAT!</code> <code>MERGE!</code> <code>ERASE!</code> <code>CLEAR!</code> * RS-232 commands: <code>FORMAT!</code> <code>LPRINT</code> <code>LLIST</code> * AY-3-8912 commands: <code>BEEP!</code> * 512 x 192 resolution commands: <code>SCREEN$</code> <code>DRAW!</code> <code>PLOT!</code> <code>CIRCLE!</code> ==Other versions, extensions, derivatives and successors== ===Interpreters for the ZX Spectrum family=== Several ZX Spectrum interpreters exist.<ref name="SpectrumClassic">{{cite web |url=https://worldofspectrum.net/legacy-info/sinclair-basic/ |title=Sinclair BASIC |website=World of Spectrum Classic |access-date=2025-04-18}} </ref> * ''[[Beta BASIC]]'' by Dr. Andy Wright, was originally a [[BASIC extension]], but became a full interpreter.<ref>{{Cite web |title=Beta Basic at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/7956/ZX-Spectrum/Beta_Basic |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''[[YS MegaBasic]]'' by Mike Leaman.<ref name="SpectrumClassic"/><ref>{{Cite web |title=YS MegaBasic at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/8997/ZX-Spectrum/YS_MegaBasic |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''ZebraOS'' by Zebra Systems in New York, a [[ROM cartridge|cartridge]] version of T/S 2000 BASIC that used the 512×192 screen mode.<ref>{{Cite web |title=Zebra OS64 at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/4000090/Timex/Zebra_OS64 |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''[https://web.archive.org/web/20150901085346/http://www.wearmouth.demon.co.uk/ Sea Change ROM]'' by Steve Vickers and Ian Logan, modified by Geoff Wearmouth, a replacement ROM with an enhanced Sinclair BASIC.<ref>{{Cite web|url=https://sinclair.wiki.zxnet.co.uk/wiki/Sinclair_BASIC_history|title=Sinclair BASIC history - Sinclair Wiki|website=sinclair.wiki.zxnet.co.uk}}</ref> *''Gosh Wonderful'' by Geoff Wearmouth, a replacement ROM that fixes bugs and adds a tokenizer, stream lister, delete and renumber commands.<ref name="SpectrumClassic"/><ref>{{cite web|title=The Incomplete Spectrum ROM Assembly|url=http://www.wearmouth.demon.co.uk/ |archive-url=https://web.archive.org/web/20150901085346/http://www.wearmouth.demon.co.uk |archive-date=2015-09-01 |url-status=dead}}</ref> * ''OpenSE BASIC'' (formerly SE BASIC) by Andrew Owen, a replacement ROM with bug fixes and many enhancements including ULAplus<ref>{{Cite web|url=https://sites.google.com/site/ulaplus/|title=ULAplus|website=sites.google.com|access-date=21 March 2016|archive-date=25 May 2013|archive-url=https://web.archive.org/web/20130525190223/https://sites.google.com/site/ulaplus/|url-status=dead}}</ref> support, published as open source in 2011<ref>{{Cite web|url=http://www.fruitcake.plus.com/Sinclair/Interface2/Cartridges/Interface2_RC_New_3rdParty_SEBASIC.htm|title=ZX Interface 2 - SE BASIC (3rd Party ROM Cartridge)|website=www.fruitcake.plus.com|access-date=23 March 2016|archive-date=25 March 2015|archive-url=https://web.archive.org/web/20150325030638/http://www.fruitcake.plus.com/Sinclair/Interface2/Cartridges/Interface2_RC_New_3rdParty_SEBASIC.htm|url-status=dead}}</ref><ref>{{Cite web|url=https://sourceforge.net/projects/sebasic/|title=OpenSE BASIC|website=SourceForge|date=16 April 2013 }}</ref><ref>{{Cite web |title=OpenSE BASIC at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/27510/ZX-Spectrum/OpenSE_BASIC |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> ===Compilers for the ZX Spectrum family=== Several ZX Spectrum [[compiler]]s exist.<ref name="SpectrumClassic"/> * ''[[HiSoft Systems|HiSoft]] COLT Compiler'' (a.k.a. HiSoft COLT Integer Compiler)<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - HiSoft COLT Compiler|website=World of Spectrum}}</ref><ref>{{Cite web |title=HiSoft COLT Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/8254/ZX-Spectrum/HiSoft_COLT_Compiler |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''[[HiSoft Systems|HiSoft]] BASIC'' (a.k.a. HiSoft BASIC Compiler), an integer and floating-point capable compiler<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - HiSoft BASIC|website=World of Spectrum}}</ref><ref>{{Cite web |title=HiSoft BASIC at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/8249/ZX-Spectrum/HiSoft_BASIC |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''Laser Compiler''<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - Laser Compiler|website=World of Spectrum}}</ref><ref>{{Cite web |title=Laser Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/8329/ZX-Spectrum/Laser_Compiler |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''Softek 'IS' Integer Compiler''<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - Softek 'IS' BASIC Compiler|website=World of Spectrum}}</ref><ref>{{Cite web |title=Integer Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/8282/ZX-Spectrum/Integer_Compiler |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> (successor to Softek Integer Compiler<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - Integer Compiler|website=World of Spectrum}}</ref>) * ''Softek 'FP' Full Compiler''<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - Softek 'FP' Full Compiler|website=World of Spectrum}}</ref><ref>{{Cite web |title=Softek 'FP' Full Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/8693/ZX-Spectrum/Softek_FP_Full_Compiler |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> * ''ZIP Compiler''<ref>{{Cite web|url=https://worldofspectrum.org/software|title=World of Spectrum - ZIP Compiler|website=World of Spectrum}}</ref><ref>{{Cite web |title=ZIP Compiler at Spectrum Computing - Sinclair ZX Spectrum games, software and hardware |url=https://spectrumcomputing.co.uk/entry/9452/ZX-Spectrum/ZIP_Compiler |access-date=2022-12-13 |website=Spectrum Computing |language=en}}</ref> ===Derivatives and successors for other computers=== * ''[[SuperBASIC]]'', a much more advanced BASIC dialect introduced with the [[Sinclair QL]] personal computer, with some similarities to the earlier Sinclair BASICs<ref>{{cite web |last1=Berry |first1=Stephen |title=QL Keywords |url=http://www.dilwyn.me.uk/docs/ebooks/olqlug/QL%20Manual%20-%20Keywords.htm |access-date=27 June 2023 |archive-url=https://web.archive.org/web/20170222113142/http://www.dilwyn.me.uk/docs/ebooks/olqlug/QL%20Manual%20-%20Keywords.htm |archive-date=February 22, 2017 |language=en |url-status=usurped |date=1984 }}</ref> * ''SAM Basic'', the BASIC on the [[SAM Coupé]], generally considered a ZX Spectrum clone<ref>{{Cite web |title=Sam Coupe Scrapbook: Sam BASIC |url=https://www.mono.org/~unc/Coupe/Tech/basic.html |access-date=2022-12-13 |website=www.mono.org}}</ref> * ''ROMU6'' by Cesar and Juan Hernandez – [[MSX]]<ref name="SpectrumClassic"/> * ''Spectrum 48'' by Whitby Computers – [[Commodore 64]]<ref name="SpectrumClassic"/> * ''Sparky eSinclair BASIC'' by Richard Kelsh, an operating system loosely based on ZX Spectrum BASIC – [[Zilog eZ80]]<ref>{{Cite web|url=https://rk-internet.com/eZXSparky/|title=Sparky eZX BASIC Project|website=rk-internet.com}}</ref> * ''Sinbas'' by Pavel Napravnik – [[DOS]]<ref name="SpectrumClassic"/> * ''Basic''<ref>{{Cite web|url=http://www.shadowmagic.org.uk/spectrum/basic.html|title=Philip Kendall - Basic|website=www.shadowmagic.org.uk}}</ref> (and CheckBasic<ref>{{Cite web|url=http://www.shadowmagic.org.uk/spectrum/checkbasic.html|title=Philip Kendall – CheckBasic|website=www.shadowmagic.org.uk}}</ref>) by Philip Kendall – [[Unix]] * ''BINSIC''<ref name="BINSIC"/> by Adrian McMenamin, a reimplementation in [[Groovy (programming language)|Groovy]] closely modelled on ZX81 BASIC – [[Java (programming language)|Java]] * ''BASin''<ref>{{Cite web|url=https://sites.google.com/site/ulaplus/home/zx-spin-and-basin|title=ZX Spin and BASin - ULAplus|website=sites.google.com}}</ref> by Paul Dunn, a complete Sinclair BASIC [[integrated development environment]] (IDE) based on a ZX Spectrum emulator<ref name="SpectrumClassic"/> – Windows * ''SpecBAS''<ref>{{Cite web|url=https://github.com/ZXDunny/SpecBAS|title=ZXDunny/SpecBAS|date=June 5, 2021|via=GitHub}}</ref> (a.k.a. SpecOS) by Paul Dunn, an integrated development environment (IDE) providing an enhanced superset of Sinclair BASIC – [[Windows]], [[Linux]], [[Pandora (console)|Pandora]], and [[Raspberry Pi]] * ''ZX-Basic''<ref>{{Cite web|url=https://zxbasic.readthedocs.io/en/docs/about/|title=ZX-Basic: Backwardly compatible, but enhanced compiler of Sinclair BASIC programs}}</ref> – Backwardly compatible, but enhanced compiler of Sinclair BASIC programs the ZX Spectrum, written in [[Python (programming language)|Python]], freely available for Windows, Linux and [[Mac OS]] * ''ZX-Basicus''<ref>{{Cite web|url=https://jafma.net/software/zxbasicus/|title=ZX-Basicus: analyzer/synthesizer/optimizer/interpreter of Sinclair BASIC programs for the ZX Spectrum 48K|website=jafma.net}}</ref> by Juan-Antonio Fernández-Madrigal, a synthesizer, analyzer, [[optimizing compiler|optimizer]], interpreter and [[debugger]] of Sinclair BASIC 48K for PCs, freely downloadable for Linux and Windows. ==See also== * {{Section link|List of computer system emulators|Sinclair ZX80}} * {{Section link|List of computer system emulators|Sinclair ZX81}} * {{Section link|List of computer system emulators|Sinclair ZX Spectrum and clones}} ==Notes== {{reflist|30em|group="note"|refs= <ref group="note" name="logical">"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 <code>AND</code> usually returns the first of the conditions supplied for true, or 1 if no numerical values were given. For example, <code>6 AND 7</code> returns 6, while <code>NOT 6=7</code> returns 1.</ref> <ref group="note" name="microdrivecommands"><code>CAT</code>, <code>ERASE</code>, <code>FORMAT</code> and <code>MOVE</code> 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 <code>"*"</code>).</ref> <ref group="note" name="if-else">Unlike many other BASIC dialects, Sinclair Basic did not include the <code>ELSE</code> operator in the <code>IF</code>–<code>THEN</code>[–<code>ELSE</code>] clause. A workaround would be to use an <code>IF</code>–<code>THEN</code>–<code>GO TO</code> construct instead, bypassing the lines that would have been in an <code>ELSE</code> clause with the <code>GO TO</code></ref> <ref group="note" name="colournumbers">The available numbers for colours are: {| class="wikitable" | 1 || 2 || 3 || 4 || 5 || 6 || 7 || 0 |- | style="font-weight:bold;background-color:#000000;" | {{font color|blue|blue}} || style="font-weight:bold;background-color:#000000;" | {{font color|red|red}} || style="font-weight:bold;background-color:#000000;" | {{font color|magenta|magenta}} || style="font-weight:bold;background-color:#000000;" | {{font color|green|green}} || style="font-weight:bold;background-color:#000000;" | {{font color|cyan|cyan}} || style="font-weight:bold;background-color:#000000;" | {{font color|yellow|yellow}} || style="font-weight:bold;background-color:#000000;" | {{font color|white|white}} || style="font-weight:bold;background-color:#ffffff;" | {{font color|black|black}} |} In all colour-related commands, the number 8 may be used to indicate "transparent" while in <code>INK</code> and <code>PAPER</code> may also be set to 9 for "contrast" – that is, to put a dark colour on a light background or vice versa automatically.</ref> <ref group="note" name="colours"><code>INK</code>, <code>PAPER</code>, <code>FLASH</code>, <code>BRIGHT</code>, <code>OVER</code> and <code>INVERSE</code> 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 <code>PRINT</code> statement, to apply only from that point until the end of the statement.</ref> }} ==References== {{reflist|refs= <ref name="Garfield">{{ cite news | first = Simon | last = Garfield | title = Sir Clive Sinclair: "I don't use a computer at all" | date = 2010-02-28 | url = https://www.theguardian.com/technology/2010/feb/28/clive-sinclair-interview-simon-garfield | work = [[The Guardian]] | access-date = 2011-05-23 | quote = He is keen to credit [...], not least Nine Tiles, the company that made the Basic operating software.}}</ref> <ref name="Disassembly">{{Cite web|url=http://www.fruitcake.plus.com/Sinclair/Spectrum128/ROMDisassembly/Spectrum128ROMDisassembly3.htm|title=Spectrum 128 ROM Disassembly - Spanish Spectrum 128|website=www.fruitcake.plus.com}}</ref> <ref name="BINSIC">{{Cite web|url=https://cartesianproduct.wordpress.com/binsic-is-not-sinclair-instruction-code/|title=Binsic Is Not Sinclair Instruction Code|date=June 25, 2012}}</ref> }} ==Bibliography== * {{cite book |first1=Ian |last1=Adamson |first2=Richard |last2=Kennedy |publisher= Penguin |date=1986 |title=Sinclair and the 'sunrise' Technology |url=https://rk.nvg.ntnu.no/sinclair/computers/zx81/zx81_sst.htm}} * {{cite book | last = Ardley | first = Neil | title = Sinclair ZX Spectrum+ User Guide | publisher = [[Dorling Kindersley]] in association with Sinclair Research | year = 1984 | isbn = 0-86318-080-9 }} * {{cite book | last = Vickers | first = Steven | title = Sinclair ZX Spectrum BASIC Programming | publisher = Sinclair Research | year = 1982 }} * {{cite book | last = Vickers | first = Steven | title = Sinclair ZX Spectrum BASIC Programming | edition = 2 | publisher = Sinclair Research | year = 1983 }} * {{cite book | author = Cambridge Communication | title = Sinclair ZX Spectrum Microdrive and Interface 1 manual | publisher = Sinclair Research | year = 1983 }} ==External links== * [https://www.worldofspectrum.org/ZXBasicManual/ Sinclair ZX Spectrum BASIC Programming]: The original 1982 manual by Steven Vickers (referenced above) * [https://www.worldofspectrum.org/ZX81BasicProgramming/ Sinclair ZX81 Basic Programming] {{Webarchive|url=https://web.archive.org/web/20070422024127/http://www.worldofspectrum.org/ZX81BasicProgramming/ |date=2007-04-22 }}: also by Vickers * [https://scratchpad.wikia.com/wiki/Sinclair_BASIC_History The History of Sinclair BASIC]: By Andrew Owen * [https://loadzx.com/timexcomputerworld/tmxtechb64-2048.html Timex Computer World]: Basic 64 user manual for Timex Computer 2048 * [https://jafma.net/software/ll1grammar/index.htm Sinclair BASIC grammar]: A LL(1) grammar specification for parsing Sinclair BASIC 16/48K {{BASIC}} [[Category:ZX Spectrum]] [[Category:Sinclair Research]] [[Category:BASIC interpreters]] [[Category:Discontinued BASICs]] [[Category:BASIC programming language family]] [[Category:ZX80]] [[Category:ZX81]]
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)
Pages transcluded onto the current version of this page
(
help
)
:
Template:BASIC
(
edit
)
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite magazine
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Font color
(
edit
)
Template:For
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Key
(
edit
)
Template:Key press
(
edit
)
Template:Keypress
(
edit
)
Template:Multiple image
(
edit
)
Template:Nowrap
(
edit
)
Template:Pipe
(
edit
)
Template:Reflist
(
edit
)
Template:Section link
(
edit
)
Template:Sfn
(
edit
)
Template:Short description
(
edit
)
Template:Snd
(
edit
)
Template:Use British English
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Webarchive
(
edit
)