<s>
HP	B-Language
Time-Shared	I-Language
BASIC	I-Language
(	O
HP	B-Language
TSB	I-Language
)	O
is	O
a	O
BASIC	O
programming	O
language	O
interpreter	B-Application
for	B-Language
Hewlett-Packard	O
'	O
s	O
HP	O
2000	O
line	O
of	O
minicomputer-based	O
time-sharing	B-General_Concept
computer	O
systems	O
.	O
</s>
<s>
TSB	O
is	O
historically	O
notable	O
as	O
the	O
platform	O
that	O
released	O
the	O
first	O
public	O
versions	O
of	O
the	O
game	O
Star	B-Application
Trek	I-Application
.	O
</s>
<s>
HP	O
maintained	O
a	O
database	O
of	O
contributed-programs	O
and	O
customers	O
could	O
order	O
them	O
on	O
punched	O
tape	O
for	B-Language
a	O
nominal	O
fee	O
.	O
</s>
<s>
Most	O
BASICs	O
of	O
the	O
1970s	O
trace	O
their	O
history	O
to	O
the	O
original	O
Dartmouth	B-Language
BASIC	I-Language
of	O
the	O
1960s	O
,	O
but	O
early	O
versions	O
of	O
Dartmouth	O
did	O
not	O
handle	O
string	O
variables	O
or	O
offer	O
string	O
manipulation	O
features	O
.	O
</s>
<s>
Vendors	O
added	O
their	O
own	O
solutions	O
;	O
HP	O
used	O
a	O
system	O
similar	O
to	O
Fortran	B-Application
and	O
other	O
languages	O
with	O
array	O
slicing	O
,	O
while	O
DEC	O
later	O
introduced	O
the	O
MID/LEFT/RIGHT	O
functions	O
.	O
</s>
<s>
As	O
microcomputers	B-Architecture
began	O
to	O
enter	O
the	O
market	O
in	O
the	O
mid-1970s	O
,	O
many	O
new	O
BASICs	O
appeared	O
that	O
based	O
their	O
parsers	O
on	O
DEC	O
's	O
or	O
HP	O
's	O
syntax	O
.	O
</s>
<s>
Altair	B-Language
BASIC	I-Language
,	O
the	O
original	O
version	O
of	O
what	O
became	O
Microsoft	B-Language
BASIC	I-Language
,	O
was	O
patterned	O
on	O
DEC	O
's	O
BASIC-PLUS	B-Language
.	O
</s>
<s>
Others	O
,	O
including	O
Apple	O
's	O
Integer	B-Language
BASIC	I-Language
,	O
Atari	B-Language
BASIC	I-Language
and	O
North	B-Language
Star	I-Language
BASIC	I-Language
were	O
patterned	O
on	O
the	O
HP	O
style	O
.	O
</s>
<s>
The	O
software	O
was	O
also	O
known	O
by	O
its	O
versioned	O
name	O
,	O
tied	O
to	O
the	O
hardware	O
version	O
on	O
which	O
it	O
ran	O
,	O
such	O
as	O
HP	B-Language
2000C	I-Language
Time-Shared	I-Language
BASIC	I-Language
and	O
the	O
operating	O
system	O
came	O
in	O
different	O
varieties	O
—	O
2000A	O
,	O
2000B	O
,	O
2000C	O
,	O
High-Speed	O
2000C	O
,	O
2000E	O
,	O
and	O
2000F	O
.	O
</s>
<s>
Except	O
for	B-Language
the	O
2000A	O
and	O
2000E	O
systems	O
,	O
the	O
system	O
is	O
implemented	O
using	O
a	O
dual-processor	O
architecture	B-General_Concept
.	O
</s>
<s>
One	O
fully	O
configured	O
HP	O
2100-series	O
processor	B-General_Concept
is	O
used	O
for	B-Language
the	O
execution	O
of	O
most	O
of	O
the	O
system	O
code	O
and	O
all	O
of	O
the	O
user	O
code	O
,	O
while	O
a	O
second	O
,	O
smaller	O
HP	O
2100-series	O
processor	B-General_Concept
is	O
used	O
to	O
handle	O
the	O
RS-232	O
serial	O
lines	O
through	O
which	O
the	O
time-sharing	B-General_Concept
users	O
connected	O
.	O
</s>
<s>
The	O
usual	O
terminal	O
for	B-Language
a	O
TSB	O
system	O
was	O
a	O
Teletype	B-Application
Model	I-Application
33	I-Application
ASR	O
and	O
connected	O
directly	O
to	O
the	O
I/O	O
processor	B-General_Concept
or	O
through	O
a	O
modem	B-Application
or	O
acoustic	B-Device
coupler	I-Device
.	O
</s>
<s>
The	O
superuser	B-Application
account	O
is	O
A000	O
.	O
</s>
<s>
During	O
execution	O
,	O
user	O
programs	O
are	O
swapped	O
to	O
a	O
fixed	O
head	O
drive	O
—	O
physically	O
a	O
disk	B-Device
,	O
but	O
operating	O
like	O
a	O
magnetic	B-General_Concept
drum	I-General_Concept
.	O
</s>
<s>
When	O
not	O
executing	O
,	O
user	O
programs	O
are	O
stored	O
on	O
moving-head	O
cartridge	O
-	O
or	O
pack-loaded	O
disk	B-Device
storage	I-Device
.	O
</s>
<s>
Program	O
and	O
file	B-Operating_System
names	O
consist	O
of	O
a	O
mix	O
of	O
up	O
to	O
six	O
alphabetic	O
characters	O
(	O
A-Z	O
)	O
and	O
numbers	O
(	O
0-9	O
)	O
.	O
</s>
<s>
Since	O
the	O
system	O
was	O
closely	O
tied	O
to	O
the	O
use	O
of	O
commonly	O
available	O
teleprinters	O
,	O
line	O
endings	O
in	O
files	O
consisted	O
of	O
the	O
carriage	O
return	B-Language
character	O
(	O
ASCII	O
CR	O
,	O
0D	O
hexadecimal	O
)	O
,	O
followed	O
by	O
the	O
linefeed	O
character	O
(	O
ASCII	O
LF	O
,	O
0A	O
hexadecimal	O
)	O
.	O
</s>
<s>
Statements	O
are	O
analyzed	O
for	B-Language
correct	O
syntax	O
as	O
they	O
are	O
entered	O
and	O
then	O
stored	O
in	O
tokenized	O
form	O
.	O
</s>
<s>
Line	O
numbers	O
are	O
mandatory	O
,	O
and	O
statements	O
are	O
automatically	O
placed	O
in	O
ascending	O
numeric	B-Algorithm
sequence	O
.	O
</s>
<s>
TSB	O
lines	O
can	O
contain	O
one	O
statement	O
;	O
chaining	O
multiple	O
statements	O
with	O
the	O
colon	O
as	O
in	O
MS	B-Language
BASIC	I-Language
is	O
not	O
supported	O
.	O
</s>
<s>
For	B-Language
instance	O
,	O
will	O
set	O
up	O
a	O
string	O
that	O
can	O
hold	O
a	O
maximum	O
of	O
10	O
characters	O
.	O
</s>
<s>
HP	O
's	O
notation	O
can	O
also	O
be	O
used	O
on	O
the	O
destination	O
side	O
of	O
a	O
LET	O
or	O
INPUT	O
statement	O
to	O
modify	O
part	O
of	O
an	O
existing	O
string	O
value	O
,	O
for	B-Language
example	O
or	O
,	O
which	O
cannot	O
be	O
done	O
with	O
early	O
implementations	O
of	O
LEFT/MID/RIGHT	O
.	O
</s>
<s>
The	O
main	O
advantage	O
to	O
this	O
style	O
of	O
string	O
access	O
is	O
that	O
it	O
eliminates	O
the	O
need	O
for	B-Language
complex	O
memory	B-General_Concept
management	I-General_Concept
that	O
is	O
otherwise	O
required	O
when	O
string	O
lengths	O
change	O
.	O
</s>
<s>
MS	B-Language
BASIC	I-Language
had	O
a	O
lengthy	O
library	O
to	O
handle	O
the	O
compression	O
of	O
memory	O
by	O
removing	O
dead	O
space	O
in	O
the	O
string	O
heap	B-Application
when	O
the	O
system	O
ran	O
out	O
of	O
memory	O
.	O
</s>
<s>
Later	O
versions	O
of	O
Dartmouth	B-Language
BASIC	I-Language
did	O
include	O
string	O
variables	O
,	O
based	O
on	O
the	O
same	O
pattern	O
found	O
in	O
BASIC-PLUS	B-Language
and	O
MS	B-Language
BASIC	I-Language
.	O
</s>
<s>
However	O
,	O
this	O
version	O
did	O
not	O
use	O
the	O
LEFT/MID/RIGHT	O
functions	O
for	B-Language
manipulating	O
strings	O
,	O
but	O
instead	O
used	O
the	O
CHANGE	O
command	O
which	O
converted	O
the	O
string	O
to	O
and	O
from	O
equivalent	O
ASCII	O
values	O
.	O
</s>
<s>
Additionally	O
,	O
one	O
could	O
use	O
the	O
single-quote	O
to	O
convert	O
a	O
numeric	B-Algorithm
constant	O
to	O
an	O
ASCII	O
character	O
,	O
allowing	O
one	O
to	O
build	O
up	O
a	O
string	O
in	O
parts	O
;	O
produced	O
the	O
string	O
"	O
ABCDEF	O
"	O
,	O
without	O
the	O
need	O
for	B-Language
the	O
CHR$( 	O
)	O
function	O
.	O
</s>
<s>
Later	O
versions	O
of	O
Dartmouth	B-Language
BASIC	I-Language
included	O
a	O
suite	O
of	O
MAT	O
commands	O
that	O
allowed	O
operations	O
on	O
entire	O
arrays	O
(	O
matrices	B-Architecture
)	O
with	O
a	O
single	O
statement	O
.	O
</s>
<s>
For	B-Language
instance	O
:	O
</s>
<s>
As	O
well	O
as	O
making	O
the	O
code	O
shorter	O
and	O
more	O
obvious	O
,	O
these	O
commands	O
also	O
have	O
the	O
advantage	O
of	O
being	O
highly	O
optimized	O
,	O
easily	O
outperforming	O
the	O
use	O
of	O
FOR/NEXT	O
.	O
</s>
<s>
For	B-Language
instance	O
,	O
will	O
always	O
go	O
to	O
line	O
10	O
,	O
whereas	O
will	O
branch	O
to	O
different	O
lines	O
if	O
the	O
value	O
of	O
A	O
is	O
1	O
,	O
2	O
or	O
3	O
.	O
</s>
<s>
Boolean	O
and	O
relational	O
operators	O
can	O
be	O
used	O
in	O
any	O
mathematical	O
expression	O
,	O
returning	O
0	O
for	B-Language
false	O
or	O
1	O
for	B-Language
true	O
,	O
which	O
was	O
unusual	O
for	B-Language
BASIC	O
languages	O
of	O
that	O
time	O
,	O
but	O
popular	O
in	O
languages	O
like	O
C	B-Language
.	O
For	B-Language
instance	O
,	O
will	O
branch	O
to	O
line	O
1600	O
if	O
either	O
C	B-Language
or	O
D	O
are	O
greater	O
than	O
zero	O
,	O
because	O
the	O
expression	O
C+D	O
will	O
evaluate	O
to	O
'	O
true	O
 '	O
