<s>
Applesoft	B-Language
BASIC	I-Language
is	O
a	O
dialect	O
of	O
Microsoft	B-Language
BASIC	I-Language
,	O
developed	O
by	O
Marc	O
McDonald	O
and	O
Ric	O
Weiland	O
,	O
supplied	O
with	O
the	O
Apple	B-Device
II	I-Device
series	I-Device
of	O
computers	O
.	O
</s>
<s>
It	O
supersedes	O
Integer	B-Language
BASIC	I-Language
and	O
is	O
the	O
BASIC	O
in	O
ROM	B-Device
in	O
all	O
Apple	B-Device
II	I-Device
series	I-Device
computers	O
after	O
the	O
original	O
Apple	B-Device
II	I-Device
model	O
.	O
</s>
<s>
It	O
is	O
also	O
referred	O
to	O
as	O
FP	O
BASIC	O
(	O
from	O
floating	B-Algorithm
point	I-Algorithm
)	O
because	O
of	O
the	O
Apple	B-Operating_System
DOS	I-Operating_System
command	O
used	O
to	O
invoke	O
it	O
,	O
instead	O
of	O
INT	O
for	O
Integer	B-Language
BASIC	I-Language
.	O
</s>
<s>
Applesoft	B-Language
BASIC	I-Language
was	O
supplied	O
by	O
Microsoft	O
and	O
its	O
name	O
is	O
derived	O
from	O
the	O
names	O
of	O
both	O
Apple	O
Computer	O
and	O
Microsoft	O
.	O
</s>
<s>
Apple	O
employees	O
,	O
including	O
Randy	O
Wigginton	O
,	O
adapted	O
Microsoft	O
's	O
interpreter	O
for	O
the	O
Apple	B-Device
II	I-Device
and	O
added	O
several	O
features	O
.	O
</s>
<s>
The	O
first	O
version	O
of	O
Applesoft	O
was	O
released	O
in	O
1977	O
on	O
cassette	B-Device
tape	I-Device
and	O
lacked	O
proper	O
support	O
for	O
high-resolution	O
graphics	O
.	O
</s>
<s>
Applesoft	O
II	O
,	O
which	O
was	O
made	O
available	O
on	O
cassette	O
and	O
disk	O
and	O
in	O
the	O
ROM	B-Device
of	O
the	O
Apple	B-Device
II	I-Device
Plus	O
and	O
subsequent	O
models	O
,	O
was	O
released	O
in	O
1978	O
.	O
</s>
<s>
It	O
is	O
this	O
latter	O
version	O
,	O
which	O
has	O
some	O
syntax	O
differences	O
and	O
support	O
for	O
the	O
Apple	B-Device
II	I-Device
high-resolution	O
graphics	O
modes	O
,	O
that	O
is	O
usually	O
synonymous	O
with	O
the	O
term	O
"	O
Applesoft.	O
"	O
</s>
<s>
A	O
compiler	O
for	O
Applesoft	B-Language
BASIC	I-Language
,	O
TASC	O
(	O
The	O
Applesoft	O
Compiler	O
)	O
,	O
was	O
released	O
by	O
Microsoft	O
in	O
1981	O
.	O
</s>
<s>
When	O
Steve	O
Wozniak	O
wrote	O
Integer	B-Language
BASIC	I-Language
for	O
the	O
Apple	B-Device
II	I-Device
,	O
he	O
did	O
not	O
implement	O
support	O
for	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
because	O
he	O
was	O
primarily	O
interested	O
in	O
writing	O
games	O
,	O
a	O
task	O
for	O
which	O
integers	O
alone	O
were	O
sufficient	O
.	O
</s>
<s>
In	O
1976	O
,	O
Microsoft	O
had	O
developed	O
Microsoft	B-Language
BASIC	I-Language
for	O
the	O
MOS	B-General_Concept
Technology	I-General_Concept
6502	I-General_Concept
,	O
but	O
at	O
the	O
time	O
there	O
was	O
no	O
production	O
computer	O
that	O
used	O
it	O
.	O
</s>
<s>
Upon	O
learning	O
that	O
Apple	O
had	O
a	O
6502	B-General_Concept
machine	O
,	O
Microsoft	O
asked	O
if	O
the	O
company	O
were	O
interested	O
in	O
licensing	O
BASIC	O
,	O
but	O
Steve	O
Jobs	O
replied	O
that	O
Apple	O
already	O
had	O
one	O
.	O
</s>
<s>
The	O
Apple	B-Device
II	I-Device
was	O
unveiled	O
to	O
the	O
public	O
at	O
the	O
West	O
Coast	O
Computer	O
Faire	O
in	O
April	O
1977	O
and	O
became	O
available	O
for	O
sale	O
in	O
June	O
.	O
</s>
<s>
One	O
of	O
the	O
most	O
common	O
customer	O
complaints	O
about	O
the	O
computer	O
was	O
BASIC	O
's	O
lack	O
of	O
floating-point	B-Algorithm
math	I-Algorithm
.	O
</s>
<s>
Making	O
things	O
more	O
problematic	O
was	O
that	O
the	O
rival	O
Commodore	B-Device
PET	I-Device
personal	O
computer	O
had	O
a	O
floating	O
point-capable	O
BASIC	O
interpreter	O
from	O
the	O
beginning	O
.	O
</s>
<s>
As	O
Wozniak	O
—	O
the	O
only	O
person	O
who	O
understood	O
Integer	B-Language
BASIC	I-Language
well	O
enough	O
to	O
add	O
floating	B-Algorithm
point	I-Algorithm
features	O
—	O
was	O
busy	O
with	O
the	O
Disk	B-Device
II	I-Device
drive	O
and	O
controller	O
and	O
with	O
Apple	B-Operating_System
DOS	I-Operating_System
,	O
Apple	O
turned	O
to	O
Microsoft	O
.	O
</s>
<s>
Apple	O
reportedly	O
obtained	O
an	O
eight-year	O
license	O
for	O
Applesoft	B-Language
BASIC	I-Language
from	O
Microsoft	O
for	O
a	O
flat	O
fee	O
of	O
$31	O
,	O
000	O
,	O
renewing	O
it	O
in	O
1985	O
through	O
an	O
arrangement	O
that	O
gave	O
Microsoft	O
the	O
rights	O
and	O
source	O
code	O
for	O
Apple	O
's	O
Macintosh	B-Language
version	I-Language
of	I-Language
BASIC	I-Language
.	O
</s>
<s>
Applesoft	O
was	O
designed	O
to	O
be	O
backwards-compatible	O
with	O
Integer	B-Language
BASIC	I-Language
and	O
uses	O
the	O
core	O
of	O
Microsoft	O
's	O
6502	B-General_Concept
BASIC	O
implementation	O
,	O
which	O
includes	O
using	O
the	O
GET	O
command	O
for	O
detecting	O
key	O
presses	O
and	O
not	O
requiring	O
any	O
spaces	O
on	O
program	O
lines	O
.	O
</s>
<s>
While	O
Applesoft	B-Language
BASIC	I-Language
is	O
slower	O
than	O
Integer	B-Language
BASIC	I-Language
,	O
it	O
has	O
many	O
features	O
that	O
the	O
older	O
BASIC	O
lacks	O
:	O
</s>
<s>
Atomic	O
strings	O
:	O
A	O
string	O
is	O
no	O
longer	O
an	O
array	O
of	O
characters	O
(	O
as	O
in	O
Integer	B-Language
BASIC	I-Language
and	O
C	B-Language
)	O
;	O
it	O
is	O
instead	O
a	O
garbage-collected	B-General_Concept
object	O
(	O
as	O
in	O
Scheme	B-Language
and	O
Java	B-Language
)	O
.	O
</s>
<s>
Conversely	O
,	O
Applesoft	O
lacks	O
the	O
MOD	O
(	O
remainder	O
)	O
operator	O
from	O
Integer	B-Language
BASIC	I-Language
.	O
</s>
<s>
Adapting	O
BASIC	O
for	O
the	O
Apple	B-Device
II	I-Device
was	O
a	O
tedious	O
job	O
as	O
Apple	O
received	O
a	O
source	O
listing	O
for	O
Microsoft	O
6502	B-General_Concept
BASIC	O
which	O
proved	O
to	O
be	O
buggy	O
and	O
also	O
required	O
the	O
addition	O
of	O
Integer	B-Language
BASIC	I-Language
commands	O
.	O
</s>
<s>
Since	O
Apple	O
had	O
no	O
6502	B-General_Concept
assembler	O
on	O
hand	O
,	O
the	O
development	O
team	O
was	O
forced	O
to	O
send	O
the	O
source	O
code	O
over	O
the	O
phone	O
lines	O
to	O
Call	O
Computer	O
,	O
an	O
outfit	O
that	O
offered	O
compiler	O
services	O
.	O
</s>
<s>
This	O
was	O
an	O
extremely	O
tedious	O
,	O
slow	O
process	O
and	O
after	O
Call	O
Computer	O
lost	O
the	O
source	O
code	O
due	O
to	O
an	O
equipment	O
malfunction	O
,	O
one	O
of	O
the	O
programmers	O
,	O
Cliff	O
Huston	O
,	O
used	O
his	O
own	O
IMSAI	O
8080	O
computer	O
to	O
cross	B-Language
assemble	I-Language
the	O
BASIC	O
source	O
.	O
</s>
<s>
Applesoft	O
is	O
similar	O
to	O
Commodore	O
's	O
BASIC	O
2.0	O
aside	O
from	O
features	O
inherited	O
from	O
Integer	B-Language
BASIC	I-Language
.	O
</s>
<s>
As	O
with	O
Commodore	O
BASIC	O
,	O
numeric	B-Algorithm
variables	O
are	O
stored	O
as	O
40-bit	O
floating	B-Algorithm
point	I-Algorithm
;	O
each	O
variable	O
requires	O
five	O
bytes	O
of	O
memory	O
.	O
</s>
<s>
The	O
programmer	O
may	O
designate	O
variables	O
as	O
integer	O
by	O
following	O
them	O
with	O
a	O
percent	O
sign	O
,	O
in	O
which	O
case	O
they	O
use	O
two	O
bytes	O
and	O
are	O
limited	O
to	O
a	O
range	O
of	O
-32768	O
to	O
32767	O
;	O
however	O
BASIC	O
internally	O
converts	O
them	O
back	O
to	O
floating	B-Algorithm
point	I-Algorithm
when	O
performing	O
calculations	O
,	O
while	O
each	O
percent	O
sign	O
also	O
takes	O
an	O
additional	O
byte	O
of	O
program	O
code	O
,	O
so	O
in	O
practice	O
this	O
feature	O
is	O
only	O
useful	O
for	O
reducing	O
the	O
memory	O
usage	O
of	O
large	O
array	O
variables	O
,	O
as	O
it	O
offers	O
no	O
performance	O
benefit	O
.	O
</s>
<s>
The	O
RND	O
function	O
generates	O
a	O
pseudorandom	B-Algorithm
fractional	O
number	O
between	O
0	O
and	O
1	O
.	O
returns	O
the	O
most	O
recently	O
generated	O
random	O
number	O
.	O
</s>
<s>
Like	O
other	O
implementations	O
of	O
Microsoft	B-Language
BASIC	I-Language
,	O
Applesoft	O
discards	O
spaces	O
(	O
outside	O
of	O
strings	O
and	O
comments	O
)	O
on	O
program	O
lines	O
.	O
</s>
<s>
Through	O
several	O
early	O
models	O
of	O
the	O
Apple	B-Device
II	I-Device
,	O
Applesoft	B-Language
BASIC	I-Language
did	O
not	O
support	O
the	O
use	O
of	O
lowercase	O
letters	O
in	O
programs	O
,	O
except	O
in	O
strings	O
.	O
</s>
<s>
Applesoft	O
lacks	O
several	O
commands	O
and	O
functions	O
common	O
to	O
most	O
of	O
the	O
non-6502	O
Microsoft	B-Language
BASIC	I-Language
interpreters	O
,	O
such	O
as	O
:	O
</s>
<s>
Applesoft	O
does	O
not	O
have	O
commands	O
for	O
file	O
or	O
disk	O
handling	O
,	O
other	O
than	O
to	O
save	O
and	O
load	O
programs	O
via	O
cassette	B-Device
tape	I-Device
.	O
</s>
<s>
The	O
Apple	B-Device
II	I-Device
disk	O
operating	O
system	O
,	O
known	O
simply	O
as	O
DOS	O
,	O
augments	O
the	O
language	O
to	O
provide	O
such	O
abilities	O
.	O
</s>
<s>
Applesoft	O
supports	O
drawing	O
in	O
the	O
Apple	B-Device
II	I-Device
's	O
low	O
resolution	O
and	O
high	O
resolution	O
modes	O
.	O
</s>
<s>
Beginning	O
with	O
the	O
Apple	B-Device
IIe	I-Device
,	O
a	O
"	O
double-high	O
resolution	O
"	O
mode	O
became	O
available	O
on	O
machines	O
with	O
128k	O
of	O
memory	O
.	O
</s>
<s>
Applesoft	B-Language
BASIC	I-Language
can	O
be	O
extended	O
by	O
two	O
means	O
:	O
the	O
ampersand	O
(	O
)	O
command	O
and	O
the	O
function	O
.	O
</s>
<s>
By	O
calling	O
routines	O
in	O
the	O
Applesoft	O
ROM	B-Device
,	O
it	O
is	O
possible	O
for	O
ampersand	O
routines	O
to	O
parse	O
values	O
that	O
follow	O
the	O
ampersand	O
.	O
</s>
<s>
The	O
built-in	O
pseudorandom	B-Algorithm
number	I-Algorithm
generator	I-Algorithm
function	O
RND	O
is	O
capable	O
of	O
producing	O
a	O
predictable	O
series	O
of	O
outputs	O
due	O
to	O
the	O
manner	O
in	O
which	O
the	O
generator	O
is	O
seeded	O
when	O
first	O
powering	O
on	O
.	O
</s>
<s>
Wozniak	O
originally	O
referred	O
to	O
his	O
Integer	B-Language
BASIC	I-Language
as	O
"	O
Game	O
BASIC	O
"	O
(	O
having	O
written	O
it	O
so	O
he	O
could	O
implement	O
a	O
Breakout	B-Application
clone	I-Application
for	O
his	O
new	O
computer	O
)	O
.	O
</s>
<s>
Few	O
action	B-Application
games	I-Application
were	O
written	O
in	O
Applesoft	B-Language
BASIC	I-Language
,	O
in	O
large	O
part	O
because	O
the	O
use	O
of	O
floating-point	B-Algorithm
numbers	I-Algorithm
for	O
all	O
math	O
operations	O
degrades	O
performance	O
.	O
</s>
<s>
Applesoft	B-Language
BASIC	I-Language
programs	O
are	O
stored	O
as	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
of	O
lines	O
;	O
a	O
GOTO	O
or	O
GOSUB	O
takes	O
linear	O
time	O
.	O
</s>
<s>
Unlike	O
Integer	B-Language
BASIC	I-Language
,	O
Applesoft	O
does	O
not	O
convert	O
literal	O
numbers	O
(	O
like	O
100	O
)	O
in	O
the	O
source	O
code	O
to	O
binary	O
when	O
a	O
line	O
is	O
entered	O
.	O
</s>
<s>
Since	O
variable	O
lookup	O
is	O
often	O
faster	O
than	O
this	O
conversion	O
,	O
it	O
can	O
be	O
faster	O
to	O
store	O
numeric	B-Algorithm
constants	O
used	O
inside	O
loops	O
in	O
variables	O
before	O
the	O
loop	O
is	O
entered	O
.	O
</s>
<s>
Hello	O
World	O
in	O
Applesoft	B-Language
BASIC	I-Language
can	O
be	O
entered	O
as	O
the	O
following	O
:	O
</s>
<s>
can	O
be	O
used	O
in	O
Applesoft	B-Language
BASIC	I-Language
(	O
and	O
almost	O
all	O
versions	O
of	O
Microsoft	B-Language
BASIC	I-Language
)	O
as	O
a	O
shortcut	O
for	O
"	O
PRINT	O
"	O
,	O
though	O
spelling	O
out	O
the	O
word	O
is	O
not	O
only	O
acceptable	O
but	O
canonical	O
—	O
Applesoft	O
converted	O
"	O
?	O
"	O
</s>
<s>
When	O
Applesoft	O
II	O
BASIC	O
was	O
initially	O
released	O
in	O
mid-1978	O
,	O
it	O
came	O
on	O
cassette	B-Device
tape	I-Device
and	O
could	O
be	O
loaded	O
into	O
memory	O
via	O
the	O
Apple	B-Device
II	I-Device
's	O
machine	O
language	O
monitor	O
.	O
</s>
<s>
When	O
the	O
enhanced	O
Apple	O
II+	O
replaced	O
the	O
original	O
II	O
in	O
1979	O
,	O
Applesoft	O
was	O
now	O
included	O
in	O
ROM	B-Device
and	O
automatically	O
started	O
on	O
power-up	O
if	O
no	O
bootable	O
floppy	O
disk	O
was	O
present	O
.	O
</s>
<s>
Conversely	O
,	O
Integer	B-Language
BASIC	I-Language
was	O
now	O
removed	O
from	O
ROM	B-Device
and	O
turned	O
into	O
an	O
executable	O
file	O
on	O
the	O
DOS	O
3.3	O
disk	O
.	O
</s>
<s>
as	O
well	O
as	O
several	O
the	O
later	O
version	O
would	O
have	O
,	O
that	O
had	O
already	O
been	O
present	O
in	O
Apple	O
's	O
Integer	B-Language
BASIC	I-Language
:	O
</s>
<s>
Applesoft	B-Language
BASIC	I-Language
1.x	O
was	O
closer	O
to	O
Microsoft	O
's	O
original	O
6502	B-General_Concept
BASIC	O
code	O
than	O
the	O
later	O
Applesoft	O
II	O
;	O
it	O
retained	O
the	O
Memory	O
Size	O
?	O
</s>
<s>
To	O
maintain	O
consistency	O
with	O
Integer	B-Language
BASIC	I-Language
,	O
the	O
"	O
Ok	O
"	O
prompt	O
from	O
Microsoft	O
's	O
code	O
was	O
replaced	O
by	O
a	O
]	O
character	O
.	O
</s>
<s>
All	O
of	O
several	O
examples	O
in	O
the	O
manual	O
use	O
the	O
function	O
only	O
to	O
access	O
"	O
system	O
monitor	O
ROM	B-Device
"	O
routines	O
,	O
or	O
short	O
user-routines	O
to	O
manipulate	O
the	O
ROM	B-Device
routines	O
.	O
</s>
<s>
Even	O
accessed	O
ROM	B-Device
routines	O
that	O
return	O
values	O
(	O
in	O
examples	O
,	O
those	O
that	O
provide	O
the	O
service	O
of	O
PDL( )	O
and	O
SCRN( )	O
functions	O
)	O
merely	O
have	O
their	O
values	O
stored	O
,	O
by	O
user-routines	O
,	O
in	O
locations	O
that	O
are	O
separately	O
PEEKed	O
in	O
a	O
subsequent	O
statement	O
.	O
</s>
<s>
Unlike	O
in	O
Integer	B-Language
BASIC	I-Language
and	O
Applesoft	O
II	O
,	O
the	O
Boolean	O
operators	O
AND	O
,	O
OR	O
and	O
NOT	O
perform	O
bitwise	O
operations	O
on	O
16-bit	O
integer	O
values	O
.	O
</s>
<s>
Coleco	O
claimed	O
that	O
its	O
Adam	B-Device
home	O
computer	O
's	O
SmartBASIC	O
was	O
source-code	O
compatible	O
with	O
Applesoft	O
.	O
</s>
<s>
Microsoft	O
licensed	O
a	O
BASIC	O
compatible	O
with	O
Applesoft	O
to	O
VTech	O
for	O
its	O
Laser	B-Device
128	I-Device
clone	B-Device
.	O
</s>
