<s>
Sinclair	B-Language
BASIC	I-Language
is	O
a	O
dialect	O
of	O
the	O
programming	O
language	O
BASIC	O
used	O
in	O
the	O
8-bit	O
home	O
computers	O
from	O
Sinclair	O
Research	O
and	O
Timex	O
Sinclair	O
.	O
</s>
<s>
The	O
Sinclair	B-Language
BASIC	I-Language
interpreter	B-Application
was	O
made	O
by	O
Nine	O
Tiles	O
Networks	O
Ltd	O
.	O
</s>
<s>
Sinclair	B-Language
BASIC	I-Language
was	O
originally	O
developed	O
in	O
1979	O
for	O
the	O
ZX80	B-Operating_System
by	O
Nine	O
Tiles	O
.	O
</s>
<s>
It	O
was	O
initially	O
an	O
incomplete	O
implementation	O
of	O
the	O
1978	O
American	O
National	O
Standards	O
Institute	O
(	O
ANSI	O
)	O
minimal	O
BASIC	O
standard	O
with	O
integer	O
arithmetic	O
only	O
,	O
termed	O
4K	O
BASIC	O
(	O
for	O
its	O
ROM	B-Device
size	O
)	O
for	O
the	O
ZX80	B-Operating_System
.	O
</s>
<s>
It	O
evolved	O
through	O
the	O
floating-point	O
8K	O
BASIC	O
for	O
the	O
ZX81	O
and	O
T/S	B-Device
1000	I-Device
(	O
which	O
was	O
also	O
available	O
as	O
an	O
upgrade	O
for	O
the	O
ZX80	B-Operating_System
)	O
,	O
and	O
became	O
an	O
almost	O
complete	O
version	O
in	O
the	O
16KB	O
ROM	B-Device
ZX	B-Operating_System
Spectrum	I-Operating_System
(	O
known	O
as	O
48K	O
BASIC	O
)	O
.	O
</s>
<s>
It	O
is	O
present	O
in	O
all	O
ZX	B-Operating_System
Spectrum	I-Operating_System
compatibles	O
and	O
clones	B-Architecture
,	O
with	O
more	O
advanced	O
systems	O
also	O
offering	O
expanded	O
versions	O
like	O
128K	O
BASIC	O
,	O
+3	O
BASIC	O
,	O
T/S	O
2000	O
BASIC	O
,	O
BASIC64	O
or	O
Timex	O
Extended	O
Basic	O
.	O
</s>
<s>
As	O
of	O
2015	O
,	O
interpreters	B-Application
exist	O
for	O
modern	O
operating	O
systems	O
,	O
and	O
older	O
systems	O
,	O
that	O
allow	O
Sinclair	B-Language
Basic	I-Language
to	O
be	O
used	O
easily	O
.	O
</s>
<s>
On	O
the	O
16K/48K	O
ZX	B-Operating_System
Spectrum	I-Operating_System
(	O
48K	O
BASIC	O
)	O
,	O
there	O
are	O
88	O
keywords	O
in	O
Sinclair	B-Language
BASIC	I-Language
,	O
denoting	O
commands	O
(	O
of	O
which	O
there	O
are	O
50	O
)	O
,	O
functions	O
and	O
logical	O
operators	O
(	O
31	O
)	O
,	O
and	O
other	O
keywords	O
(	O
16	O
,	O
including	O
9	O
which	O
are	O
also	O
commands	O
or	O
functions	O
)	O
:	O
</s>
<s>
On	O
the	O
Spectrum	O
16K	O
and	O
48K	O
,	O
Extended	O
Mode	O
is	O
entered	O
by	O
pressing	O
and	O
simultaneously	O
rather	O
than	O
the	O
key	O
that	O
is	O
present	O
on	O
the	O
Spectrum+	O
and	O
later	O
models.TypeSummaryABSnumber	O
then	O
FunctionReturns	O
the	O
absolute	O
value	O
of	O
numberACSnumber	O
then	O
FunctionReturns	O
the	O
arccosine	O
of	O
numberANDLogical	O
operatorReturns	O
true	O
if	O
both	O
conditions	O
on	O
either	O
side	O
of	O
the	O
AND	O
keyword	O
are	O
true	O
,	O
else	O
returns	O
falseASNnumber	O
then	O
FunctionReturns	O
the	O
arcsine	O
of	O
numberATline	O
,	O
column	O
;	O
OtherUsed	O
in	O
a	O
PRINT	O
statement	O
to	O
print	O
at	O
the	O
line	O
and	O
column	O
specified	O
;	O
for	O
example	O
,	O
PRINT	O
AT	O
5	O
,	O
10	O
;"*"	O
puts	O
a	O
star	O
in	O
column	O
10	O
of	O
line	O
5.ATNnumber	O
then	O
FunctionReturns	O
the	O
arctangent	O
of	O
numberATTR(line, column )	O
then	O
FunctionReturns	O
a	O
byte	B-Application
containing	O
information	O
on	O
the	O
colours	O
of	O
the	O
text	O
cell	O
on	O
the	O
screen	O
,	O
corresponding	O
to	O
the	O
specified	O
line	O
and	O
column	O
;	O
note	O
that	O
,	O
unlike	O
most	O
Sinclair	B-Language
BASIC	I-Language
keywords	O
,	O
the	O
parentheses	O
are	O
required	O
;	O
the	O
first	O
three	O
bits	O
indicate	O
the	O
ink	O
(	O
foreground	O
)	O
colour	O
,	O
the	O
fourth	O
,	O
fifth	O
and	O
sixth	O
bits	O
the	O
paper	O
(	O
background	O
)	O
colour	O
,	O
the	O
seventh	O
bit	O
whether	O
the	O
colours	O
are	O
bright	O
or	O
not	O
,	O
and	O
the	O
eight	O
,	O
whether	O
they	O
are	O
flashingBEEPduration	O
,	O
pitch	O
then	O
CommandProduces	O
sound	O
from	O
the	O
computer	O
's	O
speaker	O
;	O
duration	O
is	O
in	O
seconds	O
,	O
pitch	O
is	O
in	O
semitones	O
above	O
(	O
positive	O
value	O
)	O
or	O
below	O
(	O
negative	O
value	O
)	O
middle	O
CBINnumber	O
then	O
OtherIndicates	O
number	O
is	O
in	O
binary	O
notationBORDERnumberCommandSets	O
the	O
border	O
of	O
the	O
screen	O
to	O
the	O
colour	O
specified	O
by	O
the	O
numberBRIGHTnumber	O
then	O
Command/otherMakes	O
all	O
following	O
colours	O
brighter	O
if	O
number	O
is	O
1	O
,	O
or	O
its	O
normal	O
shade	O
if	O
0CATnumber	O
then	O
CommandDisplays	O
contents	O
of	O
ZX	B-Device
Microdrive	I-Device
specified	O
by	O
numberCHR$number	O
then	O
FunctionReturns	O
the	O
character	O
corresponding	O
to	O
the	O
decimal	O
number	O
in	O
the	O
computer	O
's	O
character	O
setCIRCLEx	O
,	O
y	O
,	O
r	O
then	O
CommandDraws	O
a	O
circle	O
with	O
its	O
centre	O
at	O
coordinates	O
(	O
x	O
,	O
y	O
)	O
and	O
radius	O
rCLEARaddressCommandClears	O
the	O
screen	O
,	O
all	O
variables	O
and	O
the	O
GO	O
SUB	O
stack	O
,	O
and	O
optionally	O
sets	O
the	O
maximum	O
RAM	B-Architecture
address	O
to	O
be	O
used	O
by	O
BASICCLOSE	O
#number	O
then	O
CommandCloses	O
the	O
specified	O
stream	O
number	O
for	O
accessCLSCommandClears	O
all	O
text	O
and	O
graphics	O
from	O
the	O
screenCODEstring	O
then	O
Function/otherReturns	O
the	O
number	O
corresponding	O
to	O
the	O
first	O
character	O
in	O
string	O
in	O
the	O
computer	O
's	O
character	O
set	O
;	O
also	O
used	O
to	O
save	O
arbitrary	O
chunks	O
memory	O
to	O
tape	O
,	O
disk	O
,	O
etc	O
.	O
</s>
<s>
When	O
used	O
in	O
a	O
SAVE	O
statement	O
so	O
that	O
when	O
the	O
BASIC	O
program	O
being	O
saved	O
is	O
loaded	O
again	O
,	O
it	O
starts	O
automatically	O
at	O
the	O
line	O
number	O
indicatedLIST[number]CommandOutputs	O
the	O
current	O
BASIC	O
program	O
to	O
the	O
screen	O
;	O
if	O
the	O
optional	O
number	O
is	O
provided	O
,	O
it	O
omits	O
all	O
lines	O
with	O
a	O
lower	O
numberLLIST[number]	O
then	O
CommandAs	O
LIST	O
except	O
the	O
listing	O
is	O
output	O
to	O
the	O
printerLNnumber	O
then	O
FunctionReturns	O
the	O
natural	O
logarithm	O
of	O
numberLOAD"[filename]"	O
[	O
CODE	O
[	O
address[ 	O
,	O
length ] ]|	O
DATA	O
variable( )	O
]	O
CommandLoads	O
a	O
program	O
or	O
data	O
into	O
RAM	B-Architecture
from	O
tape	O
,	O
ZX	B-Device
Microdrive	I-Device
,	O
disk	O
,	O
etc.	O
,	O
deleting	O
any	O
existing	O
BASIC	O
program	O
and	O
variables	O
;	O
if	O
an	O
empty	O
string	O
(""	O
)	O
is	O
provided	O
,	O
this	O
loads	O
the	O
first	O
program	O
found	O
,	O
else	O
it	O
will	O
search	O
the	O
tape	O
for	O
the	O
program	O
named	O
in	O
the	O
string	O
;	O
if	O
the	O
optional	O
CODE	O
is	O
provided	O
,	O
will	O
load	O
the	O
program	O
into	O
memory	O
at	O
the	O
address	O
it	O
had	O
when	O
it	O
was	O
saved	O
,	O
or	O
at	O
the	O
specified	O
address	O
(	O
length	O
is	O
intended	O
as	O
a	O
safety	O
,	O
to	O
try	O
and	O
load	O
the	O
right	O
program	O
in	O
case	O
there	O
are	O
multiple	O
on	O
the	O
tape	O
with	O
the	O
right	O
name	O
but	O
of	O
different	O
lengths	O
)	O
;	O
if	O
the	O
optional	O
DATA	O
variable( )	O
is	O
provided	O
,	O
will	O
load	O
the	O
data	O
from	O
the	O
tape	O
into	O
the	O
array	O
named	O
variable( )	O
LPRINTtext	O
then	O
CommandAs	O
PRINT	O
except	O
output	O
is	O
sent	O
to	O
the	O
printerMERGE"[filename]"	O
then	O
CommandAs	O
LOAD	O
,	O
except	O
it	O
does	O
not	O
delete	O
the	O
current	O
program	O
and	O
variables	O
;	O
if	O
a	O
line	O
number	O
exists	O
in	O
both	O
,	O
that	O
of	O
the	O
newly	O
loaded	O
program	O
overwrites	O
the	O
existing	O
one	O
.	O
</s>
<s>
to	O
anotherNEWCommandErases	O
the	O
current	O
BASIC	O
program	O
and	O
all	O
variablesNEXTvariableCommandCloses	O
a	O
FOR-NEXT	O
loop	O
;	O
the	O
variable	O
must	O
match	O
that	O
of	O
the	O
corresponding	O
FOR	O
command	O
—	O
"	O
empty	O
"	O
NEXTs	O
to	O
refer	O
to	O
the	O
immediately	O
preceding	O
FOR	O
in	O
the	O
program	O
are	O
not	O
allowedNOTconditionLogical	O
operatorReturns	O
true	O
if	O
the	O
condition	O
is	O
false	O
,	O
else	O
returns	O
falseOPEN	O
#stream	O
then	O
CommandOpens	O
a	O
stream	O
for	O
reading	O
from	O
and/or	O
writing	O
toORLogical	O
operatorReturns	O
true	O
if	O
either	O
of	O
the	O
conditions	O
on	O
either	O
side	O
of	O
the	O
OR	O
keyword	O
are	O
true	O
,	O
else	O
returns	O
falseOUTaddress	O
,	O
value	O
then	O
Commandinput/output	O
port ]	O
corresponding	O
to	O
the	O
addressOVERnumber	O
then	O
Command/otherWill	O
make	O
following	O
text	O
overprint	O
with	O
an	O
XOR	O
operation	O
what	O
is	O
already	O
on	O
the	O
screen	O
if	O
number	O
is	O
1	O
,	O
instead	O
of	O
erasing	O
it	O
,	O
or	O
erase	O
it	O
if	O
number	O
is	O
0PAPERnumber	O
then	O
Command/otherSets	O
the	O
background	O
colour	O
for	O
text	O
and	O
graphicsPAUSEdelayCommandHalts	O
program	O
execution	O
for	O
the	O
specified	O
delay	O
,	O
in	O
of	O
a	O
second	O
in	O
Europe	O
or	O
in	O
North	O
America	O
(	O
thus	O
,	O
PAUSE	O
50	O
halts	O
for	O
one	O
second	O
in	O
Europe	O
)	O
PEEKaddress	O
then	O
FunctionReturns	O
a	O
byte	B-Application
representing	O
the	O
contents	O
of	O
the	O
memory	O
location	O
pointed	O
to	O
by	O
addressPI	O
then	O
FunctionReturns	O
the	O
value	O
of	O
piPLOTx	O
,	O
yCommandDraws	O
a	O
pixel	O
in	O
the	O
current	O
INK	O
colour	O
on	O
the	O
screen	O
at	O
the	O
coordinates	O
(	O
x	O
,	O
y	O
)	O
POINT(x,y )	O
then	O
FunctionReturns	O
1	O
if	O
the	O
pixel	O
pointed	O
at	O
graphical	O
coordinates	O
(	O
x	O
,	O
y	O
)	O
is	O
currently	O
in	O
the	O
ink	O
(	O
foreground	O
)	O
colour	O
,	O
else	O
returns	O
0POKEaddress	O
,	O
valueCommandSets	O
the	O
contents	O
of	O
address	O
in	O
RAM	B-Architecture
to	O
valuePRINT[ AT	O
x	O
,	O
y	O
;]	O
textCommandPrints	O
text	O
(	O
which	O
must	O
be	O
a	O
string	O
or	O
a	O
number	O
)	O
to	O
the	O
screen	O
;	O
if	O
used	O
with	O
AT	O
,	O
will	O
print	O
at	O
the	O
specified	O
text	O
coordinates	O
,	O
else	O
in	O
the	O
first	O
column	O
of	O
the	O
line	O
after	O
that	O
used	O
by	O
the	O
last	O
PRINT	O
statementRANDOMIZE[number]CommandInitializes	O
the	O
random	O
number	O
generator	O
;	O
if	O
used	O
without	O
a	O
number	O
(	O
or	O
with	O
0	O
)	O
,	O
it	O
does	O
this	O
based	O
on	O
the	O
computer	O
's	O
internal	O
clock	O
,	O
else	O
it	O
uses	O
the	O
number	O
supplied	O
,	O
which	O
must	O
be	O
in	O
the	O
range	O
[1,65535]READvariable	O
then	O
CommandTakes	O
a	O
value	O
from	O
a	O
DATA	O
statement	O
and	O
stores	O
it	O
in	O
the	O
named	O
variable	O
:	O
the	O
first	O
time	O
READ	O
is	O
used	O
,	O
it	O
gets	O
the	O
first	O
value	O
after	O
the	O
first	O
DATA	O
,	O
the	O
second	O
time	O
it	O
gets	O
the	O
next	O
one	O
,	O
and	O
so	O
onREMtextCommandBegins	O
a	O
comment	O
in	O
the	O
source	O
code	O
,	O
meaning	O
that	O
everything	O
after	O
the	O
REM	O
statement	O
is	O
ignored	O
,	O
until	O
the	O
end	O
of	O
the	O
line	O
—	O
note	O
this	O
includes	O
everything	O
after	O
a	O
colon	O
,	O
which	O
normally	O
begins	O
a	O
new	O
segment	O
:	O
10	O
REM	O
Nothing	O
to	O
see	O
here	O
:	O
PRINT	O
"	O
Unprintable	O
"	O
will	O
not	O
produce	O
any	O
output	O
,	O
for	O
exampleRESTORE[number]	O
then	O
CommandResets	O
where	O
READ	O
commands	O
look	O
for	O
values	O
in	O
DATA	O
statements	O
:	O
if	O
used	O
without	O
a	O
number	O
,	O
the	O
next	O
READ	O
will	O
use	O
the	O
first	O
DATA	O
in	O
the	O
program	O
,	O
with	O
a	O
number	O
it	O
will	O
use	O
the	O
first	O
DATA	O
on	O
or	O
after	O
the	O
line	O
whose	O
number	O
is	O
indicatedRETURNCommandReturns	O
execution	O
to	O
the	O
first	O
statement	O
following	O
the	O
last	O
GO	O
SUB	O
command	O
that	O
was	O
executedRND	O
then	O
FunctionReturns	O
a	O
pseudo-random	O
number	O
with	O
eight	O
significant	B-Architecture
figures	I-Architecture
in	O
the	O
range	O
[	O
0	O
,	O
1	O
)	O
RUN[number]CommandStarts	O
the	O
current	O
BASIC	O
program	O
,	O
from	O
its	O
first	O
line	O
if	O
no	O
number	O
is	O
specified	O
,	O
else	O
from	O
the	O
line	O
with	O
that	O
number	O
(	O
or	O
the	O
first	O
one	O
after	O
,	O
if	O
it	O
does	O
not	O
exist	O
)	O
SAVE	O
"	O
filename	O
"	O
[	O
DATA	O
variable( )	O
LINE	O
number ]CommandSaves	O
the	O
current	O
BASIC	O
program	O
to	O
tape	O
or	O
other	O
storage	O
device	O
,	O
with	O
the	O
filename	O
specified	O
;	O
if	O
the	O
optional	O
LINE	O
followed	O
by	O
a	O
line	O
number	O
is	O
used	O
,	O
then	O
the	O
program	O
will	O
start	O
automatically	O
at	O
the	O
indicated	O
line	O
number	O
when	O
it	O
is	O
LOADed	O
back	O
in	O
;	O
with	O
the	O
optional	O
DATA	O
,	O
the	O
command	O
saves	O
the	O
contents	O
of	O
the	O
array	O
named	O
by	O
the	O
variable	O
instead	O
of	O
the	O
current	O
BASIC	O
programSCREEN$[( line	O
,	O
column	O
)	O
]	O
then	O
+	O
Function/otherAs	O
a	O
function	O
,	O
identifies	O
the	O
character	O
at	O
the	O
specified	O
line	O
and	O
column	O
on	O
the	O
screen	O
.	O
</s>
<s>
Used	O
after	O
the	O
filename	O
in	O
a	O
LOAD	O
or	O
SAVE	O
command	O
,	O
indicates	O
that	O
the	O
contents	O
of	O
the	O
display	B-Algorithm
memory	I-Algorithm
should	O
be	O
loaded	O
or	O
saved	O
;	O
this	O
essentially	O
makes	O
it	O
a	O
shortcut	O
for	O
CODE	O
16384	O
,	O
6912The	O
Spectrum	O
’s	O
display	B-Algorithm
memory	I-Algorithm
starts	O
at	O
address	O
16384	O
and	O
is	O
6912	O
bytes	B-Application
long	O
but	O
does	O
not	O
work	O
with	O
VERIFY	O
because	O
the	O
contents	O
of	O
the	O
display	B-Algorithm
memory	I-Algorithm
will	O
be	O
different	O
by	O
the	O
time	O
that	O
command	O
reads	O
back	O
the	O
saved	O
data	O
;	O
SGNnumber	O
then	O
FunctionReturns	O
1	O
if	O
number	O
is	O
positive	O
,	O
0	O
if	O
it	O
is	O
0	O
,	O
and	O
−1	O
if	O
it	O
is	O
negativeSINnumber	O
then	O
FunctionReturns	O
the	O
sine	O
of	O
numberSTEPnumberOtherIndicates	O
the	O
interval	O
used	O
by	O
a	O
FOR	O
statement	O
,	O
for	O
example	O
FOR	O
n	O
=	O
2	O
TO	O
6	O
STEP	O
2	O
will	O
skip	O
n	O
=3	O
and	O
n	O
=	O
5	O
in	O
the	O
loopSTOPCommandEnds	O
execution	O
of	O
the	O
current	O
program	O
,	O
exiting	O
to	O
the	O
BASIC	O
editor	O
;	O
can	O
also	O
be	O
given	O
when	O
the	O
computer	O
is	O
waiting	O
for	O
input	O
using	O
the	O
INPUT	O
command	O
;	O
once	O
the	O
program	O
is	O
stopped	O
,	O
it	O
can	O
be	O
resumed	O
with	O
CONTINUESQRnumber	O
then	O
FunctionReturns	O
the	O
square	O
root	O
of	O
numberSTR$number	O
then	O
FunctionReturns	O
the	O
character	O
from	O
the	O
computer	O
's	O
character	O
set	O
corresponding	O
to	O
numberTABcolumn	O
then	O
OtherIn	O
a	O
PRINT	O
statement	O
,	O
makes	O
sure	O
that	O
the	O
text	O
to	O
be	O
output	O
begins	O
in	O
the	O
column	O
specified	O
,	O
wrapping	O
to	O
the	O
next	O
line	O
as	O
necessary	O
,	O
but	O
never	O
more	O
than	O
one	O
lineTANnumber	O
then	O
FunctionReturns	O
the	O
tangent	O
of	O
numberTHENstatementOtherFollows	O
the	O
condition	O
in	O
an	O
IF	O
statement	O
to	O
indicate	O
what	O
should	O
happen	O
when	O
the	O
condition	O
evaluates	O
to	O
trueTOOtherIndicates	O
a	O
range	O
from	O
the	O
number	O
to	O
the	O
left	O
of	O
TO	O
to	O
the	O
number	O
of	O
the	O
right	O
of	O
it	O
,	O
inclusive	O
;	O
when	O
used	O
with	O
FOR	O
both	O
numbers	O
must	O
be	O
supplied	O
,	O
while	O
if	O
used	O
to	O
slice	O
strings	O
,	O
either	O
may	O
be	O
left	O
off	O
to	O
indicate	O
the	O
start	O
or	O
end	O
of	O
the	O
stringUSRstring	O
or	O
address	O
then	O
FunctionWhen	O
called	O
with	O
a	O
single-character	O
string	O
,	O
this	O
returns	O
the	O
memory	O
address	O
at	O
which	O
the	O
glyph	B-Application
for	O
the	O
user-defined	O
graphic	O
character	O
corresponding	O
to	O
that	O
character	O
is	O
defined	O
.	O
</s>
<s>
If	O
called	O
with	O
an	O
address	O
,	O
it	O
starts	O
machine	B-Language
code	I-Language
execution	O
at	O
that	O
address	O
(	O
thus	O
making	O
it	O
one	O
of	O
the	O
few	O
Sinclair	B-Language
BASIC	I-Language
functions	O
to	O
have	O
a	O
Side	O
effect	O
)	O
and	O
returns	O
the	O
contents	O
of	O
the	O
Z80	O
’s	O
BC	O
register	B-General_Concept
pair.VALstring	O
then	O
FunctionEvaluates	O
the	O
string	O
as	O
a	O
number	O
and	O
returns	O
the	O
result	O
;	O
this	O
can	O
perform	O
calculations	O
:	O
VAL	O
"	O
1+2	O
"	O
returns	O
3	O
,	O
for	O
example	O
,	O
and	O
also	O
evaluates	O
variables	O
and	O
even	O
other	O
VAL	O
statements	O
:	O
LET	O
a	O
=	O
1	O
:	O
VAL	O
"	O
a+VAL	O
""	O
2	O
"""	O
A	O
string	O
inside	O
a	O
string	O
must	O
have	O
its	O
quotes	O
doubled	O
in	O
Sinclair	B-Language
BASIC	I-Language
also	O
returns	O
3VAL$string	O
then	O
FunctionSimilar	O
to	O
VAL	O
but	O
evaluates	O
the	O
string	O
as	O
a	O
stringVERIFY"[filename]"	O
then	O
CommandReads	O
a	O
program	O
or	O
data	O
from	O
tape	O
or	O
other	O
storage	O
,	O
much	O
like	O
LOAD	O
,	O
but	O
instead	O
of	O
loading	O
it	O
into	O
memory	O
,	O
compares	O
it	O
with	O
the	O
program	O
or	O
data	O
that	O
is	O
already	O
in	O
memory	O
.	O
</s>
<s>
The	O
ZX81	O
8K	O
BASIC	O
used	O
the	O
shorter	O
forms	O
GOTO	O
,	O
GOSUB	O
,	O
CONT	O
and	O
RAND	O
,	O
whereas	O
the	O
Spectrum	B-Operating_System
48K	I-Operating_System
BASIC	O
used	O
the	O
longer	O
forms	O
GO	O
TO	O
,	O
GO	O
SUB	O
,	O
CONTINUE	O
and	O
RANDOMIZE	O
.	O
</s>
<s>
The	O
ZX80	B-Operating_System
4K	O
BASIC	O
also	O
used	O
these	O
longer	O
forms	O
but	O
differed	O
by	O
using	O
the	O
spelling	O
RANDOMISE	O
.	O
</s>
<s>
The	O
ZX80	B-Operating_System
4K	O
BASIC	O
had	O
the	O
exclusive	O
function	O
TL$( 	O
)	O
;	O
it	O
was	O
equivalent	O
to	O
the	O
string	O
operator	O
in	O
later	O
versions	O
.	O
</s>
<s>
Unique	O
code	O
points	O
are	O
assigned	O
in	O
the	O
ZX80	B-Language
character	I-Language
set	I-Language
,	O
ZX81	B-Language
character	I-Language
set	I-Language
and	O
ZX	B-Operating_System
Spectrum	I-Operating_System
character	O
set	O
for	O
each	O
keyword	O
or	O
multi-character	O
operator	O
,	O
i.e.	O
</s>
<s>
These	O
are	O
expanded	O
by	O
referencing	O
a	O
token	O
table	O
in	O
ROM	B-Device
.	O
</s>
<s>
Thus	O
,	O
a	O
keyword	O
uses	O
one	O
byte	B-Application
of	O
memory	O
only	O
,	O
a	O
significant	O
saving	O
over	O
traditional	O
letter-by-letter	O
storage	O
.	O
</s>
<s>
This	O
also	O
meant	O
that	O
the	O
BASIC	B-Language
interpreter	I-Language
could	O
quickly	O
determine	O
any	O
command	O
or	O
function	O
by	O
evaluating	O
one	O
byte	B-Application
,	O
and	O
that	O
the	O
keywords	O
need	O
not	O
be	O
reserved	O
words	O
like	O
in	O
other	O
BASIC	O
dialects	O
or	O
other	O
programming	O
languages	O
,	O
e.g.	O
,	O
it	O
is	O
allowed	O
to	O
define	O
a	O
variable	O
named	O
PRINT	O
and	O
output	O
its	O
value	O
with	O
PRINT	O
PRINT	O
.	O
</s>
<s>
Further	O
,	O
it	O
meant	O
that	O
unlike	O
other	O
BASIC	O
dialects	O
,	O
the	O
interpreter	B-Application
needed	O
no	O
parentheses	O
to	O
identify	O
functions	O
;	O
SIN	O
x	O
was	O
sufficient	O
,	O
no	O
SIN(x )	O
needed	O
(	O
though	O
the	O
latter	O
was	O
allowed	O
)	O
.	O
</s>
<s>
The	O
4K	O
BASIC	O
ROM	B-Device
of	O
the	O
ZX80	B-Operating_System
had	O
a	O
short	O
list	O
of	O
exceptions	O
to	O
this	O
:	O
the	O
functions	O
CHR$( 	O
)	O
,	O
STR$( 	O
)	O
,	O
TL$( 	O
)	O
,	O
PEEK( )	O
,	O
CODE( )	O
,	O
RND( )	O
,	O
USR( )	O
and	O
ABS( )	O
did	O
not	O
have	O
one-byte	O
tokens	O
but	O
were	O
typed	O
in	O
letter-by-letter	O
and	O
required	O
the	O
parentheses	O
.	O
</s>
<s>
128	O
BASIC	O
,	O
present	O
on	O
ZX	B-Operating_System
Spectrum	I-Operating_System
128	O
,	O
+2	O
,	O
+3	O
,	O
+2A	O
,	O
and	O
+2B	O
,	O
stored	O
keywords	O
internally	O
in	O
one-byte	O
code	O
points	O
,	O
but	O
used	O
a	O
conventional	O
letter-by-letter	O
BASIC	O
input	O
system	O
.	O
</s>
<s>
The	O
original	O
Spanish	O
ZX	B-Operating_System
Spectrum	I-Operating_System
128	O
included	O
four	O
additional	O
BASIC	O
editor	O
commands	O
in	O
Spanish	O
,	O
one	O
of	O
which	O
was	O
undocumented	O
:	O
</s>
<s>
Unlike	O
the	O
LEFT$( 	O
)	O
,	O
MID$( 	O
)	O
and	O
RIGHT$( 	O
)	O
functions	O
used	O
in	O
the	O
ubiquitous	O
Microsoft	B-Language
BASIC	I-Language
dialects	O
for	O
home	O
computers	O
,	O
parts	O
of	O
strings	O
in	O
Sinclair	B-Language
BASIC	I-Language
are	O
accessed	O
by	O
numeric	O
range	O
.	O
</s>
<s>
4K	O
BASIC	O
for	O
ZX80	B-Operating_System
(	O
so	O
named	O
for	O
residing	O
in	O
4KiB	O
read-only	B-Device
memory	I-Device
(	O
ROM	B-Device
)	O
)	O
,	O
was	O
developed	O
by	O
John	O
Grant	O
of	O
Nine	O
Tiles	O
for	O
the	O
ZX80	B-Operating_System
.	O
</s>
<s>
8K	O
BASIC	O
is	O
the	O
ZX81	O
BASIC	O
(	O
also	O
available	O
as	O
an	O
upgrade	O
for	O
the	O
ZX80	B-Operating_System
)	O
,	O
updated	O
with	O
floating-point	O
arithmetic	O
by	O
Steve	O
Vickers	O
,	O
so	O
named	O
for	O
residing	O
in	O
8KiB	O
ROM	B-Device
.	O
</s>
<s>
48	O
BASIC	O
is	O
the	O
BASIC	O
for	O
the	O
original	O
16/48KB	O
RAM	B-Architecture
ZX	B-Operating_System
Spectrum	I-Operating_System
(	O
and	O
clones	B-Architecture
)	O
,	O
with	O
colour	O
and	O
more	O
peripherals	O
added	O
by	O
Steve	O
Vickers	O
and	O
John	O
Grant	O
.	O
</s>
<s>
128	O
BASIC	O
is	O
the	O
BASIC	O
for	O
the	O
ZX	B-Operating_System
Spectrum	I-Operating_System
128	O
.	O
</s>
<s>
+3	O
BASIC	O
is	O
the	O
BASIC	O
with	O
disk	O
support	O
for	O
the	O
ZX	B-Operating_System
Spectrum	I-Operating_System
+3	O
and	O
+2A	O
.	O
</s>
<s>
T/S	O
2000	O
BASIC	O
is	O
used	O
on	O
the	O
Spectrum-compatible	O
Timex	B-Device
Sinclair	I-Device
2068	I-Device
(	O
T/S	B-Device
2068	I-Device
)	O
and	O
adds	O
the	O
following	O
six	O
new	O
keywords	O
:	O
</s>
<s>
FREE	O
is	O
a	O
function	O
that	O
gives	O
the	O
amount	O
of	O
free	O
RAM	B-Architecture
.	O
</s>
<s>
PRINT	O
FREE	O
will	O
show	O
how	O
much	O
RAM	B-Architecture
is	O
free	O
.	O
</s>
<s>
Two	O
versions	O
exist	O
due	O
to	O
different	O
memory	O
maps	O
-	O
a	O
version	O
for	O
TC	B-Device
2048	I-Device
and	O
a	O
version	O
for	O
T/S	B-Device
2068	I-Device
and	O
TC	B-Device
2068	I-Device
.	O
</s>
<s>
Timex	O
Extended	O
Basic	O
by	O
Timex	O
of	O
Portugal	O
is	O
used	O
on	O
the	O
Timex	B-Device
Computer	I-Device
3256	I-Device
,	O
adding	O
TEC	O
-	O
Timex	O
Extended	O
Commands	O
commands	O
supporting	O
the	O
AY-3-8912	B-Device
sound	O
chip	O
,	O
RS-232	O
network	O
and	O
the	O
512x192	O
pixel	O
high	O
resolution	O
graphic	O
mode	O
.	O
</s>
<s>
RAM	B-Architecture
drive	O
commands	O
:	O
LOAD	O
!	O
</s>
<s>
AY-3-8912	B-Device
commands	O
:	O
BEEP	O
!	O
</s>
<s>
Several	O
ZX	B-Operating_System
Spectrum	I-Operating_System
interpreters	B-Application
exist	O
.	O
</s>
<s>
Beta	B-Language
BASIC	I-Language
by	O
Dr.	O
Andy	O
Wright	O
,	O
was	O
originally	O
a	O
BASIC	B-Language
extension	I-Language
,	O
but	O
became	O
a	O
full	O
interpreter	B-Application
.	O
</s>
<s>
YS	B-Language
MegaBasic	I-Language
by	O
Mike	O
Leaman	O
.	O
</s>
<s>
Sea	O
Change	O
ROM	B-Device
by	O
Steve	O
Vickers	O
and	O
Ian	O
Logan	O
,	O
modified	O
by	O
Geoff	O
Wearmouth	O
,	O
a	O
replacement	O
ROM	B-Device
with	O
an	O
enhanced	O
Sinclair	B-Language
BASIC	I-Language
.	O
</s>
<s>
Gosh	O
Wonderful	O
by	O
Geoff	O
Wearmouth	O
,	O
a	O
replacement	O
ROM	B-Device
that	O
fixes	O
bugs	O
and	O
adds	O
a	O
tokenizer	O
,	O
stream	O
lister	O
,	O
delete	O
and	O
renumber	O
commands	O
.	O
</s>
<s>
Several	O
ZX	B-Operating_System
Spectrum	I-Operating_System
compilers	O
exist	O
.	O
</s>
<s>
HiSoft	B-Device
COLT	O
Compiler	O
(	O
a.k.a.	O
</s>
<s>
HiSoft	B-Device
BASIC	O
(	O
a.k.a.	O
</s>
<s>
ZX-Basicus	O
by	O
Juan-Antonio	O
Fernández-Madrigal	O
,	O
a	O
synthesizer	O
,	O
analyzer	O
,	O
optimizer	O
,	O
interpreter	B-Application
and	O
debugger	O
of	O
Sinclair	B-Language
BASIC	I-Language
48K	O
for	O
PCs	O
,	O
freely	O
downloadable	O
for	O
Linux	B-Application
and	O
Windows	O
.	O
</s>