in	O
the	O
IF	O
.	O
</s>
<s>
If	O
C	B-Language
and	O
D	O
are	O
both	O
zero	O
,	O
the	O
IF	O
will	O
evaluate	O
it	O
to	O
'	O
false	O
 '	O
and	O
the	O
branch	O
will	O
not	O
be	O
taken	O
.	O
</s>
<s>
ENTER	O
has	O
three	O
inputs	O
,	O
a	O
time	O
limit	O
in	O
seconds	O
,	O
a	O
return	B-Language
variable	O
containing	O
the	O
actual	O
time	O
elapsed	O
(	O
or	O
a	O
status	O
code	O
)	O
,	O
and	O
then	O
finally	O
the	O
user	O
input	O
.	O
</s>
<s>
For	B-Language
instance	O
,	O
will	O
wait	O
15	O
seconds	O
for	B-Language
the	O
user	O
to	O
type	O
in	O
a	O
single	O
character	O
.	O
</s>
<s>
For	B-Language
instance	O
,	O
does	O
not	O
require	O
semicolons	O
between	O
the	O
string	O
constants	O
and	O
the	O
variable	O
A	O
.	O
</s>
<s>
Integer	B-Language
BASIC	I-Language
had	O
a	O
similar	O
feature	O
,	O
called	O
.	O
</s>
