2024.10.3., 16:28
Láng Attila D.
The BASIC Dictionary
2024
Private publication
© Láng Attila D., 2024
ISBN
Foreword
This book is a dictionary of the BASIC language, the programming language that played a crucial role in the spread of home computers in the 1970s and 1980s, and still today plays a role in computer programming.
BASIC has a lot of dialects that may be very different, especially in certain areas like graphic and sound handling.
The aim of this dictionary is to collect as many dialects of BASIC as possible, and to present them in a comprehensive format that provides a good overview on the most important element of BASIC language: the keywords.
The Keywords
BASIC is organized around keywords. A BASIC program is built up from statements, and a statement always begins with a keyword (however, one of them regularly can be omitted, but implied). Some statements use more keywords.
Keywords are viewed by home computer programmers like Lego bricks for builders. Especially in the home computer world, they knew all of them, including their syntaxes and all special tidbits of use, on their specific type of computer.
Therefore, this dictionary is based upon keywords. Each keyword has a dictionary entry, listing all the details known about that keyword in the BASIC dialects processed.
BASIC Dialects Included
Commodore 64 (Microsoft BASIC 2.0)
Commodore Plus/4, 16, 116 (Microsoft BASIC 3.5)
Commodore 128 (Microsoft BASIC 7.0)
Simons’ BASIC
Sinclair ZX81
Sinclair ZX Spectrum
Computer Descriptions
Commodore 64
“The Commodore 64, also known as the C64, is an 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 the Guinness World Records as the highest-selling single computer model of all time, with independent estimates placing the number sold between 12.5 and 17 million units. Volume production started in early 1982, marketing in August for US$595 (equivalent to $1,880 in 2023). Preceded by the VIC-20 and Commodore PET, the C64 took its name from its 64 kilobytes (65,536 bytes) of RAM. With support for multicolor sprites and a custom chip for waveform generation, the C64 could create superior visuals and audio compared to systems without such custom hardware.” (Wikipedia)
The C64 isn’t featured for any keyword. I mean, there is no keyword tagged as C64, there are only ones tagged Commodore, Plus/4 and C128. Those listed as Commodore will work on the C64, but they will also work on later Commodore computers, the Plus/4 family and the C128, as well as on earlier Commodore computers like the PET and the VIC20.
Plus/4 and C128, however, received an extended version of C64’s simple BASIC language – too simple, in fact, since there is no BASIC support for many features of the computer.
Commodore Plus/4, 16, 116
Sinclair ZX81
Order of Precedence
( )
functions except NOT and unary –
**
unary –
* /
+ binary –
< = > <= >= <>
NOT
AND
OR
Limitations
Maximum line number allowed is 9999.
Each program line can contain only one statement.
Numeric variables can have a name of any length.
String variables can have a single-letter name only, and a $ sign.
Arrays can have a single-letter name only, and a $ sign if string arrays.
An array cannot share its name with a scalar variable.
Loop variables used in FOR–NEXT can have a single-letter name only.
Numbers are stored to an accuracy of 9 or 10 digits.
Number precision is between 10³⁸ and 4*10⁻³⁹.
The screen has 24 lines with 32 character positions.
Program lines can be very long.
The contents of string variables can be very long.
Arguments of functions aren’t required to be enclosed in ( ) parentheses if the argument is one single literal or variable.
Sinclair ZX Spectrum
Order of Precedence
( )
functions except NOT and unary –
↑
unary –
* /
+ binary –
< = > <= >= <>
NOT
AND
OR
Limitations
Maximum line number allowed is 9999.
Numeric variables can have a name of any length.
String variables can have a single-letter name only, and a $ sign.
Arrays can have a single-letter name only, and a $ sign if string arrays.
In variable names, spaces and control characters are ignored and all letters converted to lowercase.
Loop variables used in FOR–NEXT can have a single-letter name only.
Numbers are stored to an accuracy of 9 or 10 digits.
Number precision is between 10³⁸ and 4*10⁻³⁹.
The screen has 24 lines with 32 character positions.
Program lines can be very long.
The contents of string variables can be very long.
Arguments of functions aren’t required to be enclosed in ( ) parentheses if the argument is one single literal or variable.
Concepts in Programming
cassette tape recorder, compatible, concatenation, constant, decimal, degrees, dummy, expression, file, function, graphic cursor, graphic screen, hexadecimal, inverse, light pen, logical file number, memory, paddle, peripheral, radian, scalar variable, sprite, subroutine, type (variable)
array
A collection of values (numbers or strings), having a common name and a unique index for each one. An array can be one-dimensional: a series; two-dimensional: a table; three-dimensional: values arranged in a cube; and more.
argument
A numeric or string value a function can work with, specified after the name of the function. All BASIC functions have syntax rules telling how many arguments can they take and what can they be.
ASCII
American Standard Code for Information Interchange. A code table created in the 1960s to encode characters with numbers. Originally, ASCII was having 128 code points, numbered from 0 to 127; later this was extended till 255. Since this is the largest number that can be stored in a single byte, ASCII could not be extended further. Being this not enough, they invented Unicode.
auxiliary keyword
A keyword that plays some modifying role in a statement which was defined by another keyword. At other places, an auxiliary keyword may be a statement or function keyword, in the same dialect or in other dialects.
binary operator
An operator that stands between two operands and acts on them. (The term has nothing to do with binary numbers.)
bit
The smallest unit of information. A bit can store a value of 0 or 1. 8 bits are collected together to a byte.
bitwise operation
An operation on numeric values that concerns to their bit representation. For example, logically, 3 AND 8 is true (–1 or 1, depending on the dialect) because both 3 and 8 are nonzero values. But bitwise, 3 AND 8 is 0, because the binary representation for 3 is 0011, the one for 8 is 1000, so there’s no bit which would be 1 for both.
byte
The smallest unit of memory directly accessible. A byte contains 8 bits and thus it can store an integer value from 0 to 255.
carriage return
A special control character (decimal 13 in ASCII) which used to be sent to teletype machines to mean “return the carriage”, i.e. send the printing head to the beginning of the line. After this, a line feed was send. After the age of teletypes, many computers were using the CR only, but Windows is still using both (CR/LF), and Unix is using LF only.
character
An entity encoded by a special table (the ASCII table) to serve as part of strings. On home computers, every character is encoded with one byte, thus there may be 256 different characters existing at the same time. With Unicode, more bytes are used for a character, so the system can display a lot of them.
Types of characters include printable and non-printable characters. Printable characters are letters, digits, punctuation and special symbols, and graphic characters. Non-printable characters are control characters which, when printed, change something on the screen, e.g. clear it, switch to a different color, move the cursor etc.
On ZX81 and Spectrum, all keywords are treated as single characters and typed with one single keypress (plus one or two modifier keys).
On most computers, the shape of printable characters can be redesigned. The computer won’t notice the change (for instance, a keyword PRINT is still the same keyword even if you redraw all the five letters to different shapes, since it operates on codes, not shapes).
character screen
A screen mode when only characters can be displayed. There is an invisible grid on the screen, dividing it to a certain number of lines and to a certain number of character positions; both numbers are specific to each computer. In each character position, exactly one character may be displayed because there is a single byte assigned to each one, and if the contents of a byte is changed, the character will change, too. Since on home computers, characters are encoded with one byte, only 256 different characters may appear on the screen. If you redesign any character, all instances of it will change immediately.
Many home computers have no graphic screen, only a character screen.
command
Similar to the statement, but isn’t part of a BASIC program. In dialects using line numbers, a command is entered without a line number, that’s how the interpreter knows it is a command. Some keywords can be used only in command mode, others only in statement mode, and most of them in both modes.
compiler
A program created to make the computer to understand BASIC language. All keywords and their syntaxes were defined when the creator wrote the compiler. A compiler differs from an interpreter in its working mode: the compiler reads the complete BASIC code and translates it to machine code. Execution can take place only after this. Compiling takes time, but furthermore, the compiler isn’t necessary to run the program. BASIC compilers rarely appeared for home computers, they were mostly using interpreters.
CR
Carriage return.
cursor
A marker on the screen which shows where will the next character be displayed. On different computers, it could be a flashing or non-flashing square, horizontal line or vertical line. When the computer is working on its own and we aren’t typing, the cursor is usually not visible, but it is there.
On Sinclair, the cursor is an inverted letter which show what mode is the keyboard in. Depending on the mode, the same key types different characters.
device number
Commodore
There is a number to identify which peripheral do you want to communicate with. These are used in the OPEN statement:
0 = keyboard
1 = cassette tape; secondary address: 0 = input, 1 = output, 2 = output, writing an end of tape mark after CLOSE
2 = modem
3 = screen
4 and 5 = printer; secondary address: 0 = uppercase/graphic characters, 1 = lowercase/uppercase characters
8 to 11 = floppy drive; secondary address: 0 = save, 1 = load, 2 to 14 = data channels, 15 = command channel
dialect
BASIC is a programming language which is distributed by many companies for many computers. Based on both the different abilities of different computers and the personal taste of manufacturers, they can be very different: both the set of available keywords and their syntaxes may differ.
execution
When a program is running, its statements are executed one after another, as determined by the structure of the program.
expression
One or more values (literals and/or variables), connected by operators, forming a mathematical formula or a string processing formula.
floppy disk
A mass storage media largely used in the 1980s and 1990s. A floppy (flexible) plastic circle with a magnetic layer, enclosed in a square plastic envelope.
floppy drive
A device used for reading and writing floppy disks. Among them, a special category is the Commodore floppy drives which are programmable computers with an own language.
graphic screen
A screen mode where graphic shapes can be displayed. For home computers, graphic screens were memory consuming and slow, but the only way to freely (or relatively freely) draw on the screen. The graphic abilities of these computers were very diverse, and as seen by our time, very low-key: low resolution, few colors.
Many home computers have no graphic screen at all. On the other hand, the Spectrum has only a graphic screen.
hard disk, hard drive
The most frequent mass storage device of our time. But for home computers, it was barely known and almost never used. Most home computers used cassette tape recorders and some of them floppy disks, too.
home computer
A category of computers being marketed from the end of the 1970s to the end of the 1980s. Relatively cheap, small computers with less knowledge than personal computers. Most of them had a small memory (that was the most expensive part those times), a smaller selection of compatible peripherals, most of them used an household television instead of a monitor, and a household cassette tape recorder instead of a floppy drive or hard drive.
integer
A number with no fractional part (like 8). In most BASIC dialects, there are integer variables for storing only these numbers.
integer variable
A variable which can store only integer numbers. In most BASIC dialects, these wear a % percent symbol as a suffix to their names.
interpreter
A program created to make the computer to understand BASIC language. All keywords and their syntaxes were defined when the creator wrote the interpreter. An interpreter differs from a compiler in its working mode: the interpreter reads a statement, understands and executes it, then goes on to the next statement. Home computer BASIC dialects are written as interpreters.
keyword
A BASIC element in BASIC. A keyword is a single word (in this dictionary, some symbols are also treated as keywords). Its spelling is fixed and cannot be changed. Traditionally, keywords are written in ALL CAPS; the oldest computers didn’t have lowercase letters at all. On Sinclair computers, all keywords are treated like single characters (which appear as several characters). Keywords identify statements, commands, functions, operators and others. Different BASIC dialects may use the same keyword for different purposes, or may use different keywords for the same purpose. Each keyword has one or more syntaxes, which also can be different in different BASIC dialects.
LF
Line feed.
line feed
A special control character (decimal 10 in ASCII) which used to be sent to teletype machines to mean “line feed”, i.e. to rotate the paper feeding cylinder one row further. This was sent after a carriage return. After the age of teletypes, many computers were using the CR only, but Windows is still using both (CR/LF), and Unix is using LF only.
line number
In older BASIC dialects, all lines of a program must begin with a number. This is both to separate them to commands (which have no number and are executed immediately) and to specify the order of execution. Traditionally, we are using numbers increasing by 10 (10, 20, 30 etc.), to make it easier to insert additional lines later.
literal
A numeric or string value directly written in a program line. Numeric literals are simply numbers. String literals are strings enclosed in " quotation marks.
logical value
A value that can either be true or false, nothing else. In BASIC, a numeric value of 0 represents false, and any non-zero value corresponds to true. If a logical operation returns a value of true, it is represented by –1 in most dialects, but in some dialects, 1.
logical operation
An operation on logical values. In most BASIC dialects, AND, NOT and OR are the available operations, but these keywords are often working as bitwise operations. In some dialects, also the XOR operation is available.
machine code
The native tongue of the processor. Not discussed in books dealing with BASIC language, since it’s a different language, but in many dialects, there are tools for working with machine code.
mass storage
A device that can store large amounts of information, in a way that it won’t be forgot upon switching the device off (what was a great problem with memories in 20th century computers). Mass storage devices are using some kind of data carrier media to write the actual data on. The earliest one was the punch card, then the punched tape (both made of paper and working with holes punched on them). Then came several kinds of plastic with a magnetic layer: the drum memory, the floppy disk and the hard disk. Later, the optical disks appeared, but the hard disks are still the most important media.
memory
A electronic device that can store information. Computers need memory to work. Since for a long period, memories were very expensive and forgot everything upon switching off, different types of mass storage were used.
modifier keyword
A Spectrum specialty. BRIGHT, FLASH, INK, INVERSE, OVER and PAPER can stand as statements on their own, thus affecting all subsequent graphic statements. Or they can appear inside graphic statements, even more of them, thus affecting only that statement. Graphic statements that can be altered this way include CIRCLE, DRAW, INPUT, PLOT and PRINT.
name
In programming, we often need names. Variables, files, procedures (in some dialects), and other things are always reached by names. The names are chosen by the programmer. Each dialect has its own rules for what do they accept as a name.
numeric variable
A variable storing a number. In most BASIC dialects, numeric variables wear no symbol as a suffix to their names. Many dialects provide integer variables which can’t hold a fractional number, these have a % percent mark suffix. Some dialects feature additional numeric variables, too.
operand
A value (literal, variable or expression) that an operator is acting on.
operator
A symbol that can be used in expressions to act on values (literals, variables or partial expressions). These include fundamental arithmetic operations like + and –, and others. BASIC has a lot less operators than mathematics.
order of precedence
When evaluating expressions, all BASIC dialects have a certain order of precedence between operators. Those listed first will be processed first. Operators of the same rank will be processed left to right.
parameter
A numeric or string value a statement can work with, specified after the name of the statement. All BASIC statements have syntax rules telling how many parameters can they take and what can they be.
peripheral
A device connected to the computer and serving for some purpose. There are input peripherals: keyboards, mice, joysticks, scanners etc.; output peripherals:
personal computer
A category of computers marketed since the 1980s. Most computers used nowadays are personal computers.
program
A list of statements to be processed in order when needed. Programs can be very simple and minimal or large and complex.
program line
A line of text written on a computer, in a programming environment, according to the rules of some programming language (in this book: BASIC language). In older versions of BASIC, program lines always began with a number which determined the order of execution, and served as reference for statements that acted on some program lines. Newer version omit line numbers, they’re using modern text editors instead, and the order of execution is simply determined by the physical order of the lines in the text.
reserved variable
A variable which is reserved by BASIC for some communication. May be thought about as a function with no argument.
statement
A basic element in BASIC. A statement can do some interaction with the screen, the keyboard or some peripheral; can make calculations using previously computed values; can change the order of processing program lines; can make decisions; and more. Each statement begins with a BASIC keyword (one of them can be omitted) which tells BASIC what to do and may contain parameters which tell BASIC how to do it. A statement is always part of a BASIC program.
string
A series of characters kept together in a specified order. Literal strings are directly written in the program, enclosed in " quotation marks. Strings can be stored in string variables, too.
string function
A function that operates on one or more strings. In a broader sense, any function that either or both takes a string as input or gives one as output is a string function. The narrower sense covers only those that give string output. These ones are wearing a $ dollar symbol as a suffix to their names.
string variable
A variable storing a string value. In most BASIC dialects, string variables wear a $ dollar symbol as a suffix to their names, and they’re strictly separated from numbers.
syntax
The grammar of BASIC language and of a given keyword. Programming languages, including BASIC, are a lot simpler than languages spoken by humans. They have only a few keywords, and each one has a syntax (or more syntaxes) which tells how does the interpreter understands them.
teletype
A machine looking like an electric typewriter: what you type was immediately appearing on paper. From the 1950s, they were used as the main I/O peripheral for computers: the user typed on the teletype which both printed on the paper and sent the messages to the computer, and it printed the answers on the paper, too. Screens (televisions, monitors) weren’t be used yet. That’s why displaying characters on the screen is still called printing. The teletypes disappeared in the 1970s only.
UDG
Short for User Defined Graphics. A Spectrum specialty. There are 20 characters in the Spectrum character set which are easily redefinable.
unary operator
An operator that acts on a single operand. There are prefixed and postfixed unary operators, but most dialects of BASIC have only two unary operators, the – for negative numbers, and NOT.
Unicode
The character encoding standard used nowadays. It can support millions of different characters. But home computers didn’t know it, they only knew ASCII.
variable
A storage area in the memory of the computer, marked by a name and serving to hold some information. There are numeric and string variables, scalar variables and arrays.
ASCII Tables
Color Tables
Commodore 64 and Commodore 128, 40 columns mode
1 = black
2 = white
3 = red
4 = cyan
5 = purple
6 = green
7 = blue
8 = yellow
9 = orange
10 = brown
11 = light red
12 = dark grey
13 = medium grey
14 = light green
15 = light blue
16 = light grey
Plus/4
All statements related to color handling use a colortype parameter, which can be one of the following:
0 = background color
1 = foreground color (on the graphic screen, it can be different in each character cell)
2 = multicolor 2 (on multicolor graphic screen only, can be different in each character cell)
3 = multicolor 3 (on multicolor graphic screen only, uniform on the whole screen)
4 = border (only in the COLOR statement)
C128
The colortype parameter is a bit changed from the Plus/4:
0 = 40 column background
1 = 40 column foreground
2 = multicolor 1
3 = multicolor 2
4 = 40 column border
5 = 40 or 80 column characters
6 = 80 column background
In 80 column mode, the colors are:
1 = black
2 = white
3 = dark red
4 = light cyan
5 = light purple
6 = dark green
7 = dark blue
8 = light yellow
9 = dark purple
10 = dark yellow
11 = light red
12 = dark cyan
13 = medium grey
14 = light green
15 = light blue
16 = light grey
The Dictionary
ABS
function
all
ABS(x)
Returns the absolute value of x The absolute value is the same value for non-negative numbers, and the appropriate positive value for negative ones.
ACS
function
Sinclair
ACS x
Returns the arc sine of x. On ZX81, it appears as ARCCOS on the keyboard, but on the screen, it is ACS.
AND
operator
all
x AND y
Returns the bitwise AND value of the operands.
ANGL
statement
Simons
ANGL x, y, angle, xr, yr, dmode
Draws a ray of a circle or ellipse. dmode in high resolution: 0 = erasing, 1 = drawing, 2 = inverting; in multicolor: 1–3 = the colors specified in MULTI and LOW COL statements, 4 = inverting (colors 3–0 instead of 0–3).
APPEND
statement
C128
APPEND#lf, file$[, Ddev] [{ON|,} Uunit]
Opens a file$ to append, placing the pointer at the end of it.
ARC
statement
Simons
ARC x, y, begin, end, step, xr, yr, dmode
Draws an arc of a circle or ellipse from angle begin to end, in steps of step degrees. dmode: see ANGL.
ASC
function
all, except Sinclair
ASC(a$)
Returns the ASCII code of the first character of a$, according to the ASCII table of the given computer. Same as CODE.
ASN
function
Sinclair
ASN x
Return the arc sine of x. On ZX81, it appears as ARCSIN on the keyboard, but on the screen, it is ASN.
AT
special_function
Sinclair
AT row, column
Places the cursor at the given position of the screen. Can be used only in the PRINT and LPRINT statements; in the latter, the row number is ignored.
On ZX81, row must be between 0 and 21, column must be between 0 and 31.
Simons
•AT(column, row)
ATN
function
all
ATN(x)
Returns the arc tangent of x radians.
On ZX81, it appears as ARCTAN on the keyboard, but on the screen, it is ATN.
ATTR
function
Spectrum
ATTR(row, column)
Returns the attributes from the character position specified. It is a single byte, with bits meaning: 7 = FLASH, 6 = BRIGHT, 5–3 = PAPER, 2–0 = INK.
AUTO
command
Plus/4
AUTO [step]
Turns automatic line numbering on (if step is present) or off (if step is omitted). When it’s on, entering a BASIC program line and pressing RETURN yields the next line number, the previous one plus step, be displayed.
Simons
AUTO first, step
first is the first number to be used.
B
auxiliary
C128
BACKUP
statement
Plus/4
BACKUP Ddeva TO Ddevb [{ON|,} Uunit]
Copies a floppy disk from device deva to device devb on dual floppy drive unit. Cannot be used on single floppy drives.
BANK
statement
C128
BANK bank
Activates the selected memory configuration. bank means:
0–3 RAM only, 0 to 3
4–7 internal ROM with RAM 0 to 3
8–11 external ROM with RAM 0 to 3
12 kernal and internal ROM, RAM 0
13 kernal and external ROM, RAM 0
14 kernal and BASIC ROM, RAM 0, character ROM
15 kernal and BASIC ROM, RAM 0
BCKGNDS
statement
Simons
BCKGNDS gr, a, b, c
Switches to extended background color mode. gr is the background color, a, b and c are the background colors for Shifted, inverted and inverted Shifted characters, respectively.
BEEP
statement
Spectrum
BEEP length, pitch
Sounds a note for length seconds at a pitch pitch semitones above (or below if it’s negative) the middle c.
BEGIN
statement
C128
BEGIN
Allows several lines to be included in an IF–THEN–ELSE structure:
IF condition THEN BEGIN: statement
…
… BEND: ELSE BEGIN
…
… BEND
BEND
statement
C128
BEND
Closes a BEGIN clause (see there).
BFLASH
statement
Simons
BFLASH speed[, a, b]
Starts flashing the border between colors a and b, with speed 1 = slowest, 255 = fastest, or 0 = turns it off (then colors aren’t needed).
BIN
special_function
Spectrum
BIN number
Allows numbers to be entered in binary. number can be a binary constant only. Largest number allowed is 16 digits (1111111111111111 = decimal 65535).
BLOAD
statement
C128
BLOAD file$[, Ddev][, Uunit][, Bbank][, Paddr]
Loads a binary file to the memory in the given bank, from the address addr.
BLOCK
statement
Simons
BLOCK x1, y1, x2, y2, dmode
Draws a filled rectangle. dmode: see ANGL.
BOOT
statement
C128
BOOT file$[, Ddev][{ON|,} Uunit]
Loads and executes a binary file.
BORDER
statement
Spectrum
BORDER c
Sets the color of the border, and also the paper color of the lower part of the screen (where BASIC lines are entered).
BOX
statement
Plus/4
BOX [colortype], x1, y1, x2, y2[, angle[, fill]]
Draws a rectangle with colortype from x1, y1 to x2, y2. It is rotated by angle radians. If fill is 1, it is filled.
BRIGHT
statement modifier
Spectrum
BRIGHT b
Sets the brightness for graphic statements. b 0 = normal, 1 = bright, 8 = transparent. Can be used as a statement or a modifier for graphic statements.
BSAVE
statement
C128
BSAVE file$[, Ddev][, Uunit][, Bbank], Paddr TO Pend
Saves a binary file from the memory in the given bank, from the address addr to address end.
BUMP
function
C128
BUMP(n)
Returns a byte containing the numbers of sprites that collided since the previous BUMP. n 1 = sprites collided with each other, 2 = sprites collided with the contents of the screen. The returned value is 1 on each bit (sprites 0 to 7).
CALL
statement
Simons
CALL label
Jumps to the line marked with PROC label. Can’t be followed by another statement in the same line.
CAT
statement
Spectrum
CAT  …NO INFO
Accesses the catalog of the microdrive. Details unknown.
CATALOG
statement
C128
CATALOG [Ddev][{ON|,} Uunit][, joker$]
Same as DIRECTORY.
CENTRE
statement
Simons
CENTRE a$
Prints a$ centered in the line.
CGOTO
statement
Simons
CGOTO x
Calculated GOTO where x can be an expression.
CHAR
statement
Plus/4
CHAR [colortype], x, y[, a$[, invert]]
Prints a$ at position x, y (character coordinates) on either the character screen or the graphic screen, whichever is currently on. If invert is 1, it appears inverted.
Simons
CHAR x, y, code, dmode, size
Prints the character of POKE-code code on the graphic screen in size size. dmode: see ANGL.
CHECK
function
Simons
CHECK({a, b|0})
If two numbers are given, it returns 0 if two sprites collided. If 0 is given, it returns 0 if a sprite collided with screen contents.
CHR$
function
all
CHR$(x)
Returns the character belonging to the ASCII code x, according to the ASCII table of the given computer. x must be between 0 to 255, inclusively.
CIRCLE
statement
Plus/4
CIRCLE [colortype], [x, y], xr, [yr], [start], [end], [rot], [angle]
Draws a circle or ellipse with colortype, centered at x, y or at the graphic cursor if coordinates are omitted. xr and yr are the axis lengths. start and end are the two endpoints of an arc to be drawn. rot is the rotation. angle is the angle between two points being drawn: if it is 120, we get a triangle. (All angles are degrees.)
Spectrum
CIRCLE x, y, r
Draws a circle with radius r.
Simons
CIRCLE x, y, xr, yr, dmode
dmode: see ANGL.
CLEAR
statement
Sinclair
CLEAR
Clears all variables from the memory. Same as CLR.
CLOSE
statement
Commodore
CLOSE lf
Closes the file or peripheral opened by the logical file number lf.
CLOSE#
statement
Spectrum
CLOSE#  …NO INFO
Closes a file on the microdrive. Details unknown.
CLR
statement auxiliary
Commodore
CLR
Clears all variables from the memory. Same as CLEAR.
See also GRAPHIC
CLS
statement
Sinclair
CLS
Clears the screen. Same as SCNCLR.
CMD
statement
Commodore
CMD lf[, message$]
Redirects all subsequent PRINT statements to the file or peripheral opened by logical file number lf. If message$ is present, it will be printed there.
CMOB
statement
Simons
CMOB b, d
For the statement @, defines the colors for the points marked B and D, respectively.
CODE
function auxiliary
Sinclair
CODE a$
Returns the ASCII code of the first character of a$, according to the ASCII table of the given computer. Same as ASC.
COLD
command
Simons
COLD
Restarts Simons’ BASIC.
COLLECT
statement
Plus/4
COLLECT [Ddev][{ON|,} Uunit]
Reorganizes the blocks on the floppy in device dev on unit unit.
COLLISION
statement
C128
COLLISION type[, line]
Turns on (if line is missing, turns off) the sprite collision interrupt. When it’s on, and a sprite collides, a GOSUB line is executed. type is 0 = sprite to sprite collision, 1 = sprite to background collision.
COLOR
statement
Plus/4
COLOR colortype, color[, luminosity]
Assigns colortype to the specified color and luminosity.
COLOUR
statement
Simons
COLOUR border, background
Sets the border and background color.
CONCAT
statement
C128
CONCAT second$[, Ddeva] TO first$[, Devb][{ON|,} Uunit]
Appends file second$ to the end of file first$.
CONT
command
Commodore|ZX81
CONT
Continues the running program, after an error, a STOP statement or a user break. Same as CONTINUE.
CONTINUE
statement
Spectrum
CONTINUE
Continues the running program, after an error, a STOP statement or a user break. Same as CONT.
On the keyboard, it’s spelled CONT, but on the screen, it is CONTINUE.
COPY
statement
Plus/4
COPY [Ddeva,] [filea] TO [Ddevb,] [fileb] [{ON|,} Uunit]
Copies file filea to file fileb between devices deva and devb on unit unit. If filea is missing, all files are copied.
Sinclair
COPY
Makes a copy of the screen to the printer.
Simons
COPY
Makes a copy of the graphic screen to the printer.
COS
function
all
COS(x)
Returns the cosine of x radians.
CSET
statement
Simons
CSET x
x 0 = switch to uppercase mode, 1 = switch to lowercase mode, 2 = switch to the graphic screen used last.
D
auxiliary
Plus/4
DATA
statement auxiliary
all, except ZX81
DATA constant[, …]
Serves as a storage place of data which can be read later into variables. constants can be both numeric or string types, but when reading them, we must avoid trying to read a string data to a numeric variable, this would give an error.
String constants don’t need to be included in " quotation marks, except those that contain a , comma.
DCLEAR
statement
C128
DCLEAR [Ddev][{ON|,} Uunit]
Closes all files and open channels on the drive.
DCLOSE
statement
C128
DCLOSE[#lf][{ON|,} Uunit]
Closes the file with logical file number lf, or all open files if it’s omitted, on the disk.
DEC
function
Plus/4
DEC(a$)
Converts a hexadecimal number between 0 and FFFF to decimal.
DEF
statement
Commodore
DEF FN name(variable)=expression
Defines a user function. The function can later be called as FNname(x) and will calculate the value of the expression with variable replaced by x. It is a symbolic argument. The argument, and therefore also x, must be numeric.
Spectrum
DEF FN name([variable[, …])=expression
The name and all variables are single-letter ones. DEF FN is a single keyword.
DELAY
statement
Simons
DELAY n
Sets the speed for the LIST command: n 1 = fastest, 255 = slowest.
DELETE
command
Plus/4
DELETE lines
Deletes lines from the program. For valid syntaxes, see LIST.
Spectrum
DELETE  …NO INFO
Deletes something on the microdrive. Details unknown.
DESIGN
statement
Simons
DESIGN mode, addr
Starts designing something, depending on mode: 0 = a hires sprite, 1 = a multicolor sprite, 2 = a character. For a sprite, it should be followed by 21, for a character, by 8 @ statements.
DETECT
statement
Simons
DETECT n
Turns sprite collision detection on. n 0 = with each other, 1 = with the screen contents.
DIM
statement
all
DIM variable(dimension[, …])[, …]
Declares an array. It may be of any variable type. dimensions are one or more numbers defining the highest available index of that dimension (maximum allowed is 32767); the lowest index is 0. Several arrays can be declared in a DIM statement. If an array is used with no declaration, it’s automatically dimensioned name(10).
On Sinclair, the lowest index is 1, and the last dimension of a string array is the length of the strings. So, DIM a$(10, 10) declares an array of 10 strings that are 10 characters long. Arrays cannot be used with no declaration.
DIR
statement
Simons
DIR a$
Lists the directory of the disk, those files that match a$.
DIRECTORY
statement
Plus/4
DIRECTORY [Ddev] [{ON|,} Uunit][, a$]
Lists the directory of the files on the disk in device dev on unit unit. If a$ is present, only the files matching it will be listed.
DISABLE
statement
Simons
DISABLE
Switches ON KEY off.
DISAPA
statement
Simons
DISAPA
Used as first statement on the line, marks it for encrypting with SECURE.
DISK
statement
Simons
DISK a$
Sends a$ as a command to the floppy drive.
DISPLAY
statement
Simons
DISPLAY
Lists the strings assigned to the function keys.
DIV
function
Simons
DIV(x, y)
Integer division.
DLOAD
statement
Plus/4
DLOAD a$ [Ddev][{ON|,} Uunit]
Loads a file named a$ from the disk in device dev on unit unit.
DO
statement
Plus/4
DO [{UNTIL|WHILE} x]
Begins a loop. If either UNTIL or WHILE is present, x is evaluated. If UNTIL is present, the loop will end when x is true. If WHILE is present, the loop will end when x is false. If neither one is present, the ending condition will be evaluated by the LOOP statement.
DOPEN
statement
C128
DOPEN#lf, file$[, Llength][, Ddev][{ON|,} Uunit][, write]
Opens a file on the disk. If file$ ends in: ,S = sequential file, ,P = program file. length is the record length for relative files. If write is true, it will opened for writing, otherwise for reading. If logical file number lf is bigger than 127, all writes will be automatically ended with a CR/LF. Below 128, only a CR will be sent.
DOWNB
statement
Simons
DOWNB r1, c1, r2, c2
Scrolls a rectangle of the character screen down. On the top, empty space comes in.
DOWNW
statement
Simons
DOWNW r1, c1, r2, c2
Scrolls a rectangle of the character screen down. On the top, the contents scrolled out come in.
DRAW
statement
Plus/4
DRAW [colortype], [x1, y1] [TO x2, y2 …]
Draws a line or a series of lines. x1 and y1 are the coordinates of the starting point, or if this is omitted, the graphic cursor will be used. The TO part can be repeated several times, resulting in a series of lines.
Spectrum
DRAW x, y, r
Draws a line from the graphic cursor to x, y while turning in angle r.
Simons
DRAW a$, x, y, dmode
Draws a shape. a$ describes the shape by these characters: 0 = moving right, 1 = up, 2 = down, 3 = left, 5–8 = the same with drawing, 9 = end of drawing
DS
reserved_variable
Plus/4
DS
Returns the error code of the floppy drive.
DS$
reserved_variable
Plus/4
DS$
Returns the error message of the floppy drive.
DSAVE
statement
Plus/4
DSAVE a$ [Ddev] [{ON|,} Uunit]
Saves a file named a$ on the disk in the device dev on unit unit.
DUMP
statement
Simons
DUMP
Prints the values of all scalar variables.
DUP
function
Simons
DUP(a$, n)
Returns a string containing a$, n times.
DVERIFY
statement
C128
DVERIFY file$[, Ddev][{ON|,} Uunit]
Compares the file$ with the program being in the memory.
EL
reserved_variable
Plus/4
EL
Returns the number of the line the recent error occurred in. Same as ERRLN.
ELSE
auxiliary
Plus/4|Simons
@c=eL
END
statement
all, except Sinclair
END
Finishes the program.
END LOOP
statement
Simons
END LOOP
Closes a LOOP loop.
END PROC
statement
Simons
END PROC
Closes a PROC procedure.
ENVELOPE
statement
Simons
ENVELOPE voice, a, d, s, r
Sets the envelope for voice (1–3) with attack, decay, sustain and release.
ER
reserved_variable
Plus/4
ER
Returns the code of the recent error. Same as ERRN.
ERASE
statement
Spectrum
ERASE  …NO INFO
Deletes something on the microdrive. Details unknown.
ERR$
function
Plus/4
ERR$(x)
Returns the error message belonging to error code x.
ERRLN
reserved_variable
Simons
ERRLN
Returns the number of the line the recent error occurred in. Same as EL.
ERRN
reserved_variable
Simons
ERRN
Returns the number of the line the recent error occurred in. Same as ER.
EXEC
statement
Simons
EXEC label
Calls a PROC procedure. Can’t be followed by another statement in the same line.
EXIT
statement
Plus/4
EXIT
Leaves a DO–LOOP loop.
EXIT IF
statement
Simons
EXIT IF condition
IF condition is true, exits the LOOP–END LOOP loop.
EXOR
function
Simons
EXOR(x, y)
Bitwise EXOR operation.
EXP
function
all
EXP(x)
Returns e = 2.7182818…, the base of the natural logarithm on the power of x.
FAST
statement
ZX81|C128
FAST
Turns the screen off to make the program run faster. Only the SLOW or NEW statement, an error or the end of the program will turn it on again.
FCHR
statement
Simons
FCHR row, column, width, height, code
Fills the selected area of the screen with the character of the specified POKE code.
FCOL
statement
Simons
FCOL row, column, width, height, color
Fills the selected area of the character screen with the specified character color. The characters won’t change.
FETCH
statement
Simons
FETCH mark, n, a$
An alternative INPUT statement which accepts up to n characters in a$. mark controls the accepted character set: HOME = only unshifted letters, CRSR ↓ = only digits, CRSR → = letters, digits and punctuation.
C128
FETCH bytes, inaddr, bank, exaddr
Takes bytes bytes from the external memory, from the specified bank and address exaddr, and stores them in the internal memory from address inaddr.
FILL
statement
Simons
FILL row, column, width, height, code, color
Fills the selected area of the character screen with both the character of the POKE code and color.
FILTER
statement
C128
FILTER freq, l, b, h, res
Sets audio filtering parameters. freq is the cut-off frequency (0 to 2047), l, b and h are the low-pass, band-pass and high-pass filters, respectively (0 = of, 1 =on), and res is the resonance, 0 to 15.
FIND
statement
Simons
FINDanything
Lists the numbers of program lines where anything is found. If a space is included before anything it will be part of the search.
FLASH
statement modifier
Spectrum
FLASH f
Sets the flashing for graphic statements. f 0 = normal, 1 = flash, 8 = no change. Can be used as a statement or a modifier for graphic statements.
Simons
FLASH color, speed
Makes the color flash on the character screen: 1 is slowest, 255 is fastest.
FN
function
Commodore
FNname(x)
Returns the value of the user function name with argument x. User functions are defined with DEF FN.
Spectrum
The arguments must be enclosed in ( ) parentheses; even if no argument the parentheses must be there.
FOR
statement
all
FOR variable=start TO end [STEP step]
Begins a loop when it counts from start to end (by 1 or step if specified), and the actual count is always in variable. It must be numeric. The end of the loop is the NEXT statement.
FORMAT
statement
Spectrum
FORMAT  …NO INFO
Formats the microdrive. Details unknown.
FRAC
function
Simons
FRAC(x)
Returns the fractional part of x.
FRE
function
Commodore
FRE(dummy)
Returns the amount of free memory in bytes.
GET
statement
Commodore
GET[#lf, ]variable$[, …]
Reads a keypress. If no key is pressed, returns an empty string. If #lf is present, reads a character from the file opened by logical file number lf. See also GETKEY and INKEY$.
GETKEY
statement
Plus/4
GETKEY a$
Waits until a key is pressed, and returns it in a$. If a numeric variable is specified, the statement will accept a digit only, otherwise it throws an error.
GLOBAL
statement
Simons
GLOBAL
Makes all LOCAL variables global.
GO
statement
Commodore
GO TO line
The GO keyword serves only to make it possible to write keyword GOTO in two words, using the TO keyword.
C128
Beyond the definition above, on C128, the statement GO64 switches the computer to Commodore 64 mode, and performs a reset. If used as a command, a message Are you sure? will appear, and a Y keypress will make the switching. If used in a program, the message won’t appear.
GOSUB
statement
all
GOSUB line
Redirects execution to a subroutine at the program line line. It must be a numeric constant. Later, a RETURN statement will take back to the recently executed GOSUB statement.
On Sinclair, line can be an expression.
GOTO
statement
all
GOTO line
Redirects execution to the program line line. It must be numeric constant. On Commodore systems, the statement can be written in two words: GO TO.
On Sinclair, line can be an expression.
GRAPHIC
statement
Plus/4
GRAPHIC {mode[, clear]|CLR}
Sets the mode of the screen. If clear is 1, the screen is cleared.
Available screen modes:
0 = text mode
1 = high resolution graphic
2 = high resolution graphic, split screen
3 = multicolor graphic
4 = multicolor graphic, split screen
In split screen modes, the bottom of the screen displays five lines of the text screen, but above it, the graphic screen is visible.
GRAPHIC CLR frees the memory occupied by the graphic screen.
C128
Same as in Plus/4 but there is an additional mode: 5 = 80 column text.
GSHAPE
statement
Plus/4
GSHAPE a$[, [x, y][, mode]
Puts the shape stored in a$ on the screen; the shape was stored earlier by SSHAPE. x and y are the coordinates of the top left corner; if they’re omitted, the graphic cursor is used. mode can be one of the following:
0 = overwrites the earlier contents (default)
1 = inverse display
2 = in OR relation to the contents
3 = in AND relation to the contents
4 = in XOR relation to the contents
HEADER
statement
Plus/4
HEADER a$, Ddev[, Iid [{ON|,} Uunit]
Formats a floppy disk in device dev on unit unit, assigning it a name a$ and an ID number id. If Iid is omitted, the disk won’t be formatted but only erased. For new, unformatted disks, this cannot be used.
HELP
command
Plus/4
HELP
After an error, lists the line where the error was found, with the part causing the error marked. Plus/4: flashing; C128, 40 column mode: inverse; C128, 80 column mode: underlined.
HEX$
function
Plus/4
HEX$(x)
Returns the hexadecimal value of x, which can be between 0 and 65535.
HI COL
statement
Simons
HI COL
Restores the colors as they were before the LOW COL statement.
HIRES
statement
Simons
HIRES ink, paper
Switches to high resolution screen and sets colors.
HRDCPY
statement
Simons
HRDCPY
Prints the character screen on the printer.
I
auxiliary
Plus/4
IF
statement
Commodore
IF expression {THEN {statements|line}|GOTO line}
Evaluates expression. If the result is non-zero, executes the statements to the end of the line, or if GOTO line or THEN line is used, redirects execution.
Plus/4
IF expression {THEN {statements|line}|GOTO line}[: ELSE {statements|line}]
On Plus/4, an ELSE clause can be added. These statements will be executed if the result is zero.
C128
See also BEGIN and BEND.
Simon
IF expression {THEN {statements|line}|GOTO line}[: ELSE: {statements|line}]
ZX81
IF expression THEN statement
IN
function
Spectrum
IN port
Reads a value from a processor port which must be between 0 and 65535.
INK
statement modifier
Spectrum
INK i
Sets the ink color of graphic statements. i 0–7 = a color, 8 = transparent, 9 = contrast. Can be used as a statement or a modifier for graphic statements.
INKEY
function
Simons
INKEY
Waits for a function key to be pressed and returns its number.
INKEY$
function
Sinclair
INKEY$
Reads a keypress. If no key is pressed, returns an empty string. See also GET.
INPUT
statement
all
INPUT [message;] variable[, …]
If message (a string constant) is present, displays it. Displays a ? question mark, then waits for keyboard input. As many variables are provided in the statement, so many values are expected, separated by , commas, of the same type as required by the statement.
ZX81
INPUT variable
Spectrum
INPUT [[(]message[)];] [LINE] variable
The message can contain everything allowed in PRINT. If there is any variable in message, the complete thing must be in ( ) parentheses. If variable is a string variable, a pair of " quotation marks appear in the left part of the screen, unless LINE is specified before variable, which must be a string variable in this case.
INPUT#
statement
Commodore
INPUT#lf, variable[, …]
Like INPUT but reads the values from the file opened with the logical file number lf.
INSERT
function
Simons
INSERT(needle, haystack, offset)
Returns haystack, inserting needle in it at the pth character, before the rest of haystack.
INST
function
Simons
INST(needle, haystack, offset)
Returns haystack, inserting needle in it at the pth character, overwriting the rest of haystack.
INSTR
function
Plus/4
INSTR(haystack$, needle$[, offset])
Searches for the first occurrence of needle$ in haystack$ from offset and returns the character offset, or 0 if not found.
INT
function
all
INT(x)
Returns the integer part of x. This is the biggest integer which is smaller than x. Thus, INT(1.5) = 1 but INT(–1.5) = –2.
INV
statement
Simons
INV row, column, width, height
Inverts the selected part of the character screen.
INVERSE
statement modifier
Spectrum
INVERSE i
Sets the true or inverse video for graphic statements. i 0 = true video, 1 = inverse video. Can be used as a statement or a modifier for graphic statements.
JOY
function
Plus/4
JOY(x)
Returns the status of the joystick x where x can be 1 or 2. The values are:
0 = no movement
1 = forward
2 = forward right
3 = right
4 = right backward
5 = backward
6 = backward left
7 = left
8 = left forward
128 is added if the fire button is pressed.
Simons
JOY
The values returned are the same as on Plus/4.
KEY
statement
Plus/4
KEY [n, a$]
Assigns the string a$ to the function key n (1 to 8; the HELP key is the 8th). If no parameter is given, lists the assignments.
Simons
The statement is written the same as on Plus/4. But the key assignment is different, because the computers themselves are numbering them differently.
LEFT$
function
all, except Sinclair
LEFT$(a$, x)
Returns x characters from the left side, i.e. from the beginning of a$.
LEFTB
statement
Simons
LEFTB r1, c1, r2, c2
Scrolls a rectangle of the character screen left. From the right, empty space comes in.
LEFTW
statement
Simons
LEFTW r1, c1, r2, c2
Scrolls a rectangle of the character screen left. From the right, the contents scrolled out come in.
LEN
function
all
LEN(a$)
Returns the length (the number of characters) of a$.
LET
statement
all
[LET] variable=value
Stores the value in variable. They must be of the same type.
In most BASIC dialects, the keyword LET can be omitted. A statement which doesn’t begin with a keyword is considered a LET statement.
Sinclair
The keyword LET must be used. A variable mustn’t be referred to before giving it a value with a LET statement or, for an array, before declaring it in a DIM statement.
Substrings (see the keyword entry for ( ) parentheses) can stand at the left side of the = symbol. This makes only a portion of the string to be changed. If the assigned string is longer than the substring range specified, its end will be truncated. If it is shorter, it will be filled at the end with spaces. Characters beyond the substring range won’t change.
LINE
statement auxiliary
Simons
LINE x1, y1, x2, y2, dmode
Draws a line. dmode: see ANGL.
Spectrum
LIST
command
all
LIST [lines]
Lists the lines of the program. If lines are specified, only a part of the list is shown. Possible ranges:
10
10–
–100
10–100
ZX81
LIST [line]
Only one number can be given, and it lists a screenful of the program from that line. Also, it makes the line the current line (the one marked for editing).
LLIST
statement
Sinclair
LLIST [line]
Lists the lines of the program on the printer. If line is specified, the listing begins from that line.
LN
function
Sinclair
LN x
Returns the natural logarithm of x. Same as LOG.
LOAD
command
Commodore
LOAD [filename$[, device]]
Loads a program from the specified device. If filename$ is specified (not an empty string), the program with the appropriate name will be searched. Otherwise, the first one is loaded.
Sinclair
LOAD filename$
Spectrum
LOAD filename DATA [$]()
Loads an array from the filename. If the $ symbol is present, it is a string array; without it, a numeric array.
LOAD filename CODE [addr[, len]]
Loads the file into the memory from address addr, at most len bytes if it’s specified. If addr is missing, it is loaded to the address it was saved from.
LOAD f SCREEN$
Loads the contents of the screen.
LOCAL
statement
Simons
LOCAL variable[, …]
Makes the listed variables local for a part of the program; they must be defined earlier.
LOCATE
statement
Plus/4
LOCATE x, y
Puts the graphic cursor to the given location. The contents of the screen won’t change.
LOG
function
all
LOG(x)
Returns the natural logarithm of x. Same as LN.
LOOP
statement
Plus/4
LOOP [{UNTIL|WHILE} x]
Closes a loop, started by a DO statement. If either UNTIL or WHILE is present, x is evaluated. If UNTIL is present, the loop will end when x is true. If WHILE is present, the loop will end when x is false. If neither one is present, the ending condition will be evaluated by the DO statement.
Simons
LOOP
Marks the beginning of a LOOP–END LOOP loop.
LOW COL
statement
Simons
LOW COL a, b, c
In multicolor graphics, sets three alternative colors.
LPRINT
statement
Sinclair
LPRINT [element][separator][…]
Works the same as PRINT but for the printer. AT works the same way as TAB.
MEM
statement
Simons
MEM
Copies the character memory from the ROM to the RAM, to make it redefinable.
MERGE
statement
Spectrum
MERGE filename$
Loads the filename$ but doesn’t delete the old program nor its variables. Both were present at the same time. Lines with the same number will replace old lines; variables with the same name will replaces old variables.
Simons
•MERGE filename°, device
The same as on Spectrum but requires a device number to load it from.
MID$
function
all, except Sinclair
MID$(a$, from, count)
Returns a part of a$ from the character number from (the first character is numbered 1) in the length of count characters.
Commodore
It can be a statement:
MID$(a$, from, count)=b$
This replaces the given portion of a$ with b$. Here, a$ must be a variable.
MMOB
statement
Simons
MMOB sprite, x1, y1, x2, y2, size, speed
Makes a sprite visible and moves it between the specified coordinates, with the speed: 1 = slowest, 255 = fastest. size 0 = normal, 1 = doubled in x direction, 2 = doubled in y direction, 3 = doubled in both directions.
MOB OFF
statement
Simons
MOB OFF sprite
Makes a sprite not visible.
MOB SET
statement
Simons
MOB SET sprite, block, color, priority, mode
Defines parameters of a sprite. block is the number of the memory block specified in the DESIGN statement; color is the color marked with B (for high resolution) or C (for multicolor) in the @ statements; priority is 0 = the sprite covers the screen contents, 1 = the sprite appears behind the screen contents; mode• is 0 = high resolution, 1 = multicolor.
MOD
function
Simons
MOD(a, b)
Modulo function.
MONITOR
command
Plus/4
MONITOR
Enters the machine code monitor.
MOVE
statement
Spectrum
MOVE  …NO INFO
Moves something on the microdrive. Details unknown.
Simons
MOVE row, column, width, height, row2, column2
Copies a selected area of the character screen to another place.
MOVSPR
statement
C128
MOVSPR sprite, {x, y|a # s}
Moves a sprite to another location. x and y may be absolute or relative coordinates, or instead, the sprite can be moved by angle a (0 to 360) and speed s (0 to 15).
MULTI
statement
Simons
MULTI a, b, c
Switches to multicolor graphic screen and sets colors.
MUSIC
statement
Simons
MUSIC length, music$
Plays music defined in music$: a CLR character and a digit specifies the voice; letters CDEFGAB the notes; SHIFT+CDEFGAB are notes with #; numbers 0–8 are octaves; Z is pause; function keys are for the note length. length is the overall length of the notes: 1 = longest, 255 = shortest.
NEW
command
all
NEW
Deletes the program and variables stored in the memory.
NEXT
statement auxiliary
all
NEXT [variable][, …]
Returns to the FOR statement specifying the loop with variable or if it’s omitted, to the recent one. If several variables are specified, it continues the first loop, then when it’s finished, the second loop, and so on.
Sinclair
NEXT variable
NO ERROR
statement
Simons
NO ERROR
Switches back to the normal error handling of BASIC.
NOT
operator
all
NOT x
Returns the bitwise NOT value of x.
NRM
statement
Simons
NRM
Switches back to the character screen from the graphic one.
OFF
statement
Simons
OFF
Switches the FLASH statement off.
OLD
command
Simons
OLD
Restores the program after a NEW statement.
ON
statement auxiliary
Commodore
ON x {GOSUB|GOTO} line[, …]
Evaluates x. Depending on its value, it executes a GOSUB or GOTO statement to the given line: if x = 1, the first one, if x = 2, the second one, and so on. If x is less than 1 or more than the number of line numbers, the execution continues on the next statement. All line numbers must be numeric constants.
On Plus/4 also an auxiliary word used in disk handling statements.
ON ERROR
statement
Simons
ON ERROR: GOTO line
Upon an error, jumps to line.
ON KEY
statement
Simons
ON KEY a$: GOTO line
If a key which is listed in a$ is pressed it jumps to line, placing the key in ST.
OPEN
statement
Commodore
OPEN lf, dev, sec, a$
Opens a logical file number lf on the device dev. sec is a secondary address that may be needed on some devices, and a$ is a file name or a command to be sent to the device. (See device in Concepts.)
OPEN#
statement
Spectrum
OPEN#  …NO INFO
Opens a file on the microdrive. Details unknown.
OPTION
command
Simons
OPTIONn
After n = 10, Simons’ BASIC keywords will be LISTed inverted.
OR
operator
all
x OR y
Returns the bitwise OR value of the operands.
OUT
statement
Spectrum
OUT port, byte
Sends the byte to the port.
Simons
OUT
Turns ON ERROR off.
OVER
statement modifier
Spectrum
OVER o
Sets the overprinting mode for graphic statements. o 0 = off, 1 = on. Overprinting means the new contents will be XOR mixed with the old contents. Can be used as a statement or a modifier for graphic statements.
P
auxiliary
C128
PAGE
command
Simons
PAGE n
Sets how many screen lines should LIST use. If n = 0, switches back to normal listing.
PAINT
statement
Plus/4
PAINT [colortype][, [x, y][, mode]
Paints an area, starting from the point x, y or the graphic cursor. If mode is 0, the painting finishes at non-background points; if 1, it finishes at background points.
Simons
PAINT x, y, dmode
Same as on Plus/4, just the order of parameters is different. dmode: see ANGL.
PAPER
statement modifier
Spectrum
PAPER p
Sets the paper color of graphic statements. p 0–7 = a color, 8 = transparent, 9 = contrast. Can be used as a statement or a modifier for graphic statements.
PAUSE
statement
ZX81
PAUSE time
Pauses the execution for time 1/50 seconds or until a key is pressed.
{L}Simons
PAUSE message$, s
Prints message$ and pauses the execution for s seconds.
PEEK
function
all
PEEK(address)
Returns the byte value stored at the address in the memory.
PEN
function
C128
PEN(n)
Returns information about the light pen: n 0 = the x coordinate, 1 = the y coordinate, 2 and 3 = same on the 80 column screen, 4 = the fire button.
PENX
function
Simons
PENX
Returns the x coordinate of the light pen.
PENY
function
Simons
PENY
Returns the y coordinate of the light pen.
PI
reserved_variable
Spectrum
PI
Returns the value of π = 3.141596… Same as π.
PLACE
function
Simons
PLACE(needle$, haystack$)
Searches for the first occurrence of needle$ in haystack$ and returns the character offset, or 0 if not found.
PLAY
statement
Simons
PLAY mode
mode: 0 = turns music off, 1 = plays it and after it execution will continue, 2 = starts playing while execution continues.
C128
PLAY a$
Plays a piece of music stored in a$. Its elements include (x means a digit): Vx = voice (1 to 3); Ox = octave (0 to 6); Tx = envelope (see below); Ux = volume (0 to 15); Xx = filter (0 = off, 1 = on); A, B, C, D, E, F, G = notes; # = sharp; $ = flat; W = whole note; H = half; Q = quarter; I = eighth; S = sixteenth; . = dotted; R = rest; M = wait for all voices currently playing to end the current measure. Modifiers precede the notes they apply to.
Envelope numbers: 0 = piano, 1 = accordion, 2 = calliope, 3 = drum, 4 = flute, 5 = guitar, 6 = harpsichord, 7 = organ, 8 = trumpet, 9 = xylophone.
PLOT
statement
ZX81
PLOT x, y
Paints the screen element at coordinates x, y black. Actually, this means replacing the character there with a graphic character having one black quarter more. x must be between 0 and 63, y must be between 0 and 43.
Spectrum
A real pixel is plotted, so x must be between 0 and 255 and y between 0 and 175.
Simons
PLOT x, y, dmode
Plots a pixel. dmode: see ANGL.
POINT
function
Spectrum
POINT x, y
Returns the color of the graphic point: 0 = PAPER color, 1 = INK color. x must be 0 to 255, y 0 to 175.
POINTER
function
C128
POINTER(variable)
Returns the address of the variable.
POKE
statement
all
POKE address, value
Stores the value at the address in the memory.
POS
function
Commodore
POS(dummy)
Returns the logical position of the cursor in the screen line.
POT
function
Simons
POT(n)
Returns the value of paddle n (0 or 1).
C128
Same as in Simons but n can be between 1 and 4.
PRINT
statement
all
PRINT [element][separator][…]
On Commodore systems, the PRINT keyword can be abbreviated to a ? question mark.
An element can be a valid expression of any type or a special PRINT modifier: SPC or TAB (see there).
separators can be the following:
; (semicolon) puts the cursor immediately after the last printed character
, (comma) puts the cursor to the next comma-separated column
’ (apostrophe) only on Spectrum puts the cursor at the beginning of the next row
If the statement ends with no separator, the cursor is put at the first column of the next row.
Comma-separated columns: the screen is horizontally split into fixed columns. A comma in a PRINT statement puts the cursor to the next column, or if the rightmost column is reached, the first character of the next row.
Commodore – 4 columns, 10 characters wide
ZX81 – 2 columns, 11 characters wide
Regularly, positive numbers are printed with a leading space character; negative numbers have a – minus character instead. Fractional numbers are printed without a leading zero (.5 and –.5 instead of 0.5 and –0.5).
See also USING.
PRINT#
statement
Commodore
PRINT#lf, [element][separator][, …]
The same as PRINT but to the file opened with logical file number lf. In this statement, the keyword PRINT cannot be abbreviated by a ? question mark.
PROC
statement
Simons
PROC label
Marks a line with a label. It isn’t in " quotation marks. No other statements can follow it on the same line: all the rest of the line is the label. Such labels can be called without return by CALL or with return by EXEC.
PUDEF
statement
Plus/4
PUDEF a$
Redefines the output characters in PRINT USING with a$ which can contain up to 4 characters:
1st = the separator
2nd = the comma
3rd = the decimal point
4th = the $ symbol
RAND
statement
ZX81
RAND [x]
Sets the random number generator seed to x. If x is omitted or 0, the seed will be taken from the number of frames generated so far on the television. Same as RANDOMIZE.
RANDOMIZE
statement
Spectrum
RANDOMIZE [x]
Sets the random number generator seed to x. If x is omitted or 0, the seed will be taken from the number of frames generated so far on the television. Same as RAND.
On the keyboard, it’s spelled RAND, but on the screen it is RANDOMIZE.
RCLR
function
Plus/4
RCLR(colortype)
Returns the color assigned to the colortype.
RCOMP
statement
Simons
RCOMP: statements[: ELSE: statements]
Evaluates the condition of the most recent IF again, and executes either the statements of the true branch or the false one.
RDOT
function
Plus/4
RDOT(n)
Returns information about the graphic cursor, depending on n:
0 = the x coordinate
1 = the y coordinate
2 = the colortype
READ
statement
all, except ZX81
READ variable[, …]
Reads one or more values from the DATA lines to the variables. The values and the variables must match in type.
REC
statement
Simons
REC x, y, width, height, dmode
Draws a rectangle. dmode: see ANGL.
RECORD
statement
C128
RECORD lf, rec[, byte]
Sets a file pointer of a relative file opened with logical file number lf to the record rec and byte byte.
REM
statement
all
REM [text]
Does not do anything. Everything to the end of the line is ignored. This is the way to include comments in the program list.
RENAME
statement
Plus/4
RENAME old$ to new$[, Ddev] [{ON|,} Uunit]
Renames a file old$ to a new name new$ in device dev on unit unit.
RENUMBER
command
Plus/4
RENUMBER from[, step][, beginning]
Renumbers the lines of the program. The first line will get the number from, and further lines will be increased by step. The default is 10 for both. If beginning is given, that is the first line of the program to be renumbered. Line numbers in GOTO and GOSUB statements are also renumbered.
Simons
•RENUMBER from, beginning
Same as on Plus/4 but lacks step and doesn’t renumber line numbers in GOTO and GOSUB statements. However, there aren’t needed in Simons’ BASIC since there are PROC, CALL and EXEC.
REPEAT
statement
Simons
REPEAT
Marks the beginning of a REPEAT–UNTIL loop
RESET
statement
Simons
RESET line
Restores the DATA pointer to the beginning of line line.
RESTORE
statement
all
RESTORE
Restores the DATA pointer to the beginning of the program, so subsequent READ statements will read the data from the first DATA line.
Plus/4, Spectrum
RESTORE [line]
If line is given, restores the DATA pointer to the beginning of that line.
RESUME
statement
Plus/4
RESUME [line|NEXT]
Resumes the execution from the error handling routine. If line is specified, it will return to that line. With NEXT, execution continues with the next statement. If neither is given, it tries to execute the statement which caused the error again.
Simons
RESUME
Switches an ON KEY statement, after switching it off, on again.
RETRACE
statement
Simons
RETRACE
Puts the TRACE windows back on the screen after a clear screen.
RETURN
statement
all
RETURN
Finishing the current subroutine, returning to the recently executed GOSUB statement.
RGR
function
Plus/4
RGR(dummy)
Returns the current mode as set in the GRAPHIC statement.
RIGHT$
function
all, except Sinclair
RIGHT$(a$, x)
Returns x characters from the right side, i.e. from the end of a$.
RIGHTB
statement
Simons
RIGHTB r1, c1, r2, c2
Scrolls a rectangle of the character screen right. From the left, empty space comes in.
RIGHTW
statement
Simons
RIGHTW r1, c1, r2, c2
Scrolls a rectangle of the character screen right. From the left, the contents scrolled out come in.
RLOCMOB
statement
Simons
RLOCMOB sprite, x, y, size, speed
Moves a sprite earlier made visible with MMOB
RLUM
function
Plus/4
RLUM(colortype)
Returns the luminosity of the color assigned to colortype.
RND
function
all
RND(x)
Returns a random (actually, pseudorandom) number.
Commodore
if x > 0, it returns the next number in a random series
if x < 0, it returns the same number for the same x
if x = 0, it returns a number based on the internal clock
Sinclair
RND
ROT
statement
Simons
ROT angle, size
Sets the rotation angle (in 45° steps) and zoom size of shapes to be drawn with DRAW.
RSPCOLOR
function
C128
RSPCOLOR(n)
Returns the multicolor sprite colors n 1 or 2.
RSPPOS
function
C128
RSPPOS(sprite, n)
Returns information about a sprite. n 0 = x position, 1 = y position, 2 = the speed.
RSPRITE
function
C128
RSPRITE(sprite, n)
Returns information about a sprite. n 0 = on, 1 = color, 2 = covered by contents, 3 = x zoom, 4 = y zoom, 5 = multicolor. Except the color, any parameter returns 0 = off or 1 = on.
RUN
command
all
RUN [line]
Runs the program from the first line, or from the specified line. Before that, deletes all variables.
RWINDOW
function
C128
RWINDOW(n)
Returns information about the screen window. n 0 = number of rows, 1 = number of columns, 2 = returns 40 or 80, based on the active screen mode.
SAVE
command
Commodore
SAVE filename$[, device]
Saves a program to the specified device.
Sinclair
SAVE filename$
Spectrum
Saves the variables along with the program.
SAVE filename LINE line
After LOADing the program back, it will automatically started at line.
SAVE filename DATA [$]()
Saves an array. If the $ symbol is present, it’s a string array; without it, a numeric array.
SAVE filename CODE addr, len
Saves len bytes from address addr.
SAVE filename SCREEN$
Saves the screen.
SCALE
statement
Plus/4
SCALE mode
Selects the scaling mode on the graphic screen. Default is 0 when the coordinates are the same as the physical coordinates; if it is 1, both x and y coordinates run from 0 to 1023. The physical resolution doesn’t change.
SCNCLR
statement
Plus/4
SCNCLR
Clears the active screen.
C128
SCNCLR [mode]
If mode is present, it clears the screen specified (see GRAPHIC).
SCRATCH
statement
Plus/4
SCRATCH file$[, Ddev] [{ON|,} Uunit]
Deletes one or more file$s from the disk in device dev on unit unit.
SCREEN$
function auxiliary
Spectrum
SCREEN$(row, column)
Returns the character at the given character position. row must be 0 to 23, column 0 to 31. Cannot recognize UDG characters.
SCRLD
statement
Simons
SCRLD lf, dev, sec, name$
Loads the character screen from file. Parameters are like in the OPEN statement.
SCRSV
statement
Simons
SCRSV lf, dev, sec, name$
Saves the character screen. Parameters are like in the OPEN statement.
SCROLL
statement
ZX81
SCROLL
Scrolls the contents of the screen one row up, deleting the top line. Subsequent PRINT statements will write in the bottom row.
SGN
function
all
SGN(x)
Returns the signum of x, i.e. 1 for positive numbers, –1 for negative ones, and 0 for 0.
SECURE
command
Simons
SECURE 0
After executing it, lines marked with DISAPA won’t be listed, only their line numbers, but they will execute anyhow.
SIN
function
all
SIN(x)
Returns the sine of x radians.
SLEEP
statement
C128
SLEEP sec
Delays the program for sec seconds.
SLOW
statement
ZX81|C128
SLOW
Turns the screen off, after a FAST statement. An error, the end of the program or a NEW invokes SLOW, too.
SOUND
statement
Plus/4
SOUND voice, freq, length
Emits a sound from the voice which can be 0 or 1 for music, or 2 for white noise. freq is the frequency between 0 to 1023 and length is between 0 and 65535.
C128
SOUND voice, freq, length[, dir, m, s, w, p]
In addition to the Plus/4 version, the statement can sweep through a range of frequencies. Direction is set by dir 0 = up, 1 = down, 2 = oscillate. m is the minimum frequency, s is the step value, w the waveform: 0 = triangle, 1 = sawtooth, 2 = variable, 3 = noise, and p is the pulse width.
SPC
special_function
Commodore
SPC(x)
Returns x space characters. This function works only in the PRINT statement.
SPRCOLOR
statement
C128
SPRCOLOR m1, m2
Specifies the two colors for multicolor sprites.
SPRDEF
command
C128
SPRDEF
Starts the built-in sprite designer.
SPRITE
statement
C128
SPRITE sprite[, on][, color][, priority][, xz][, yz][, mode]
Sets parameters for a sprite. on is 0 = turns it off, 1 = turns it on. color is the foreground color. priority is 0 = sprite covers the screen contents, 1 = screen contents cover the sprite. xz and yz are the zoom in x and y directions.
SPRSAV
statement
C128
SPRSAV source, target
Copies the image of a sprite to a string or back. Both source and target can be a number, this means copying to another sprite. If target is a string variable, the image is stored in it. If source is a string variable, the sprite takes the image stored in it (only the first 63 bytes, additional content is ignored).
SQR
function
all
SQR(x)
Returns the square root of x.
SSHAPE
statement
Plus/4
SSHAPE a$, x1, y1[, x2, y2]
Stores a part of the graphic screen in the variable a$. x1, y1 are the top left corner, and x2, y2 or the graphic cursor are the bottom right corner. The shape can be later pasted back on the with GSHAPE.
ST
reserved_variable
Commodore
ST
Returns the status code of the device used last.
STASH
statement
C128
STASH bytes, inaddr, bank, exaddr
Copies data from the operative memory to the extended memory. See parameters at FETCH.
SWAP
statement
C128
SWAP bytes, inaddr, bank, exaddr
Swaps the contents of the operative memory and the extended memory. See parameters at FETCH.
STEP
auxiliary
all
STOP
statement
all
STOP
Stops the execution, issuing an error message.
STR$
function
all
STR$(x)
Returns x as a string, in the same format as PRINT displays it.
SYS
function
Commodore
SYS addr
Execute the machine code program from the memory address addr.
C128
SYS addr[, a][, x][, y][, s]
Same as in general Commodore, but the parameters are loaded to the accumulator, the X and Y registers, and the status register, respectively.
TAB
special_function
all
TAB(x)
Puts the cursor on the column x. This function works only in the PRINT statement.
On ZX81, x is interpreted modulo 32. Then, if column x is right from the cursor, it will move there; otherwise, it will move to the xth column of the next line.
TAN
function
all
TAN(x)
Returns the tangent of x radians.
TEMPO
statement
C128
TEMPO n
Sets the tempo of the PLAY statement. n can be 0 to 255, and it means a whole note length = 19.22/n seconds.
TEST
function
Simons
TEST(x, y)
Returns the state of a pixel on the graphic screen.
TEXT
statement
Simons
TEXT x, y, a$, dmode, size, i
Prints a$ on the graphic screen in zoom factor size, separating letters by i pixels; in a$, CTRL+A = uppercase mode, CTRL+B = lowercase mode.
THEN
auxiliary
all
@c=tH zx=S3 sp=Yg
TI
reserved_variable
Commodore
TI
Returns the number of 60th seconds elapsed since the computer was switched on.
TI$
reserved_variable
Commodore
TI$
Returns the setting of the internal clock, in the format HHMMSS. When the computer is switched on, it is 000000. It can be set with a statement TI$="040831"
TO
auxiliary
all
TRACE
statement
Simons
TRACE n
If n = 10 turns tracing on: in the upper right corner it displays the numbers of the last six program lines executed.
TRAP
statement
Plus/4
TRAP [line]
Turns error catching on: any subsequent error will send execution to line line. If no line is specified, error catching is turned off.
TROFF
statement
Plus/4
TROFF
Turns TRON off.
TRON
statement
Plus/4
TRON
Turns tracking mode on. In tracking mode, the line number of each program line executed will be displayed between [] brackets.
U
auxiliary
Plus/4
UNPLOT
statement
ZX81
UNPLOT x, y
Paints the screen element at coordinates x, y white. Actually, this means replacing the character there with a graphic character having one white quarter more. x must be between 0 and 63, y must be between 0 and 43.
UNTIL
statement auxiliary
Plus/4
Simons
UNTIL condition
Repeats the REPEAT–UNTIL loop until condition turns true.
UPB
statement
Simons
UPB r1, c1, r2, c2
Scrolls a rectangle of the character screen up. From the bottom, empty space comes in.
UPW
statement
Simons
UPW r1, c1, r2, c2
Scrolls a rectangle of the character screen up. From the bottom, the contents scrolled out come in.
USE
statement
Simons
USE format$, n
Prints n in the specified format$ where the place of digits are marked #.
USING
auxiliary
Plus/4
PRINT USING format; values
Creates a formatted printout. In format, the following characters are used:
# = place for a digit or character
+ = place for a positive sign
– = place for a positive or negative sign
. = place for a decimal point
, = place for a separator
$ = place for a dollar symbol
^^^^ = place for the exponent
= = centered
> = right adjusted
USR
function
Commodore|Sinclair
USR(x)
Calls a machine code program at address 784 (decimal), giving it x as a parameter. Returns a value from the machine code program.
Spectrum
USR char$
Taking a character from a to u or an UDG, returns the address of the bit pattern for that UDG character. POKEing 8 values to this address and the following 7 will redesign the UDG.
VAL
function
all
VAL(a$)
Returns a numeric value stored in a$ as a string. On Sinclair, a$ may contain an expression and it will be evaluated.
VAL$
function
Spectrum
VAL$ a$
Evaluates a$ as a string expression.
VERIFY
command
Commodore
VERIFY [filename$[, device]]
Verifies a program from the specified device, comparing it to the program stored in memory. If filename$ is specified (not an empty string), the program with the appropriate name will be searched. Otherwise, the first one is compared.
VOL
statement
Plus/4
VOL volume
Sets the sound volume between 0 (off) to 7 (loudest).
On Simons, it is the same, but 15 is the loudest.
WAIT
statement
Commodore
WAIT address, a[, b]
a and b are one byte long values. The computer will wait until the bits at address, compared to a and b, give appropriate values. If only a is present, the execution continues when PEEK(address) AND a <> 0 – if b is present, the execution continues when (PEEK(address) EOR b) AND a <> 0.
WAVE
statement
Simons
WAVE voice, waveform
Sets the waveform for the voice (1–3). waveform is an 8 digits long binary literal where the meaning of the bits are the following: 7 = white noise, 6 = square, 5 = sawtooth, 4 = triangle, 3 = testbit, 2 = modulation, 1 = synchronization, 0 = gate bit.
WHILE
auxiliary
Plus/4
WIDTH
statement
C128
WIDTH n
Sets the width of lines drawn. n can be 1 or 2.
WINDOW
statement
C128
WINDOW x1, y1, y2, y2[, clear]
Sets a logical window on the 40 or 80 column character screen. If clear is 1, the inside of the window will be cleared.
XOR
function
C128
XOR(a, b)
Returns the bitwise XOR value of a and b.
@
statement
Simons
@bits
After a DESIGN statement, describes a line of a shape. For high-resolution sprites, bits (a string literal with no " quotation marks) are 24 characters; for multicolor sprites, 12; for characters, 8. Applicable characters are: . = background color, B = foreground color, and in multicolor C and D = two additional colors (see CMOB and MOB SET).
:
separator
all, except ZX81
statement : statement …
Statement separator to use several statements in the same line. On ZX81, only one statement by line is allowed.
;
separator
all
… value; value …
Separator to delimit parameters in some situations.
,
separator
all
… value, value …
Separator to delimit parameters of statements and arguments of functions.
’
separator
Spectrum
… value ’ value …
One of the separators in the PRINT statement to put the cursor to the beginning of the next line.
+
operator
all
value + value
For numbers, addition operator. For strings, concatenation operator.
–
operator
all
value – value
Subtraction operator. For a single value, negation operator.
*
operator
all
value * value
Multiplication operator.
/
operator
all
value / value
Division operator.
↑
operator
Commodore|Spectrum
value ↑ value
Power operator.
**
operator
ZX81
value ** value
Power operator.
=
operator
all
value = value
1. Relational operator: true if the values are equal. 2. Assignment operator: assigns a value to a variable (variable=value), replacing the LET statement. 3. Used in some statements like FOR.
<
operator
all
value1 < value2
Relational operator: true if value1 is less than value2.
>
operator
all
value1 > value2
Relational operator: true if value1 is greater than value2.
<=
operator
all
value1 <= value2
Relational operator: true if value1 is less than or equal to value2. On most systems, can be written also =<.
>=
operator
all
value1 >= value2
Relational operator: true if value1 is greater than or equal to value2. On most systems, can be written also =>.
<>
operator
all
value1 <> value2
Relational operator: true if value1 is not equal to value2. On most systems, can be written also ><.
( )
separator
all
… (values) …
Enclosing separator for arguments of functions, and used in expressions.
On Sinclair, beyond the above, it is the substring marker, along with the keyword TO.
s$(a) means the ath character of s$
s$(a TO ) means the ath and following characters of s$
s$( TO b) means the first and following characters of s$, ending with the bth one
s$(a TO b) means the characters of s$ from the ath one to the bth one, inclusively
Also on the Sinclair, the ( ) parentheses aren’t required around the argument of a function if it is a single literal value or variable. If the function keyword is followed by an expression and there are no parentheses, it will be interpreted with only the first element as an argument.
"
separator
all
"string"
Enclosing separator to include literal strings.
""
symbol
ZX81
"string""string"
Serves as a replacement character for the " quotation mark inside literal strings. When printing the string, it appears as ". On ZX81, "" is a separate character. On Spectrum, it is two " quotation marks.
#
symbol
Commodore
statement#lf…
On the Commodore systems, in some file related statements, serves as a prefix for the logical file number lf. Actually, it is a part of the keyword itself.
On ZX81, the character itself is not available.
$
symbol
all
name$
1. Serves as a suffix at variable names to denote string variables. 2. Serves as a suffix for function names that result in a string. Actually, it is a part of the keyword itself.
Simons
$digits
A hexadecimal constant.
%
symbol
all, except Sinclair
name%
Serves as a suffix at variable names to denote integer variables. On ZX81, the character itself is not available.
Simons
%bits
A binary constant.
?
symbol
all, except Sinclair
On most systems (except Sinclair) it is the abbreviation of the PRINT statement.
π
reserved_variable
Commodore|ZX81
π
Returns the value of π = 3.141596… Same as PI.
On Commodore and ZX81, this Greek letter is available in the character set and can be reached from the keyboard.
Sources
Kőhegyi János (editor): Ismerd meg a BASIC nyelvjárásait! [Get Acquainted with Dialects of BASIC!] Műszaki Könyvkiadó. Series:
– 1. HT–1080Z, ABC80, ZX81. 1984.
– 2. ZX Spectrum, TI–99/4A, Proper–16/A. 1985.
– 3. Commodore 64, Commodore VIC 20, Sharp PC–1500. 1986.
– 4. Commodore 16, Commodore Plus/4, Commodore 128, Videoton TV Computer. 1989.
Láng Attila D.: TV–BASIC. A tévésorozat, amely történelmet írt. [TV–BASIC. The Television Series That Wrote History.] Private digital publication, 2021.
Plenge–Szczepanowsky: Simon’s [sic!] BASIC gyakorlatok. [Simons’ BASIC Exercises.] Data Becker–Novotrade, 1984.
Rochlitz András (ed.): Commodore 128 felhasználói kézikönyv. [User Manual] Novotrade Rt., 1987.
Sági Gyula: Ismerkedés a ZX81-gyel. [Getting Acquainted with the ZX81] Műszaki Könyvkiadó, 1985.
Tory Kálmán: Commodore 16 felhasználói kézikönyv. [User Manual]
Úry László dr.: Commodore 16, Commodore 116 BASIC és felhasználói kézikönyv. [BASIC and User Manual] LSI ATSZ, 1986.
Úry László dr.: Commodore 64 BASIC felhasználói kézikönyv. [User Manual] LSI ATSZ, 1984.
Vickers, Steven: Sinclair Spectrum BASIC Programming. Sinclair Research Limited, second edition 1983.
Vickers, Steven: Sinclair ZX81 BASIC Programming. Sinclair Research Limited, second edition 1981.
Vogel, James–Scrimshaw, Nevin B.: The Commodore 64 Music Book. Birkhauser Boston, Inc.
Wiese, William M., Jr.: Commodore 128 Programming Secrets. Osborne McGraw-Hill.
Wikipedia
KEYWORDS
326: ABS ACS AND ANGL APPEND ARC ASC ASN AT ATN ATTR AUTO B BACKUP BANK BCKGNDS BEEP BEGIN BEND BFLASH BIN BLOAD BLOCK BOOT BORDER BOX BRIGHT BSAVE BUMP CALL CAT CATALOG CENTRE CGOTO CHAR CHECK CHR$ CIRCLE CLEAR CLOSE CLOSE# CLR CLS CMD CMOB CODE COLD COLLECT COLLISION COLOR COLOUR CONCAT CONT CONTINUE COPY COS CSET D DATA DCLEAR DCLOSE DEC DEF DELAY DELETE DESIGN DETECT DIM DIR DIRECTORY DISABLE DISAPA DISK DISPLAY DIV DLOAD DO DOPEN DOWNB DOWNW DRAW DS DS$ DSAVE DUMP DUP DVERIFY EL ELSE END END LOOP END PROC ENVELOPE ER ERASE ERR$ ERRLN ERRN EXEC EXIT EXIT IF EXOR EXP FAST FCHR FCOL FETCH FILL FILTER FIND FLASH FN FOR FORMAT FRAC FRE GET GETKEY GLOBAL GO GOSUB GOTO GRAPHIC GSHAPE HEADER HELP HEX$ HI COL HIRES HRDCPY I IF IN INK INKEY INKEY$ INPUT INPUT# INSERT INST INSTR INT INV INVERSE JOY KEY LEFT$ LEFTB LEFTW LEN LET LINE LIST LLIST LN LOAD LOCAL LOCATE LOG LOOP LOW COL LPRINT MEM MERGE MID$ MMOB MOB OFF MOB SET MOD MONITOR MOVE MOVSPR MULTI MUSIC NEW NEXT NO ERROR NOT NRM OFF OLD ON ON ERROR ON KEY OPEN OPEN# OPTION OR OUT OVER P PAGE PAINT PAPER PAUSE PEEK PEN PENX PENY PI PLACE PLAY PLOT POINT POINTER POKE POS POT PRINT PRINT# PROC PUDEF RAND RANDOMIZE RCLR RCOMP RDOT READ REC RECORD REM RENAME RENUMBER REPEAT RESET RESTORE RESUME RETRACE RETURN RGR RIGHT$ RIGHTB RIGHTW RLOCMOB RLUM RND ROT RSPCOLOR RSPPOS RSPRITE RUN RWINDOW SAVE SCALE SCNCLR SCRATCH SCREEN$ SCRLD SCRSV SCROLL SGN SECURE SIN SLEEP SLOW SOUND SPC SPRCOLOR SPRDEF SPRITE SPRSAV SQR SSHAPE ST STASH SWAP STEP STOP STR$ SYS TAB TAN TEMPO TEST TEXT THEN TI TI$ TO TRACE TRAP TROFF TRON U UNPLOT UNTIL UPB UPW USE USING USR VAL VAL$ VERIFY VOL WAIT WAVE WHILE WIDTH WINDOW XOR @ : ; , ’ + – * / ↑ ** = < > <= >= <> ( ) " "" # $ % ? π
TYPES
auxiliary 19: B CLR CODE D DATA ELSE I LINE NEXT ON P SCREEN$ STEP THEN TO U UNTIL USING WHILE
command 18: AUTO COLD CONT DELETE HELP LIST LOAD MONITOR NEW OLD OPTION PAGE RENUMBER RUN SAVE SECURE SPRDEF VERIFY
function 66: ABS ACS ASC ASN ATN ATTR BUMP CHECK CHR$ CODE COS DEC DIV DUP ERR$ EXOR EXP FN FRAC FRE HEX$ IN INKEY INKEY$ INSERT INST INSTR INT JOY LEFT$ LEN LN LOG MID$ MOD PEEK PEN PENX PENY PLACE POINT POINTER POS POT RCLR RDOT RGR RIGHT$ RLUM RND RSPCOLOR RSPPOS RSPRITE RWINDOW SCREEN$ SGN SIN SQR STR$ SYS TAN TEST USR VAL VAL$ XOR
modifier 6: BRIGHT FLASH INK INVERSE OVER PAPER
operator 15: AND NOT OR + – * / ↑ ** = < > <= >= <>
reserved variable 11: DS DS$ EL ER ERRLN ERRN PI ST TI TI$ π
separator 6: : ; , ’ ( ) "
special function 4: AT BIN SPC TAB
statement 190: ANGL APPEND ARC BACKUP BANK BCKGNDS BEEP BEGIN BEND BFLASH BLOAD BLOCK BOOT BORDER BOX BRIGHT BSAVE CALL CAT CATALOG CENTRE CGOTO CHAR CIRCLE CLEAR CLOSE CLOSE# CLR CLS CMD CMOB COLLECT COLLISION COLOR COLOUR CONCAT CONTINUE COPY CSET DATA DCLEAR DCLOSE DEF DELAY DESIGN DETECT DIM DIR DIRECTORY DISABLE DISAPA DISK DISPLAY DLOAD DO DOPEN DOWNB DOWNW DRAW DSAVE DUMP DVERIFY END END LOOP END PROC ENVELOPE ERASE EXEC EXIT EXIT IF FAST FCHR FCOL FETCH FILL FILTER FIND FLASH FOR FORMAT GET GETKEY GLOBAL GO GOSUB GOTO GRAPHIC GSHAPE HEADER HI COL HIRES HRDCPY IF INK INPUT INPUT# INV INVERSE KEY LEFTB LEFTW LET LINE LLIST LOCAL LOCATE LOOP LOW COL LPRINT MEM MERGE MMOB MOB OFF MOB SET MOVE MOVSPR MULTI MUSIC NEXT NO ERROR NRM OFF ON ON ERROR ON KEY OPEN OPEN# OUT OVER PAINT PAPER PAUSE PLAY PLOT POKE PRINT PRINT# PROC PUDEF RAND RANDOMIZE RCOMP READ REC RECORD REM RENAME REPEAT RESET RESTORE RESUME RETRACE RETURN RIGHTB RIGHTW RLOCMOB ROT SCALE SCNCLR SCRATCH SCRLD SCRSV SCROLL SLEEP SLOW SOUND SPRCOLOR SPRITE SPRSAV SSHAPE STASH SWAP STOP TEMPO TEXT TRACE TRAP TROFF TRON UNPLOT UNTIL UPB UPW USE VOL WAIT WAVE WIDTH WINDOW @
symbol 5: "" # $ % ?
DIALECTS
all 54: ABS AND ATN CHR$ COS DIM EXP FOR GOSUB GOTO INPUT INT LEN LET LIST LOG NEW NEXT NOT OR PEEK POKE PRINT REM RESTORE RETURN RND RUN SGN SIN SQR STEP STOP STR$ TAB TAN THEN TO VAL ; , + – * / = < > <= >= <> ( ) " $
all, except Sinclair 7: ASC END LEFT$ MID$ RIGHT$ % ?
all, except ZX81 3: DATA READ :
C128 39: APPEND B BANK BEGIN BEND BLOAD BOOT BSAVE BUMP CATALOG COLLISION CONCAT DCLEAR DCLOSE DOPEN DVERIFY FAST FILTER MOVSPR P PEN POINTER RECORD RSPCOLOR RSPPOS RSPRITE RWINDOW SLEEP SLOW SPRCOLOR SPRDEF SPRITE SPRSAV STASH SWAP TEMPO WIDTH WINDOW XOR
Commodore 28: CLOSE CLR CMD CONT DEF FN FRE GET GO IF INPUT# LOAD ON OPEN POS PRINT# SAVE SPC ST SYS TI TI$ USR VERIFY WAIT ↑ # π
Plus/4 58: AUTO BACKUP BOX CHAR CIRCLE COLLECT COLOR COPY D DEC DELETE DIRECTORY DLOAD DO DRAW DS DS$ DSAVE EL ELSE ER ERR$ EXIT GETKEY GRAPHIC GSHAPE HEADER HELP HEX$ I INSTR JOY KEY LOCATE LOOP MONITOR PAINT PUDEF RCLR RDOT RENAME RENUMBER RESUME RGR RLUM SCALE SCNCLR SCRATCH SOUND SSHAPE TRAP TROFF TRON U UNTIL USING VOL WHILE
Simons 95: ANGL ARC BCKGNDS BFLASH BLOCK CALL CENTRE CGOTO CHECK CMOB COLD COLOUR CSET DELAY DESIGN DETECT DIR DISABLE DISAPA DISK DISPLAY DIV DOWNB DOWNW DUMP DUP ELSE END LOOP END PROC ENVELOPE ERRLN ERRN EXEC EXIT IF EXOR FCHR FCOL FETCH FILL FIND FRAC GLOBAL HI COL HIRES HRDCPY INKEY INSERT INST INV LEFTB LEFTW LINE LOCAL LOW COL MEM MMOB MOB OFF MOB SET MOD MULTI MUSIC NO ERROR NRM OFF OLD ON ERROR ON KEY OPTION PAGE PENX PENY PLACE PLAY POT PROC RCOMP REC REPEAT RESET RETRACE RIGHTB RIGHTW RLOCMOB ROT SCRLD SCRSV SECURE TEST TEXT TRACE UPB UPW USE WAVE @
Sinclair 11: ACS ASN AT CLEAR CLS CODE INKEY$ LLIST LN LPRINT USR
Spectrum 27: ATTR BEEP BIN BORDER BRIGHT CAT CLOSE# CONTINUE ERASE FLASH FORMAT IN INK INVERSE MERGE MOVE OPEN# OUT OVER PAPER PI POINT RANDOMIZE SCREEN$ VAL$ ’ ↑
ZX81 11: CONT FAST PAUSE PLOT RAND SCROLL SLOW UNPLOT ** "" π
TAGS
arithmetics 23: ABS BIN DIV EXP FRAC HEX$ INT LN LOG MOD PI RAND RANDOMIZE RND SGN SQR + – * / ↑ ** ( )
characters 1: @
clock 2: TI TI$
coding 18: AUTO CONT CONTINUE DELAY DELETE DISAPA FIND HELP LIST MONITOR NEW OLD OPTION PAGE REM RENUMBER RUN SECURE
colors 4: COLOR HI COL LOW COL MULTI
errors 14: EL ER ERR$ ERRLN ERRN NO ERROR ON ERROR OUT RESUME RETRACE TRACE TRAP TROFF TRON
execution 35: BEGIN BEND CALL CGOTO DEF DISABLE DO END END LOOP END PROC EXEC EXIT EXIT IF FN FOR GO GOSUB GOTO IF LOOP NEXT ON PAUSE PROC RCOMP REPEAT RETURN SLEEP STOP SYS THEN UNTIL USR WAIT WHILE
files 20: APPEND BLOAD BOOT BSAVE CLOSE CONCAT COPY DCLOSE DIR DIRECTORY DLOAD DOPEN DSAVE DVERIFY MERGE OPEN RECORD SCRATCH SCRLD SCRSV
floppy 2: BACKUP COLLECT
graphics 38: ANGL ARC ATTR BLOCK BOX BRIGHT CHAR CIRCLE DRAW FLASH GRAPHIC GSHAPE HIRES HRDCPY INK INVERSE LINE LOCATE MULTI OVER PAINT PAPER PLOT POINT RCLR RDOT REC RGR RLUM ROT SCALE SCNCLR SCREEN$ SSHAPE TEST TEXT UNPLOT WIDTH
keyboard 8: DISPLAY GET GETKEY INKEY INKEY$ KEY ON KEY RESUME
logics 10: AND EXOR NOT OR = < > <= >= <>
memory 9: BANK FETCH FRE MEM PEEK POINTER POKE STASH SWAP
peripherals 35: B CAT CATALOG CLOSE# CMD D DCLEAR DELETE DISK DS DS$ ERASE FORMAT GET HEADER I IN JOY LOAD MOVE ON OPEN# OUT P PEN PENX PENY POT PRINT# RENAME SAVE ST STEP U VERIFY
printing 3: COPY LLIST LPRINT
screen 43: AT BCKGNDS BFLASH BORDER CENTRE CHAR CLS COLOUR CSET DESIGN DOWNB DOWNW FAST FCHR FCOL FILL GRAPHIC INV LEFTB LEFTW MOVE NRM OFF POS PRINT PUDEF RCLR RIGHTB RIGHTW RLUM RWINDOW SCNCLR SCRLD SCRSV SCROLL SLOW SPC TAB UPB UPW USE USING WINDOW
sound 7: BEEP ENVELOPE FILTER MUSIC PLAY SOUND VOL
sounds 2: TEMPO WAVE
sprites 17: BUMP CHECK CMOB COLLISION DETECT MMOB MOB OFF MOB SET MOVSPR RLOCMOB RSPCOLOR RSPPOS RSPRITE SPRCOLOR SPRDEF SPRSAV @
strings 18: ASC CHR$ CODE DEC DUP INSERT INST INSTR LEFT$ LEN MID$ PLACE RIGHT$ STR$ VAL VAL$ " ""
syntax 11: TO : ; , ’ = ( ) # $ % ?
system 1: COLD
trigonometry 6: ACS ASN ATN COS SIN TAN
variables 16: CLEAR CLR DATA DIM DUMP FETCH GLOBAL INPUT INPUT# LET LINE LOCAL POINTER READ RESET RESTORE