HOME

TheInfoList



OR:

Sinclair BASIC is a
dialect A dialect is a Variety (linguistics), variety of language spoken by a particular group of people. This may include dominant and standard language, standardized varieties as well as Vernacular language, vernacular, unwritten, or non-standardize ...
of the programming language
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
used in the
8-bit In computer architecture, 8-bit integers or other data units are those that are 8 bits wide (1 octet). Also, 8-bit central processing unit (CPU) and arithmetic logic unit (ALU) architectures are those that are based on registers or data bu ...
home computer Home computers were a class of microcomputers that entered the market in 1977 and became common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a s ...
s from
Sinclair Research Sinclair Research Ltd is a British consumer electronics company founded by Clive Sinclair in Cambridge in the 1970s. In 1980, the company entered the home computer market with the ZX80 at £99.95, at that time the cheapest personal computer ...
, Timex Sinclair and
Amstrad Amstrad plc was a British consumer electronics company, founded in 1968 by Alan Sugar. During the 1980s, the company was known for its Home computer, home computers beginning with the Amstrad CPC and later also the ZX Spectrum range after the ...
. The Sinclair BASIC interpreter was written by Nine Tiles Networks Ltd. Designed to run in only 1 KB of 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
parser Parsing, syntax analysis, or syntactic analysis is a process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar by breaking it into parts. The term '' ...
. The original
ZX80 The Sinclair ZX80 is a home computer launched on 29 January 1980 by Science of Cambridge Ltd. (later to be better known as Sinclair Research). It is notable for being one of the first computers available in the United Kingdom for less than a hu ...
version supported only
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
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 The ZX81 is a home computer that was produced by Sinclair Research and manufactured in Dundee, Scotland, by Timex Corporation. It was launched in the United Kingdom in March 1981 as the successor to Sinclair's ZX80 and designed to be a low-c ...
in 1981, a full
floating point In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a signed sequence of a fixed number of digits in some base) multiplied by an integer power of that base. Numbers of this form ...
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. Sinclair was inspired to make a new machine after watching his son enjoy their
TRS-80 The TRS-80 Micro Computer System (TRS-80, later renamed the Model I to distinguish it from successors) is a desktop microcomputer developed by American company Tandy Corporation and sold through their Radio Shack stores. Launched in 1977, it is ...
, 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 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 The American National Standards Institute (ANSI ) is a private nonprofit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organiz ...
(ANSI) Minimal BASIC standard with integer arithmetic only, termed 4K BASIC. 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 Ferranti International PLC or simply Ferranti was a UK-based electrical engineering and equipment firm that operated for over a century, from 1885 until its bankruptcy in 1993. At its peak, Ferranti was a significant player in power grid system ...
, 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 In mathematics, a square root of a number is a number such that y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
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. 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 The ZX Spectrum () is an 8-bit computing, 8-bit home computer developed and marketed by Sinclair Research. One of the most influential computers ever made and one of the all-time bestselling British computers, over five million units were sold. ...
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. 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. 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. In 1983, as part of introducing the Spectrum to the US market as the TS2068, 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. 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. As of 2015, interpreters exist for modern
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s, and older systems, that allow Sinclair Basic to be used easily.


Description


Program editing

Like most home-computer BASICs, Sinclair BASIC is anchored around its
line editor In computing, a line editor is a text editor in which each editing command applies to one or more complete lines of text designated by the user. Line editors predate screen-based text editors and originated in an era when a computer operator typic ...
. 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 key is pressed, it either runs immediately if it does not have a
line number In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increm ...
prefix, or clears the screen and performs the equivalent of a 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 , 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 again. In contrast, on machines like the
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit computing, 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in ...
or
Atari 8-bit computers The Atari 8-bit computers, formally launched as the Atari Home Computer System, are a series of home computers introduced by Atari, Inc., in 1979 with the Atari 400 and Atari 800. The architecture is designed around the 8-bit MOS Technology 650 ...
, 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 on the keyboard would cause the entire keyword 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 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 for . If the system was in "L" mode, one could return to "K" by pressing the
shift key The Shift key is a modifier key on a alphanumeric keyboard, keyboard, used to type majuscule, capital letters and other alternate "upper" characters. There are typically two Shift keys, on the left and right sides of the row below the home row. T ...
the systems did not initially support
lowercase Letter case is the distinction between the letters that are in larger uppercase or capitals (more formally ''majuscule'') and smaller lowercase (more formally '' minuscule'') in the written representation of certain languages. The writing system ...
text, so the shift was not otherwise needed. The keywords below the keys required a second keystroke, , 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 In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
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 required one to type to access extended mode (later models include a separate key), keeping held down, and then and pressing . To improve the complex entry on the Spectrum, the keywords were colour-coded to indicate the required mode: * : key only * on the key itself: plus the key * above the key: followed by the key * below the key: followed by 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 Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first v ...
, in that only the keywords are presented as tokens, while non-keywords like string and numeric constants and variable names are left in their original typed-in format. However, that typed-in format was not
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
, 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 A code point, codepoint or code position is a particular position in a Table (database), table, where the position has been assigned a meaning. The table may be one dimensional (a column), two dimensional (like cells in a spreadsheet), three dime ...
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 The Sinclair ZX80 is a home computer launched on 29 January 1980 by Science of Cambridge Ltd. (later to be better known as Sinclair Research). It is notable for being one of the first computers available in the United Kingdom for less than a hu ...
or ZX81 character sets. 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. 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.


