<s>
MBASIC	B-Language
is	O
the	O
Microsoft	B-Language
BASIC	I-Language
implementation	O
of	O
BASIC	O
for	O
the	O
CP/M	B-Application
operating	I-Application
system	I-Application
.	O
</s>
<s>
MBASIC	B-Language
is	O
a	O
descendant	O
of	O
the	O
original	O
Altair	B-Language
BASIC	I-Language
interpreters	O
that	O
were	O
among	O
Microsoft	O
's	O
first	O
products	O
.	O
</s>
<s>
MBASIC	B-Language
was	O
one	O
of	O
the	O
two	O
versions	O
of	O
BASIC	O
bundled	O
with	O
the	O
Osborne	B-Device
1	I-Device
computer	O
.	O
</s>
<s>
The	O
name	O
"	O
MBASIC	B-Language
"	O
is	O
derived	O
from	O
the	O
disk	O
file	O
name	O
MBASIC.COM	B-Language
of	O
the	O
BASIC	B-Language
interpreter	I-Language
.	O
</s>
<s>
MBASIC	B-Language
version	O
5	O
required	O
a	O
CP/M	B-Application
system	O
with	O
at	O
least	O
28	O
kB	O
of	O
random	B-Architecture
access	I-Architecture
memory	I-Architecture
(	O
RAM	B-Architecture
)	O
and	O
at	O
least	O
one	O
diskette	O
drive	O
.	O
</s>
<s>
Unlike	O
versions	O
of	O
Microsoft	O
BASIC-80	O
that	O
were	O
customized	O
by	O
home	O
computer	O
manufacturers	O
to	O
use	O
the	O
particular	O
hardware	O
features	O
of	O
the	O
computer	O
,	O
MBASIC	B-Language
relied	O
only	O
on	O
the	O
CP/M	B-Application
operating	I-Application
system	I-Application
calls	O
for	O
all	O
input	O
and	O
output	O
.	O
</s>
<s>
Only	O
the	O
CP/M	B-Application
console	O
(	O
screen	O
and	O
keyboard	O
)	O
,	O
line	O
printer	O
,	O
and	O
disk	O
devices	O
were	O
available	O
.	O
</s>
<s>
MBASIC	B-Language
in	O
the	O
uncustomized	O
form	O
had	O
no	O
functions	O
for	O
graphics	O
,	O
color	O
,	O
joysticks	O
,	O
mice	O
,	O
serial	B-Protocol
communications	I-Protocol
,	O
networking	O
,	O
sound	O
,	O
or	O
even	O
a	O
real-time	O
clock	O
function	O
.	O
</s>
<s>
MBASIC	B-Language
did	O
not	O
fully	O
support	O
the	O
features	O
of	O
the	O
host	O
CP/M	B-Application
operating	I-Application
system	I-Application
,	O
for	O
example	O
,	O
it	O
did	O
not	O
support	O
CP/M	B-Application
'	O
s	O
user	O
areas	O
for	O
organizing	O
files	O
on	O
a	O
diskette	O
.	O
</s>
<s>
Since	O
CP/M	B-Application
systems	O
were	O
typically	O
single-user	O
and	O
stand	O
alone	O
,	O
there	O
was	O
no	O
provision	O
for	O
file	O
or	O
record	O
locking	O
,	O
or	O
any	O
form	O
of	O
multitasking	B-Operating_System
.	O
</s>
<s>
Apart	O
from	O
these	O
limitations	O
,	O
MBASIC	B-Language
was	O
considered	O
at	O
the	O
time	O
to	O
be	O
a	O
powerful	O
and	O
useful	O
implementation	O
of	O
BASIC	O
.	O
</s>
<s>
MBASIC	B-Language
is	O
an	O
interpreter	B-Language
.	O
</s>
<s>
Programs	O
could	O
be	O
listed	O
on	O
the	O
screen	O
for	O
editing	O
,	O
or	O
saved	O
to	O
disk	O
in	O
either	O
a	O
compressed	O
binary	O
format	O
or	O
as	O
plain	O
ASCII	B-Protocol
text	I-Protocol
.	O
</s>
<s>
Every	O
source	O
line	O
was	O
identified	O
with	O
a	O
number	O
,	O
which	O
could	O
be	O
used	O
as	O
the	O
target	O
of	O
a	O
GOTO	B-Application
or	O
GOSUB	B-Device
transfer	O
.	O
</s>
<s>
Program	O
text	O
,	O
variables	O
,	O
disk	O
buffers	O
and	O
the	O
CP/M	B-Application
operating	I-Application
system	I-Application
itself	O
all	O
had	O
to	O
share	O
the	O
64	O
kilobyte	O
address	O
space	O
of	O
the	O
8080	O
processor	O
.	O
</s>
<s>
Typically	O
when	O
first	O
starting	O
MBASIC	B-Language
there	O
would	O
be	O
less	O
than	O
32	O
kB	O
memory	O
available	O
for	O
programs	O
and	O
data	O
,	O
even	O
on	O
a	O
machine	O
equipped	O
with	O
a	O
full	O
64	O
kilobytes	O
of	O
RAM	B-Architecture
.	O
</s>
<s>
To	O
allow	O
larger	O
and	O
more	O
complex	O
programs	O
to	O
be	O
run	O
,	O
later	O
versions	O
of	O
MBASIC	B-Language
supported	O
functions	O
that	O
allowed	O
portions	O
of	O
program	O
text	O
to	O
be	O
read	O
in	O
and	O
executed	O
under	O
program	O
control	O
(	O
the	O
"	O
CHAIN	O
"	O
and	O
MERGE	O
statements	O
)	O
.	O
</s>
<s>
A	O
particular	O
advantage	O
of	O
MBASIC	B-Language
was	O
the	O
full-text	O
error	O
messages	O
provided	O
for	O
syntax	O
and	O
run-time	O
errors	O
.	O
</s>
<s>
MBASIC	B-Language
also	O
had	O
a	O
"	O
trace	O
"	O
function	O
that	O
displayed	O
line	O
numbers	O
as	O
they	O
were	O
executed	O
.	O
</s>
<s>
While	O
this	O
occupied	O
the	O
same	O
screen	O
space	O
as	O
normal	O
program	O
output	O
,	O
it	O
was	O
useful	O
for	O
detecting	O
conditions	O
such	O
as	O
endless	B-Algorithm
loops	I-Algorithm
.	O
</s>
<s>
Data	O
could	O
be	O
read	O
and	O
stored	O
to	O
disk	O
as	O
either	O
sequential	O
files	O
(	O
delimited	O
by	O
the	O
CP/M	B-Application
convention	O
of	O
CR/LF	O
at	O
the	O
end	O
of	O
each	O
line	O
)	O
or	O
else	O
as	O
fixed-record-length	O
random	O
access	O
files	O
,	O
which	O
,	O
given	O
a	O
sufficiently	O
determined	O
programmer	O
,	O
could	O
be	O
used	O
to	O
perform	O
database-type	O
record	O
manipulation	O
.	O
</s>
<s>
The	O
Microsoft	O
Binary	O
Format	O
for	O
floating	B-Algorithm
point	I-Algorithm
numbers	I-Algorithm
was	O
proprietary	O
to	O
the	O
implementation	O
,	O
which	O
meant	O
that	O
data	O
could	O
only	O
be	O
interchanged	O
with	O
other	O
programs	O
using	O
ASCII	B-Protocol
text	I-Protocol
representation	O
or	O
else	O
with	O
extensive	O
programming	O
to	O
convert	O
the	O
binary	O
format	O
.	O
</s>
<s>
MBASIC	B-Language
supported	O
the	O
following	O
data	O
types	O
:	O
</s>
<s>
32-bit	O
floating	B-Algorithm
point	I-Algorithm
(	O
single	O
precision	O
)	O
,	O
equivalent	O
to	O
six	O
decimal	O
digits	O
,	O
with	O
a	O
two-digit	O
exponent	O
;	O
</s>
<s>
64-bit	O
floating	B-Algorithm
point	I-Algorithm
(	O
double	O
precision	O
)	O
,	O
equivalent	O
to	O
sixteen	O
decimal	O
digits	O
,	O
with	O
a	O
two-digit	O
exponent	O
.	O
</s>
<s>
Unlike	O
some	O
other	O
BASIC	O
implementations	O
of	O
the	O
time	O
,	O
MBASIC	B-Language
did	O
not	O
provide	O
support	O
for	O
matrix	B-Architecture
operations	O
,	O
complex	O
numbers	O
,	O
or	O
a	O
decimal	O
(	O
BCD	O
)	O
data	O
type	O
for	O
financial	O
calculations	O
.	O
</s>
<s>
All	O
floating	B-Algorithm
point	I-Algorithm
operations	O
were	O
carried	O
out	O
in	O
software	O
since	O
typical	O
CP/M	B-Application
systems	O
did	O
not	O
have	O
floating	B-General_Concept
point	I-General_Concept
hardware	I-General_Concept
.	O
</s>
<s>
A	O
software	O
pseudorandom	B-Algorithm
number	I-Algorithm
generator	I-Algorithm
was	O
provided	O
;	O
this	O
relied	O
on	O
the	O
user	O
to	O
key	O
in	O
a	O
seed	O
number	O
to	O
obtain	O
a	O
sequence	O
of	O
numbers	O
useful	O
for	O
games	O
and	O
some	O
simulations	O
.	O
</s>
<s>
MBASIC	B-Language
permitted	O
but	O
did	O
not	O
require	O
the	O
LET	O
keyword	O
for	O
assignment	O
statements	O
.	O
</s>
<s>
MBASIC	B-Language
version	O
5	O
allowed	O
identifiers	O
up	O
to	O
40	O
characters	O
long	O
,	O
which	O
permitted	O
programmers	O
to	O
give	O
variables	O
readable	O
names	O
.	O
</s>
<s>
Program	O
flow	O
control	O
in	O
MBASIC	B-Language
was	O
controlled	O
by	O
IF	O
...	O
THEN	O
ELSE	O
...	O
</s>
<s>
conditional	O
tests	O
,	O
WHILE	O
...	O
WEND	O
loops	O
,	O
and	O
GOTO	B-Application
and	O
GOSUB	B-Device
instructions	O
.	O
</s>
<s>
No	O
CASE	O
statement	O
was	O
available	O
,	O
although	O
an	O
ON	O
...	O
GOTO	B-Application
(	O
computed	O
GOTO	B-Application
)	O
provided	O
multi-way	O
branches	O
.	O
</s>
<s>
MBASIC	B-Language
did	O
not	O
make	O
structured	B-Language
programming	I-Language
mandatory	O
for	O
programmers	O
and	O
it	O
was	O
easy	O
to	O
write	O
spaghetti	O
code	O
.	O
</s>
<s>
No	O
discussion	O
of	O
BASICs	O
on	O
the	O
8-bit	O
computers	O
of	O
the	O
late	O
'	O
70s	O
and	O
early	O
'	O
80s	O
would	O
be	O
complete	O
without	O
mentioning	O
the	O
importance	O
of	O
the	O
PEEK	B-Language
and	I-Language
POKE	I-Language
functions	O
for	O
directly	O
reading	O
and	O
writing	O
to	O
memory	O
.	O
</s>
<s>
Since	O
these	O
systems	O
typically	O
had	O
no	O
memory	B-General_Concept
protection	I-General_Concept
,	O
this	O
allowed	O
a	O
programmer	O
to	O
access	O
portions	O
of	O
the	O
operating	O
system	O
,	O
or	O
functions	O
that	O
would	O
not	O
otherwise	O
be	O
available	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
CP/M	B-Application
programmer	O
might	O
use	O
a	O
POKE	O
function	O
to	O
allow	O
BASIC	O
to	O
switch	O
the	O
console	O
device	O
to	O
the	O
serial	B-Protocol
port	I-Protocol
,	O
if	O
the	O
system	B-Operating_System
BIOS	I-Operating_System
supported	O
this	O
.	O
</s>
<s>
For	O
more	O
complex	O
operations	O
,	O
MBASIC	B-Language
allowed	O
user-defined	O
functions	O
that	O
could	O
be	O
called	O
from	O
a	O
BASIC	O
program	O
.	O
</s>
<s>
These	O
were	O
typically	O
placed	O
in	O
a	O
reserved	O
area	O
of	O
memory	O
,	O
or	O
POKEd	O
into	O
string	O
constants	O
,	O
as	O
a	O
series	O
of	O
machine	B-Language
codes	I-Language
(	O
op	O
codes	O
)	O
.	O
</s>
<s>
MBASIC	B-Language
also	O
provided	O
hardware	O
INP	O
and	O
OUT	O
instructions	O
that	O
read	O
and	O
wrote	O
directly	O
to	O
the	O
8080	O
hardware	O
input/output	O
ports	O
.	O
</s>
<s>
Any	O
MBASIC	B-Language
programs	O
that	O
made	O
use	O
of	O
PEEK	B-Language
and	I-Language
POKE	I-Language
,	O
and	O
of	O
machine	B-Language
code	I-Language
user	O
functions	O
,	O
were	O
not	O
portable	O
between	O
machines	O
without	O
modifications	O
.	O
</s>
<s>
Besides	O
Microsoft	O
's	O
BASIC-80	B-Language
for	O
CP/M	B-Application
,	O
a	O
variant	O
of	O
MBASIC	B-Language
was	O
also	O
available	O
as	O
for	O
the	O
ISIS-II	O
operating	O
system	O
.	O
</s>
<s>
MSX-BASIC	B-Language
is	O
also	O
a	O
well	O
known	O
successor	O
of	O
MBASIC	B-Language
,	O
featuring	O
several	O
extensions	O
specific	O
to	O
the	O
MSX	B-Operating_System
machines	O
.	O
</s>
<s>
All	O
the	O
functions	O
of	O
CP/M	B-Application
MBASIC	B-Language
were	O
available	O
in	O
the	O
IBM	O
PC	O
disk-based	O
BASICA	O
or	O
GWBASIC	B-Language
which	O
made	O
migration	O
of	O
programs	O
from	O
CP/M	B-Application
systems	O
to	O
PC-compatibles	O
possible	O
.	O
</s>
<s>
The	O
tokens	O
used	O
to	O
represent	O
keywords	O
were	O
different	O
,	O
so	O
CP/M	B-Application
programs	O
had	O
to	O
be	O
saved	O
in	O
ASCII	B-Protocol
source	O
form	O
.	O
</s>
<s>
Typically	O
screen	O
formatting	O
escape	O
sequences	O
put	O
into	O
the	O
CP/M	B-Application
version	O
would	O
be	O
replaced	O
with	O
the	O
cursor	O
positioning	O
commands	O
found	O
in	O
the	O
PC	O
versions	O
of	O
BASIC	O
,	O
otherwise	O
little	O
rewriting	O
would	O
be	O
needed	O
.	O
</s>
<s>
Microsoft	O
sold	O
a	O
CP/M	B-Application
BASIC	O
compiler	B-Language
(	O
known	O
as	O
BASCOM	O
)	O
which	O
used	O
a	O
similar	O
source	O
language	O
to	O
MBASIC	B-Language
.	O
</s>
<s>
A	O
program	O
debugged	O
under	O
MBASIC	B-Language
could	O
be	O
compiled	B-Language
with	O
BASCOM	O
.	O
</s>
<s>
Since	O
program	O
text	O
was	O
no	O
longer	O
in	O
memory	O
and	O
the	O
run-time	O
elements	O
of	O
the	O
compiler	B-Language
were	O
smaller	O
than	O
the	O
interpreter	B-Language
,	O
more	O
memory	O
was	O
available	O
for	O
user	O
data	O
.	O
</s>
<s>
Developers	O
welcomed	O
BASCOM	O
as	O
an	O
alternative	O
to	O
the	O
popular	O
but	O
slow	O
and	O
clumsy	O
CBASIC	B-Language
.	O
</s>
<s>
Unlike	O
CBASIC	B-Language
,	O
BASCOM	O
did	O
not	O
need	O
a	O
preprocessor	B-General_Concept
for	O
MBASIC	B-Language
source	O
code	O
so	O
could	O
be	O
debugged	O
interactively	O
.	O
</s>
<s>
A	O
disadvantage	O
was	O
Microsoft	O
's	O
requirement	O
of	O
a	O
9%	O
royalty	O
for	O
each	O
compiled	B-Language
copy	O
of	O
a	O
program	O
and	O
$40	O
for	O
hardware-software	O
combinations	O
.	O
</s>
<s>
Because	O
authors	O
 '	O