Keyword details

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 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. <=, >=, <>, "" (tokenized on the ZX81 only), ** (replaced with 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 A BASIC interpreter is an Interpreter (computing), interpreter that enables users to enter and run programs in the BASIC programming language, language and was, for the first part of the microcomputer era, the default Application software, applica ...
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 PRINT and output its value with PRINT PRINT. 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 LET (i.e., LET A=1 not only A=1). 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; SIN x was sufficient, no SIN(x) needed (though the latter was allowed). The 4K BASIC ROM of the ZX80 had a short list of exceptions to this: the functions CHR$(), STR$(), TL$(), PEEK(), CODE(), RND(), USR() and ABS() 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. 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: * PLAY, which operated the 128k models'
General Instrument AY-3-8910 The AY-3-8910 is a 3-voice programmable sound generator (PSG) designed by General Instrument (GI) in 1978, initially for use with their 16-bit computing, 16-bit General Instrument CP1600, CP1610 or one of the PIC microcontrollers, PIC1650 ser ...
music chip * SPECTRUM, 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, one of which was undocumented: * EDITAR (to edit a line number or invoke the full screen string editor) * NUMERO (to renumber the program lines) * BORRAR (to delete program lines) * ANCHO (to set the column width of the
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
device, but undocumented as the code was broken) 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, 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 is equivalent to LEFT$(A$,5). Further, a$(5) alone is enough to replace MID$(A$,5,1).


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):


Official versions


4K BASIC

''4K BASIC'' for ZX80 (so named for residing in 4  KiB
read-only memory Read-only memory (ROM) is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device. Read-only memory is useful for storing sof ...
(ROM)), was developed by John Grant of Nine Tiles for the ZX80. It has integer-only arithmetic. * System Commands: NEW RUN LIST LOAD SAVE * Control Statements: GOTO IF THEN GOSUB STOP RETURN FOR TO NEXT CONTINUE * Input/Output Statements: PRINT INPUT * Assignment Statement: LET * Other Statements: CLEAR CLS DIM REM RANDOMIZE POKE * Functions: ABS CHR$ CODEPEEK RND STR$ TL$ USR


8K BASIC

''8K BASIC'' is the ZX81 BASIC (also available as an upgrade for the ZX80), updated with floating-point arithmetic by Steve Vickers, so named for residing in 8 KiB ROM. * Statements: PRINT RAND LET CLEAR RUN LIST GOTO CONT INPUT NEW REM PRINT STOP BREAK IF STOP FOR NEXT TO STEP SLOW FAST GOSUB RETURN SAVE LOAD CLS SCROLL PLOT UNPLOT PAUSE LPRINT LLIST COPY DIM POKE NEW * Functions: ABS SGN SIN COS TAN ASN ACS ATN LN EXP SQR INT PI RND FUNCTION LEN VALSTR$ NOT CODE CHR$ INKEY$ AT TAB INKEY$ PEEK USR


48 BASIC

''48 BASIC'' is the BASIC for the original 16/48 KB 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.


128 BASIC

''128 BASIC'' is the BASIC for the ZX Spectrum 128. It offers extra commands and uses letter-by-letter input. * New commands: LOAD ! SAVE ! MERGE ! ERASE ! PLAY SPECTRUM


+3 BASIC

''+3 BASIC'' is the BASIC with disk support for the ZX Spectrum +3 and +2A. * New commands: FORMAT COPY


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: * DELETE deletes BASIC program line ranges. * FREE is a function that gives the amount of free RAM. PRINT FREE will show how much RAM is free. * ON ERR is an error-handling function mostly used as ON ERR GO TO or ON ERR CONT. * RESET can be used to reset the behaviour of ON ERR. It was also intended to reset peripherals. * SOUND controls the AY-3-8192
sound chip A sound chip is an integrated circuit (chip) designed to produce audio signals through digital, analog or mixed-mode electronics. Sound chips are typically fabricated on metal–oxide–semiconductor (MOS) mixed-signal chips that process a ...
. * STICK is a function that gives the position of the internal joystick (Timex Sinclair 2090).


BASIC64

''BASIC64'' by Timex of Portugal, is a software extension 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. * PRINT # prints to a specific output channel. * LIST # lists the program to a specific output channel. * CLS* clears both display areas. * INK* sets ink colour for both display areas * PAPER* sets paper colour both display areas * SCREEN$ selects the high / normal resolution modes. * PLOT* plots a pixel and updates the drawing position. * LINE draws a line from the previous PLOT position, supporting arc drawing * CIRCLE* 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. * RAM drive commands: LOAD! SAVE! CAT! MERGE! ERASE! CLEAR! * RS-232 commands: FORMAT! LPRINT LLIST * AY-3-8912 commands: BEEP! * 512 x 192 resolution commands: SCREEN$ DRAW! PLOT! CIRCLE!


Other versions, extensions, derivatives and successors


Interpreters for the ZX Spectrum family

Several ZX Spectrum interpreters exist. * '' Beta BASIC'' by Dr. Andy Wright, was originally a BASIC extension, but became a full interpreter. * '' YS MegaBasic'' by Mike Leaman. * ''ZebraOS'' by Zebra Systems in New York, a cartridge version of T/S 2000 BASIC that used the 512×192 screen mode. *
Sea Change ROM
' by Steve Vickers and Ian Logan, modified by Geoff Wearmouth, a replacement ROM with an enhanced Sinclair BASIC. *''Gosh Wonderful'' by Geoff Wearmouth, a replacement ROM that fixes bugs and adds a tokenizer, stream lister, delete and renumber commands. * ''OpenSE BASIC'' (formerly SE BASIC) by Andrew Owen, a replacement ROM with bug fixes and many enhancements including ULAplus support, published as open source in 2011


Compilers for the ZX Spectrum family

Several ZX Spectrum
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
s exist. * '' HiSoft COLT Compiler'' (a.k.a. HiSoft COLT Integer Compiler) * '' HiSoft BASIC'' (a.k.a. HiSoft BASIC Compiler), an integer and floating-point capable compiler * ''Laser Compiler'' * ''Softek 'IS' Integer Compiler'' (successor to Softek Integer Compiler) * ''Softek 'FP' Full Compiler'' * ''ZIP Compiler''


Derivatives and successors for other computers

* '' SuperBASIC'', a much more advanced BASIC dialect introduced with the
Sinclair QL The Sinclair QL (for ''Quantum Leap'') is a personal computer launched by Sinclair Research in 1984, as an upper-end counterpart to the ZX Spectrum. The QL was the last desktop microcomputer from Sinclair Research aimed at the serious home use ...
personal computer, with some similarities to the earlier Sinclair BASICs * ''SAM Basic'', the BASIC on the SAM Coupé, generally considered a ZX Spectrum clone * ''ROMU6'' by Cesar and Juan Hernandez –
MSX MSX is a standardized home computer architecture, announced by ASCII Corporation on June 16, 1983. It was initially conceived by Microsoft as a product for the Eastern sector, and jointly marketed by Kazuhiko Nishi, the director at ASCII Corpo ...
* ''Spectrum 48'' by Whitby Computers –
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit computing, 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in ...
* ''Sparky eSinclair BASIC'' by Richard Kelsh, an operating system loosely based on ZX Spectrum BASIC – Zilog eZ80 * ''Sinbas'' by Pavel Napravnik – DOS * ''Basic'' (and CheckBasic) by Philip Kendall –
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
* ''BINSIC'' by Adrian McMenamin, a reimplementation in
Groovy ''Groovy'' (or, less commonly, ''groovie'' or ''groovey'') is a slang colloquialism popular during the 1960s and 1970s. It is roughly synonymous with words such as "excellent", "fashionable", or "amazing", depending on context. History The word ...
closely modelled on ZX81 BASIC –
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
* ''BASin'' by Paul Dunn, a complete Sinclair BASIC
integrated development environment An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
(IDE) based on a ZX Spectrum emulator – Windows * ''SpecBAS'' (a.k.a. SpecOS) by Paul Dunn, an integrated development environment (IDE) providing an enhanced superset of Sinclair BASIC –
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
,
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
Pandora In Greek mythology, Pandora was the first human woman created by Hephaestus on the instructions of Zeus. As Hesiod related it, each god cooperated by giving her unique gifts. Her other name—inscribed against her figure on a white-ground '' ky ...
, and
Raspberry Pi Raspberry Pi ( ) is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in collaboration with Broadcom Inc., Broadcom. To commercialize the product and support its growing demand, the ...
* ''ZX-Basic'' – Backwardly compatible, but enhanced compiler of Sinclair BASIC programs the ZX Spectrum, written in Python, freely available for Windows, Linux and
Mac OS Mac operating systems were developed by Apple Inc. in a succession of two major series. In 1984, Apple debuted the operating system that is now known as the classic Mac OS with its release of the original Macintosh System Software. The system ...
* ''ZX-Basicus'' by Juan-Antonio Fernández-Madrigal, a synthesizer, analyzer, optimizer, interpreter and
debugger A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
of Sinclair BASIC 48K for PCs, freely downloadable for Linux and Windows.


See also

* * *


Notes


References


Bibliography

* * * * *


External links


Sinclair ZX Spectrum BASIC Programming
The original 1982 manual by Steven Vickers (referenced above)
Sinclair ZX81 Basic Programming
: also by Vickers
The History of Sinclair BASIC
By Andrew Owen

Basic 64 user manual for Timex Computer 2048

A LL(1) grammar specification for parsing Sinclair BASIC 16/48K {{BASIC ZX Spectrum Sinclair Research BASIC interpreters Discontinued BASICs BASIC programming language family ZX80 ZX81