typical	O
royalty	O
rates	O
for	O
software	O
was	O
10-25	O
%	O
,	O
InfoWorld	O
in	O
1980	O
stated	O
that	O
BASCOM	O
's	O
additional	O
9%	O
royalty	O
rate	O
"	O
could	O
make	O
software	O
development	O
downright	O
unprofitable	O
"	O
,	O
concluding	O
that	O
"	O
Microsoft	O
has	O
the	O
technical	O
solution	O
[	O
to	O
CBASIC	B-Language
's	O
flaws ]	O
,	O
but	O
not	O
the	O
economic	O
one	O
"	O
.	O
</s>
<s>
MBASIC	B-Language
was	O
an	O
important	O
tool	O
during	O
the	O
era	O
of	O
8-bit	O
CP/M	B-Application
computers	O
.	O
</s>
<s>
Skilled	O
users	O
could	O
write	O
routines	O
in	O
MBASIC	B-Language
to	O
automate	O
tasks	O
that	O
in	O
modern-day	O
systems	O
would	O
be	O
performed	O
by	O
powerful	O
application	O
program	O
commands	O
or	O
scripting	O
languages	O
.	O
</s>
<s>
Exchange	O
of	O
useful	O
MBASIC	B-Language
programs	O
was	O
a	O
common	O
function	O
of	O
computer	O
users	O
 '	O
groups	O
.	O
</s>
<s>
Keying	O
in	O
long	O
BASIC	O
listings	O
from	O
a	O
magazine	O
article	O
was	O
one	O
way	O
of	O
"	O
bootstrapping	O
"	O
software	O
into	O
a	O
new	O
CP/M	B-Application
system	O
.	O
</s>
<s>
At	O
least	O
one	O
compiler	B-Language
for	O
a	O
high-level	O
language	O
was	O
written	O
in	O
MBASIC	B-Language
,	O
and	O
many	O
small	O
games	O
and	O
utility	O
programs	O
ranging	O
from	O
a	O
few	O
lines	O
to	O
a	O
few	O
thousand	O
lines	O
of	O
code	O
were	O
written	O
.	O
</s>
<s>
MBASIC	B-Language
is	O
also	O
the	O
name	O
of	O
a	O
commercial	B-Language
BASIC	I-Language
compiler	B-Language
for	O
the	O
Microchip	O
Technology	O
PIC	B-Architecture
microcontroller	I-Architecture
family	O
developed	O
by	O
Basic	O
Micro	O
,	O
Inc.	O
,	O
unrelated	O
to	O
the	O
CP/M	B-Application
interpreter	B-Language
.	O
</s>
