Atari 400 User manual


ERROR CODES
ERROR
CODE
ERROR
CODE
MESSAGE
2
Memory
In
s
ufficient
3
Va
lue
Error
4 Too
Many
Vari
ab
l
es
5
String
Length
Error
6
Out
of
Data
Error
7
Number
greater
than
32767
8
Input
Statement
Error
9
Array
or
String
DIM
Error
10
Argument
Stack
Overflow
11
Fl
oating
Point
Overflow
/
Underflow
Error
12
Line
Not
Found
13
No
Matching
FOR S
ta
tement
14
Line
Too
Long
Error
15
GOSUB
or
FOR
Lin
e Del
eted
16
RE
TUR
N
Error
17
Garbage
Error
18
In
va
lid
String
Character
Note
:
Th
e foll
owing
are
INPUT
/
OUTPU
T er-
rors
that
resu
lt
du
r
in
g
th
e u
se
of
disk
dri
ves,
pr
i
nt
e
rs
,
or
ot
h
er
accessory
d
ev
i
ces
.
Furth
er in-
fo
rm
at
ion is
pro
v
id
ed
with
th
e auxilia
ry
hard
-
ware
.
19
LOAD
program
T
oo
Long
20
D
ev
ice
Number
Larger
21
L
OAD
File
Error
128
BREAK
Abort
129
IOCB
130
Nonexistent
Device
131
IOCB
Write
Only
132
In
va
lid
Comm
a
nd
133
D
ev
ic
e
or
File
not
Op
en
134
BAD IO
CB
~umb
er
135
IO
CB
R
ea
d
On
ly
Error
136
EOF
137
Truncat
ed R
eco
rd
138
De
vice
Tim
eo
ut
139
D
evice
NAK
140
Seri
al
Bus
141
C
ursor
Out
of
Ra
ng
e
ERROR
CODE
ERROR
CODE
MESSAGE
142
Ser
ial Bus
Data
Frame
O
verr
un
143
Serial
bus
data
fr
ame
checks
um
er
ror
144
Dev
i
cP
rlone
e
rr
or
145
Read
af
t
er
write
compare
error
146
Funct
ion
not
implemen
ted
147
In
sufficient
RAM
160
Drive
numb
er
er
ror
161
Too
many
OPEN
files
162
Disk
full
163
U
nrecov
e
rab
le
system
data
I/
0
er
ror
164
File
number
mi
smatch
165
File
name
error
166
POINT
d
ata
le
ngth
error
167
File l
ocked
168
Command
inva
lid
169
Director
y
full
170
File
not
found
171
POINT
i
nvalid
For
ex
pl
ana
tion
of
Err
or
Mes
sages
see
Appendix
B.

TABLE OF MODES
AND
SCREEN FORMATS
Vert.
(Rows)
Vert.
(Rows)
RAM
Gr.
Mode
Horiz.
Split
Full
II
Of
Requir
ed
Mod
e Ty
pe
(Column
s)
Scre
en
Screen
Colors
(B
y t
es
)
0 TE
XT
40 -24 2
993
1
TEXT
20
20 24
5
513
2 TEXT
20
10
12 5
26
1
3 GRAPHI
CS
40
20
24 4 2
73
4 GR
AP
HI
CS
80
40
48 2
537
5 GRA PHI
CS
80
40 48
4 1
017
6
GR
APHI
CS
160
80 96 2
2025
7
GR
APHI
CS
160
80
96
4
3945
8
GRAPH
ICS
320
1
60
1
92
1/2
7900
MODE, SET COLOR, COLOR TABLE
SETC
OLOR
(a
ex
pl)
De
fault
Mod
e
or
C
olor
C
olo
r
C
ol
ors
Co
nditi
on Re
gi
ster No.
(aex
p)
DESCRIP
TIO
N
AN
D C
OM
MENTS
0 COLOR da ta -
LIGHT BLUE MODE 0 a
nd
1 ac
tu
ally Cha
ra
cter
lum
in
ance
(
sa
m e color as
bac
kground
)
DARK BLUE ALL
TEXT
2
de
te
rmines
Back
gro
un
d
WINDOWS
3 ch
arac
t
er
to -
BLACK 4
be
pl
ot
ted Borde1·
ORANGE
0 COLOR
data
Cha1·acter
LI
GHT
GREEN MODES 1 1
actually
determine
s Ch
aracte
r
DARK BLUE a
nd
2 cha
ra
cter
to
be Ch
aracter
RED 2 3 plott
ed
Char
acte
r
BL
ACK (
Text
Modes) 4
Backgro
und
,
Bord
er
ORANGE
0 1
Gr
ap
hics
poin
t
LIGHT GREEN MODES
3,
5, 1 2
Gra
p
hi
cs
poin
t
DARK BLUE
and
7 2 3
Graph
ics
poi
nt
(Four
-
co
l
or
3 -
BLACK
Mode
s) 4 0 Gra
phics
point
(bac
kgr
ou
nd
defa
ult
),
Bo
rder
ORANGE
MODES 4 0 1
Grap
hics
point
an d 6 1 -
(Two-
co
lor 2 -
Mo
de
s) 3 -
BLACK 4 0 Gr
ap
hi
cs
point
(
bac
k
ground
d
efau
lt
),
Bor
der
LIG
HT GREEN 0 - -
DARK BLUE 1 1
Grap
hi
cs p
oin
t lumi
nan
ce
(sa
me
col
or
as
b
ackgr
ou
nd)
MODE 8 2 0
Gr
ap
hi
cs
poi
nt
(ba
ckgr
o
un
d deliiUlt)
(1 Col
or
3 -
BLACK 2 L
um
in
ances)
4 Bor
der

CONTENTS
PREFACE
vii
1 GENERAL INFORMATION
Terminolog
y 1
Sp
ec
ial
Not
a
tions
U
se
d
In
Thi
s
Manual
3
Abbre
v
iation
s
Used
In
This
M
anual
4
Operating
Modes
5
Spec
ial
Fun
c
tion
K
eys
5
Arithmetic
Operator
s 6
Operator
Precedence
7
Built-In
Fun
c
tions
7
Graphics
8
Sound
and
Games
8
W
ra
pa
round
and
Key
board
Rollover 8
Error
Messages
8
2 COMMANDS
BYE
9
CONT
9
E
ND
9
LET
10
LIST
10
NEW
10
REM
10
RUN
11
S
TOP
11
3 EDIT FEATURES
Scr
ee
n E
diting
13
Control
(CTRL) Key
13
Shift
Key
13
Doub le K
ey
F
un
c
ti
ons
14
Cursor
Control
Keys
14
K
ey
s
Used
W
ith
CTRL Key
14
Keys
Used W
ith
Shi
ft
K
ey
14
Special
Function
Key s
14
Br
e
ak
Ke
y
14
Escape Key
14
4 PROGRAM STATEMENTS
FOR/NE
XT
/S
TE
P
15
GOSUBIRETURN
16
GOTO
17
I
F/T
H
EN
18
Contents
iii

ON/GOSUB
20
ON!GOTO
20
POP
20
RESTORE
21
TRAP
22
5 INPUT/OUTPUT COMMANDS
Input/Output
Devices
23
CLOAD
24
CSAVE
24
DOS
25
ENTER
25
INPUT
25
LOAD
26
LPRINT
26
NOTE
26
OPEN/CLOSE
26
POINT
28
PRINT
28
PUT/GET
28
READ/DATA
28
SAVE
29
STATUS
29
XIO
30
Chaining
Programs
30
6 FUNCTION LIBRARY
Arithmetic
Functions
33
ABS
33
CLOG
33
EXP
33
INT
33
LOG
34
RND
34
SGN
34
SQR
34
Trigonometric
Functions
34
ATN
34
cos
34
SIN
35
DEG/RAD
35
Special
Purpose
Functions
35
ADR
35
FRE
35
PEEK
35
POKE
35
USR
36
7 STRINGS
ASC
37
CHR$
37
iv
Contents

LEN
38
STR$
38
VAL
38
Str
ing
Ma
nipul
a
tion
s
39
8
ARRAYS
AND
MATRICES
DIM
41
CLR
43
9
GRAPHICS
MODES
AND
COMMANDS
GRAPHICS
45
Graphics
Modes
45
ModeO
46
Mo
de
s 1
and
2
46
Mod
es
3, 5, and 7
47
Mod
es
4 a
nd
6
48
Mode8
47
COLOR
48
DRA
W
TO
48
LOCATE
48
PLOT
49
POSITION
49
PUT/GET
49
SETCOLOR
50
XIO (
Sp
e
cial
Fill
Application)
54
A
ss
igning
Colors
to
Tex
t
Modes
54
Gra
ph
ic
s Co
nt
r
ol
C
har
acter
s
56
10
SOUND
AND
GAME
CONTROLLERS
SOUND
57
PADDLE
59
PTRIG
59
ST
ICK
59
STRIG
60
11
ADVANCED
PROGRAMMING
TECHNIQUES
Mem ory Con
servat
ion
61
Programm
i
ng
In
M
ac
hin
e La
ngu
age
63
APPENDIX
A
BASIC
RESERVED
WORDS
A-1
APPENDIX
B
ERROR
MESSAGES
B-1
APPENDIX
C
ATASCII
CHARACTER
SET
WITH
DECIMAL
/
HEXADECIMAL
LOCATIONS
C-1
APPENDIX
D
ATARI
400
/
800
MEMORY
MAP
D-1
Conte
nts
V

APPENDIX
E DERIVED FUNCTIONS
E-1
APPENDIX
F
PRINTED
VERSIONS
OF
CONTROL CHARACTERS F-1
APPENDIX
G GLOSSARY G-1
APPENDIX
H USER PROGRAMS
H-1
APPENDIX
I MEMORY LOCATIONS 1-1
INDEX
117
vi
Conte
nt
s

PREFACE
This
manual
assumes
the
user
has
read
the
Atari
BASIC -A Self-Teaching
Guide
or
some
other
book
on
BASIC.
This
manual
is
not
intended
to
"teach"
BASIC.
It
is a
reference
guide
to
the
commands,
statements,
functions,
and
special
applications
of
Atari® BASIC.
The
programs
and
partial
programming
examples
used
in
this
manual
are
photostats
oflistings
printed
on
the
Atari
820™
Printer.
Some
of
the
special
sym-
bols
in
the
Atari
character
set
do
not
appear
the
same
on
the
printer;
e.g.,
the
clear
screen
symbol
'~"
appears
as a " }
".
The
examples
in
the
text
were
chosen
to
illustrate
a
particular
function-
not
necessarily
"good"
programming
techniques.
Each
of
the
sections
contains
groups
of
commands,
functions,
or
statements
dealing
with
a
particular
aspect
of
Atari
BASIC.
For
instance,
Section 9
contains
all
the
statements
pertaining
to
Atari's
unique
graphics
capabilities.
The
appen-
dices
include
quick
references
to
terms,
error
messages, BASIC
keywords,
memory
locations,
and
the
AT
ASCII
character
set.
As
there
is
no
one
specified
application
for
the
Atari
Personal
Computer
System,
this
manual
is
directed
at
general
applications
and
the
general
user.
Appendix
H
contains
programs
that
illustrate
a
few
of
the
Atari
system's
capabilities.
Preface
vii

TERMINOLOGY
1
GENERAL
INFORMATION
This
section
explains
BASIC
terminology,
special
notations
,
and
abbre
v
iation
s
used
in
this
manual,
and
the
special
keys
on
the
AT
ARI 400™
and
AT
ARI
800
™
Personal
Computer
Systems
keyboard
.
It
also
points
to
other
sections
where
BASIC
commands
deal
with
specific
applications.
BASIC:
Beginner's
All-purpose
Symbolic
Instruction
Code.
BASIC
Keyword:
Any
reser
v
ed
word
"legal
"
in
the
BASIC
language.
May
be
used
in
a
statement
,
as
a
command,
or
for
any
other
purpose.
(See
Appendi
x A
for
a list
of
all
"reserved
words"
or
keywords
in
AT
ARI BASIC.)
BASIC
Statement:
Usually
begins
with
a
keyword
,
like
LET,
PRINT,
or
RUN.
Constant:
A
constant
is a
value
expressed
as
a
number
rather
than
represented
by
a
variable
name
.
For
example,
in
the
statement
X =
100
, X is a v
ariable
and
100
is
a
constant.
(See
Variable.)
Command
String:
Multipl
e
commands
(or
pr
o
gr
am st
at
em e
nt
s)
pl
ac
ed
on
th
e
same
numbered
line
separated
by
colons.
Expression:
An
e
xpression
is i
my
le
gal
c
ombin
a
tion
of
va
riables
, c
onstan
ts,
operators,
and
functions
used
together
to
compute
a
value.
Expressions
can
be
either
arithmetic,
logical,
or
string
.
Function:
A
function
is a
computation
built
into
the
computer
so
that
it
can
be
called
for
by
the
user
's
program.
A
function
is
NOT
a
statement
; it
is
part
of
an
expressi
o
n.
It
is r
ea
lly
a
subroutin
e
used
to
c
omput
e a
va
lu
e
which
is
then
"returned"
to
the
main
program
when
the
subroutine
returns.
COS (Cosine),
RND
(random),
FRE
(unused
memory
space),
and
INT
(integer
)
are
ex
amples
of
functions
.
In
man
y cases
th
e v
alue
is
s
impl
y as
sign
ed to a
va
riabl
e (stored
in
a
var
iable)
for
lat
er use.
In
other
ca
s
es
it
may
be
print
ed
out
on
th
e
scr
een
im-
mediately.
See Section 6
for
more
on
functions.
Examples
of
functions
as
they
might
appear
in
programs
are:
10
PF.:HH
F.l[l(
0)
(
print
ou
t
the
random
numb
er ret
urn
ed)
(add
the
value
re-
r
et
urn
ed to 100 a
nd
sto
re the
to
ta
l in
variable
X)
General In
fo
r
ma
tion 1

2 Gene
ral
Inf
orm
at
ion
Logical
Line:
A
logical
line
consists
of
one
to
three
physical
lines,
and
is
ter-
minated
either
by
a l;i#iii;lli
or
automatically
when
the
maximum
logical
line
limit
is
reached.
Each
numbered
line
in
a BASIC
program
consists
of
one
logical
line
when
displayed
on
the
screen.
When
entering
a
line
which
is
longer
than
one
physical
line,
the
cursor
will
automatically
go
to
the
beginning
of
the
next
physical
line
when
the
end
of
the
current
physical
line
is
reached
.
Ifi@ii!;lllis
not
entered,
then
both
physical
lines
will
be
part
of
the
same
logical
line.
Operator:
Operators
are
used
in
expressions.
Operators
include
addition
(+),
subtraction
(-
),
multiplication ( *
),
division (/), exponentiatinn
(A),
greater
than
(>), less
than
(<),equal
to
(=
)
,greater
than
or
equalt
o(>=),
less
than
or
equalto
(
<,:::
),
and
not equal
to
(< >
).
The
logical
keywords
AND,
NOT
and
OR
are
also
operators.
The
+
and
-
operators
can
also
be
used
as
unary
operators;
e.
g.,
-3.
Do
not
put
several
unary
operators
in
a
row;
e.g.,--3
,
as
the
computer
will
in-
terpret
it
incorrectly.
Physical
Line:
One
line
of
characters
as
displayed
on
a
television
screen.
String:
A
string
is a
group
of
characters
enclosed
in
quotation
marks.
"ABRACADABRA"
is a
string.
So
are
"
ATARI
MAKES
GREAT
COMPUTERS"
and
"123456789"
. A
string
is
much
like
a
constant,
as
it
too,
may
be
stored
in
a
variable
. A
string
v
ariable
is
different,
in
that
its
name
must
end
in
the
character$.
For
example,
the
string
"AT
ARI
800"
ma
y
be
assigned
to
a
variable
called
A$
using
(optional)
LET
like
this:
10
LET
A$="ATAF.J
8H0"
OR (note quot
ation
marks)
(LET is optional;
the
quotes are required.)
Quotation
marks
may
n
ot
be
used
within
a
string.
However
,
the
closing
quota-
tion
can
be
omitted
if
it
is
the
last
character
on
a
logical
line.
(See
Section
7 -
STRINGS).
Variable:
A
variable
is
the
name
for
a
numerical
or
other
quantity
which
may
(or
may
not)
change.
Variable
name
s
ma
y
be
up
to
120
characters
long.
However,
a
variable
name
must
start
with
an
alphabetic
letter,
and
ma
y
contain
only
capital
letters
and
numerical
digits.
It
is
ad
v
isable
not
to
use
a
ke
yw o
rd
as a
variable
name
or
as
the
first
part
of
a va
riable
name
as
it
m ay
not
be
inte
r
preted
correctly.
Examples
of
s
toring
a
value
in
a
vari
a
ble:
LETC
123Dt..J8=
1.
234
LETI
.
.JARIABLE112=267
.
543
LETA=1
LET
F5TH=6
.5
LET
TH
J::;HO
=
59
.
::
:
£19
Note:
LET
is
optional
and
may
be
omitted)
Variable
Name
Limit:
ATARI BASIC
limits
the
user
to
128
variable
names
.To
bypass
this
problem
,
use
individual
elements
of
an
arra
y
instead
of
having
separate
vari
a
ble
names.
BASIC
keeps
all
refe
r
ence
s
to
a
variabl
e
which
has
been
deleted
from
a
program
,
and
the
name
still
remains
in
the
variable
name
table.

SPECIAL
NOTATIONS
USED
IN
THIS
MANUAL
Ifthe
screen
displays
an
ERROR-4 (Too
Many
Variables)
message,
use
the
follow
-
ing
procedure
to
make
room
for
new
variable
names:
LIST
f i 1
eSPec
I'£~J
ENTER
f i 1
esPec
The
LIST filespec
writes
the
untokenized
version
of
the
program
onto
a
disk
or
cassette.
NEW
clears
the
program
and
the
table
areas.
The
program
is
then
re-
entered,
re-tokenized,
and
a
new
variable
table
is
built
.
(The
tokenized
version
is
Atari
BASIC's
internal
format.
The
untokenized
versions
in
ATASCII
which
is
the
version
displayed
on
the
screen).
Arrays
and
Array
Variables:
An
array
is a list
of
places
where
data
can
be
filed
for
future
use. Each
of
these
places
is
called
an
element,
and
the
whole
array
or
any
element
is
an
array
variable.
For
example,
define
"Array
A"
as
having
6
elements.
These
elements
are
referred
to
by
the
use
of
subscripted
va
riables
such
as
A(2),
A(3), A(4),
etc. A
number
can
be
stored
in
each
element.
This
may
be
accomplished
element
by
element
(using
the
LET
statement),
or
as a
part
of
a
FOR/NEXT
loop
(see
Chapter
8).
Note:
Never
leave
blanks
between
the
element
number
in
parentheses
and
the
name
ofthe
array.
Correct
A(23)
ARRAY(3)
X123(38)
Incorrect
A
ARRAY
X123
(23)
(3)
(38)
Line
Format:
The
format
of
a
line
in
a BASIC
program
includes
a
line
number
(abbreviated
to
lineno)
at
the
beginning
of
the
line
,
followed
by
a
statement
keyword,
followed
by
the
body
of
the
statement
and
ending
with
a
line
ter-
minator
command
(Wi!li13key).
In
an
actual
program,
the
four
elements
might
look
like
this:
Line
Number
100
STATEMENT
Keyword
PRINT
Body
A/X
*
(Z
+ 4 .
567)
Terminator
l;ljilt;t:•
Several
statements
can
be
typed
on
the
same
line
provided
they
are
separated
by
co
lons
(:).
See
IF/THEN
in
Section
5,
and
Section
11.
Capital
Letters:
In
this
book,
denote
keywords
to
be
typed
by
the
user
in
up-
per
case
form
exactl
y as
the
y
are
printed
in
this
text.
Reverse-video
characters
will
not
work
except
in
the
case
of
the
RUN
command.
Here
are
a
few
ex-
amples:
PRINT INPUT LIST END GOTO
GO
S
UB
FOR NEXT
IF
Lower
Case
Letters:
In
this
manual,
lower
case
letters
are
used
to
denote
the
various
classes
of
items
which
may
be
used
in
a
program,
suc
h
as
variables
(var)
,
expressions
(exp),
and
the
like
.
The
abbreviations
used
for
these
classes
of
items
are
shown
in
Table
1.1.
General
Information
3

ABBREVIATIONS
USED IN THIS
MANUAL
4 General Information
Items
in
Brackets:
Brackets,
[
],
contain
optional
items
which
may
be
used
,
but
are
not
required.
If
the
item
enclosed
in
brackets
is
followed
by
three
dots
[exp,
..
.],
it
means
that
any
number
of
expressions
may
be
entered,
but
none
are
required.
Items
stacked
vertically
in
braces:
Items
stacked
vertically
in
braces
indicate
that
any
one
ofthe
stacked
items
may
be
used,
but
that
only
one
at
a
time
is
per-
missible.
In
the
example
below,
type
either
the
GOTO
or
the
GOSUB.
{
GOTO}
100
GOSUB
2000
Command
abbreviations
in
headings:
If
a
command
or
statement
has
an
ab-
breviation
associated
with
it,
the
abbreviation
is
placed
following
the
full
name
of
the
command
in
the
heading;
e.g., LET (L.).
The
following
table
explains
the
abbre
v
iations
used
throughout
th
is
manual:
avar
svar
mvar
var
aop
lop
aexp
lexp
TABLE
1.1
ABBREVIATIONS
Arithmetic
Variable:
A
location
where
a
numeric
value
is
stored.
Variable
names
may
be
from
1
to
120
alphanumeric
characters,
but
must
start
with
an
alphabetic
character,
and
all
alpha
characters
must
be
unre
v
ersed
and
upper
case.
String
Variable:
A
location
where
a
string
of
characters
may
be
stored.
The
same
name
rules
as
avar
apply,
except
that
the
last
character
in
the
variable
name
must
be
a$
.
String
variables
may
be
subscripted.
See Section 7,
STRINGS.
Matrix
Variable:
Also
called
a Subscripted Variable.
An
ele-
ment
of
an
array
or
matrix.
The
variable
name
for
the
array
or
matrix
as
a
whole
may
be
any
legal
v
ariable
name
such
as
A,
X,
Y,
ZIP,
or
K.
The
subscripted
variable
(name
for
the
particular
element)
starts
with
the
matrix
v
ariable,
and
then
use
s a
number,
variable,
or
expression
in
parentheses
immediately
following
the
array
or
matrix
variable.
For
example,
A(ROW),
A(1),
A(X
+
1).
Variable:
Any
variable.
May
be
mvar,
avar,
or
svar
.
Arithmetic
operator.
Logical
operator.
Arithmetic
Expression:
Generally
composed
of
a
variable
,
function,
constant,
or
two
arithmetic
expressions
separated
by
an
arithmetic
operator
.
Logical
Expression:
Generall
y
composed
of
two
arithmetic
or
string
express
i
ons
separated
by a logical
operator.
Such
an
ex-
pression
evaluates
to
either
a 1 (logical
true)
or
a 0 (logical false).
For
example,
the
expression
1<
2 ev
aluates
to
the
value
1
(true)
while
the
expression
"LEMON"
=
"ORANGE"
evalua
t
es
to
a
zero
(false) as
the
two
strings
are
not
equal.

OPERATING
MODES
SPECIAL
FUNCTION
KEYS
sexp
exp
lineno
a
data
filespec
String
Expression:
Can
consist
of
a
string
variable,
string
literal
(constant),
or
a
function
that
returns
a
string
value.
Any
expression,
whether
sexp
or
aexp.
Line
Number:
A
constant
that
identifies
a
particular
program
line
in
a
deferred
mode
BASIC
program.
Must
be
any
integer
from
0
through
32767. Line
numbering
determines
the
order
of
program
execution.
ATASCII
Data:
Any
AT
ASCII
character
excluding
commas
and
carriage
returns.
(See
Appendix
C.)
File
Specification:
A
string
expression
that
refers
to
a
device
such
as
the
keyboard
or
to
a
disk
file.
It
contains
information
on
the
type
of
I/0
device,
its
number,
a colon,
an
optional
file
name,
and
an
optional
filename
extender.
(See
OPEN,
Section
5.
)
Example
filespec:
"D1:NATALIE.ED"
Direct
Mode:
Uses
no
line
numbers
and
executes
instruction
immediately
after
i;IJiiJ;I:I
key
is
pressed.
Deferred
Mode:
Uses
line
numbers
and
delays
execution
ofinstruction(s)
until
the
RUN
command
is
entered
.
Execute
Mode:
Sometimes
called
Run
mode
.
After
RUN
command
is
entered
,
each
program
line
is
processed
and
executed.
Memo
Pad
Mode:
A
non-programmable
mode
that
allows
the
user
to
experi-
ment
with
the
keyboard
or
to
leave
messages
on
the
screen.
Nothing
written
while
in
Memo
Pad
mode
affects
the
RAM-resident
program.
II
Reverse
(Inverse)
Video
key,
or
"ATARI
LOGO KEY".
Press-
ing
this
key
causes
the
text
to
be
reversed
on
the
screen
(dark
text
on
light
background).
Press
key
a
second
time
to
return
to
normal
text.
MOJ.Iitillo!ZJ;I
Lower
Case
key:
Pressing
this
key
shif
ts
the
screen
characters
from
upper
case
(capitals)
to
lower
case.
To
restore
the
char
a
cters
to
upper
case,
press
the
Ki@M
key
and
the
MOfW!l!l£.'1;1
key
simultaneously.
Escape
key:
Pressing
this
key
causes
a
command
to
be
entered
into
a
program
for
later
execution.
Example:
To
clear
the
screen,
you
would
enter:
10 PRINT "
IB
Bi3
MijUi;l
"
and
press
1&13.
Escape is also
used
in
conjunction
with
other
keys
to
print
special
graphic
control
characters.
See
Appendix
F
and
back
cover
for
the
specific
keys
and
their
screen-character
representations.
General Information 5

ARITHMETIC
OPERATORS
LOGICAL
OPERATORS
6 General Information
l{if31;5f.J:I
Break
key:
Pressing
this
key
during
program
execution
causes
execution
to
stop.
Execution
may
be
resumed
by
typing
CONT
followed
by
pressing
tw!lltl .
System
Reset
key:
Similar
to
l!mEI
in
that
pressing
this
key
stops
program
execution.
Also
returns
the
screen
display
to
Graphics
mode
0,
clears
the
screen,
and
returns
margins
and
other
variables
to
their
default
values.
Tab
key:
Press
Emm
and
theki!i13!;§i·i:ikeys
simultaneously
to
set a
tab.
To
clear
a
tab,
press
the
Gi3
and
4iiiid!;U!:I
keys
simultaneously.
Used
alone,
thekiU3!;§t.j;iadvances
the
cursor
to
the
next
tab
position.
In
Deferred
mode,
set
and
clear
tabs
by
preceding
the
above
with
a
line
number,
the
command
PRINT, a
quotation
mark,
and
press
the
Iakey.
Examples:
100 PRINT "
Ia
E!llil! k1U3!;$f.i:i "
200
PRINT "
..
BD
Ki#@d!;lt.i;i
"
Default
tab
settings
are
placed
at
columns
7,
15,
23,
31,
and
39
.
EmiiJ
Insert
key:
Press
the
1@1$4
and
EmiiJ
keys
simultaneously
to
insert
a line.
To
insert
a
single
character,
press
the
Bi3
and
mm
keys
simultaneously.
l@§ij:f.\3¥1
Delete
key:
Press
the
«i:U:iM
and
ED
keys
simultaneously
to
delete
a
line.
To
delete
a
single
character,
press
Gi3
and
llE!DJ
simultaneously.
Mh!J:H3¥i
Back
Space
key:
Pressing
this
key
replaces
the
character
to
the
left
of
the
cursor
with
a
space
and
moves
cursor
back
one
space.
Emil
Clear
key:
Pressing
this
key
while
holding
down
the
41:11$4
or
mill
key
blanks
the
screen
and
puts
the
cursor
in
the
upper
left
corner.
Return
key:
Terminator
to
indicate
and
end
of
a
line
of
BASIC.
Pressing
this
key
causes a
numbered
line
to
be
interpreted
and
added
to
a BASIC
program
RAM.
An
unnumbered
line
(in
Direct
mode)
is
interpreted
and
executed
immediately.
Any
variables
are
placed
in
a
variable
table.
The
Atari
Personal
Computer
System
uses
five
arithmetic
operators:
+
addition
(also
unary
plus;
e.g.,
+5)
subtraction
(also
unary
minus;
e.g., - 5)
*
multiplication
I
division
A
exponentiation
The
logical
operators
consists
of
two
types:
unary
and
binary.
The
unary
operator
is
NOT.
The
binary
operators
are:

OPERATOR
PRECEDENCE
AND
OR
Logical
AND
Logical OR
Examples:
10
IF
A=12
AND
T=0
THEN
F'RWT
"Q)00
11
Both expressions
must
be true before GOOD is
printed.
10
A=(C>l)
AND
(N<1)
10
A =
(C+l)
OR
Ol-1)
Hi
A =
NOT<
C+
1)
If
both
expressions
true,
A=
+
1;
otherwise
A=O.
If
either expression
true, A= +
1;
otherwise
A=O.
If
expression is false,
A=
+
1;
otherwise
A=
0.
The
rest
of
the
binary
operators
are
relational.
<
The
first
expression
is less
than
the
second
expression.
>
The
first
expression
is
greater
than
the
second.
-
The
expressions
are
equal
to
each
other.
< =
The
first
expression
is less
than
or
equal
to
the
second.
> =
The
first
expression
is
greater
than
or
equal
to
the
second.
<
>The
two
expressions
are
not
equal
to
each
other.
These
operators
are
most
frequently
used
in
IF/THEN
statements
and
logical
arithmetic.
Operations
within
the
innermost
set
of
parentheses
are
performed
first
and
pro-
ceed
out
to
the
next
level.
When
sets
of
parentheses
are
enclosed
in
another
set,
they
are
said
to
be
"nested".
Operations
on
the
same
nesting
level
are
performed
in
the
following
order:
Highest
<,
>,=,<=,
>=,<->
precedence
* ' I
+,
-
Lowest
precedence
NOT
AND
OR
Relational
operators
used
in
string
expres-
sions.
Have
same
precedence
and
are
per-
formed
from
left
to
right.
Unary
minus
Exponentiation.
Multiplication
and
division
have
the
same
precedence
level
and
are
performed
from
left
to
right.
Addition
and
subtraction
have
the
same
precedence
level
and
are
performed
from
left
to
right.
Relational
operations
in
numeric
expressions
have
the
same
precedence
level
from
left
to
right.
Unary
operator
Logical
AND
Logical OR
General
Information
7

BUILT-IN
FUNCTIONS
GRAPHICS
SOUND
AND
GAMES
CONTROLLERS
WRAPAROUND
AND
KEYBOARD
ROLLOVER
ERROR
MESSAGES
8 General Information
The
section
titled
FUNCTION
LIBRARY
explains
the
arithmetic
and
special
functions
incorporated
into
Atari
BASIC.
Atari
graphics
include
9
graphics
modes.
The
commands
have
been
designed
to
allow
maximum
flexibility
in
color
choice
and
pattern
variety.
Section 9 ex-
plains
each
command
and
gives
examples
of
the
many
ways
to
use
each.
The
Atari
Personal
Computer
is
capable
of
emitting
a
large
variety
of
sounds
.
including
simulated
explosions,
electronic
music,
and
"raspberries."
Section
10
defines
the
commands
for
using
the
SOUND
function
and
for
controlling
pad-
dle,
joystick,
and
keyboard
controllers.
The
ATARI
Personal
Computer
System
has
screen
wraparound
thus
allowing
greater
flexibility.
It
also
allows
the
user
to
type
one
key
ahead.
If
the
user
presses
and
holds
any
key,
it
will
begin
repeating
after
1
h
second.
If
a
data
entry
error
is
made,
the
screen
display
shows
the
line
reprinted
preced-
ed
by
the
message
ERROR-
and
the
offending
character
is
highlighted.
After
correcting
the
character
in
the
original
line,
delete
the
line
containing
the
ERROR- before
pressing
IDi!liJI.
Appendix
B
contains
a list
of
all
the
error
messages
and
their
definitions.

BYE (B.)
CONT(CON.)
END
2
COMMANDS
Whenever
the
cursor
(D)
is
displayed
on
the
screen,
the
computer
is
ready
to
ac-
cept
input.
Type
the
command
(in
either
Direct
or
Deferred
mode),
and
press
IDiJ3.
This
section
describes
the
commands
used
to
clear
computer
memory
and
other
useful
control
commands:
The
commands
explained
in
this
section
are
the
following:
Format:
Example:
BYE
BYE
BYE
CONT
END
LET
LIST
NEW
REM
RUN
STOP
The
current
function
of
the
BYE
command
is
to
exit
BASIC
and
put
the
com-
puter
in
Memo
Pad
mode.
This
allows
the
user
to
experiment
with
the
keyboard
or
to
leave
messages
on
the
screen
without
disturbing
any
BASIC
program
in
memory.
To
return
to
BASIC,
press
Htih&i;lihh.
Format:
Example:
CONT
CONT
Typing
this
command
followed
by
a l;ijili;ill
causes
program
execution
to
resume.
If
a
l:l;liiM,
STOP,
or
END is
encountered,
the
program
will
stop
until
CONT
W1!llilli
is
entered.
Execution
resumes
at
the
next
sequential
line
number
following
the
statement
at
which
the
program
stopped.
Note:
If
the
statement
at
which
the
program
is
halted
has
other
commands
on
the
same
numbered
line
which
were
not
executed
at
the
time
of
the
l:l;q.l4'
STOP,
or
END,
they
will
not
be
executed.
On
CONT,
execution
resumes
at
the
next
numbered
line. A
loop
may
be
incorrectly
executed
if.the
program
is
halted
before
the
loop
completes
execution.
This
command
has
no
effect
in
a
Deferred
mode
program.
Format:
END
Example:
1000 END
This
command
terminates
program
execution
and
is
used
in
Deferred
mode.
In
Atari
BASIC,
an
END is
not
required
at
the
end
of
a
program.
When
the
end
of
the
program
is
reached,
Atari
BASIC
automatically
closes all files
and
turns
off
sounds
(if
any).
END
may
also
be
used
in
Direct
mode
to
close files
and
turn
off
sounds.
Commands
9

LET (LE.)
LIST (L.)
NEW
REM (R.
or
·'*'491)
10
Commands
Format:
Example:
[LET]
var
=
exp
LET X = 3.142 * 16
LET
X=
2
This
statement
is
optional
in
defining
variables.
It
can
just
as
easily
be
left
out
of
the
statement.
It
may
be
used,
however,
to
set a
variable
name
equal
to
a
value.
Format:
Examples:
LIST
[lineno
[ ,
lineno]
]
LIST [filespec [
,lineno
[
,lineno]
] ]
LIST
LIST
10
LIST
I
101
100
LIST
npn
LIST
11
0:
DEt10.
LST"
This
command
causes
the
computer
to
display
the
source
version
of
all
lines
cur-
rently
in
memory
if
the
command
is
entered
without
line
number(s),
or
to
display
a
specified
line
or
lines.
For
example,
LIST 10,100 mi!Im
displays
lines
10
through
100
on
the
screen.
If
the
user
has
not
typed
the
lines
into
the
com-
puter
in
numerical
order,
a LIST
will
automatically
place
them
in
order.
Typing
L.
"P
will
print
the
RAM-resident
program
on
the
printer.
LIST
can
be
used
in
Deferred
mode
as
part
of
an
error
trapping
routine
(See
TRAP
in
Section
4).
The
LIST
command
is
also
used
in
recording
programs
on
cassette
tape.
The
sec-
ond
format
is
used
and
a
filespec
is
entered.
(See
Section
5
for
more
details
on
peripheral
devices.)
If
the
entire
program
is
to
be
listed
on
tape,
no
line
numbers
need
be
specified.
Example:
LIST
"C1"
1000 LIST
"C1"
Format:
NEW
Example:
NEW
This
command
erases
the
program
stored
in
RAM.
Therefore,
before
typing
NEW,
either
SAVE
or
CSAVE
any
programs
to
be
recovered
and
used
later.
NEW
clears
BASIC's
internal
symbol
table
so
that
no
arrays
(See Section
8)
or
strings
(See
Section
7)
are
defined.
Used
in
Direct
mode.
Format:
REM
text
Example:
10
REM
ROUTINE
TO
CALCULATE X
This
command
and
the
text
following
it
are
for
the
user's
information
only.
It
is
ignored
by
the
computer.
However,
it
is
included
in
a LIST
along
with
the
other
numbered
lines.
Any
statement
on
the
same
numbered
line
which
occurs
after
a
REM
statement
will
be
ignored.

RUN
(RU.)
STOP (STO.)
Format:
RUN [filespec]
Examples:
RUN
RUN
"D:MENU"
This
command
causes
the
computer
to
begin
executing
a
program.
If
no
filespec
is specified,
the
current
RAM-resident
program
begins
execution.
If
a filespec is
included,
the
computer
retrieves
the
specified,
tokenized
program
from
the
specified file
and
executes
it.
All
variables
are
set to
zero
and
all
open
files
and
peripherals
are
closed.
All
ar-
rays,
strings,
and
matrices
are
eliminated
and
all
sounds
are
turned
off. Unless
the
TRAP
command
is
used,
an
error
message
is
displayed
if
any
error
is
detected
during
execution
and
the
program
halts.
RUN
can
be
used
in
Deferred
mode.
Examples:
19
PRINT
11
0VER
At()
OJ..IER
AGAIN."
20
R~
Type
RUN
and
press
l;ljili;lli.
To
end,
pressl:!dy.i:i.
To
begin
program
execution
at
a
point
other
than
the
first
line
number,
type
GOTO
followed
by
the
specific
line
number,
then
pressl;liiili;!li,
Format:
STOP
Example:
100 STOP
When
the
STOP
command
is
executed
in
a
program,
BASIC
displays
the
message
STOPPED
AT
LINE
___
,
terminates
program
execution,
and
returns
to Direct
mode.
The
STOP
command
does
not
close files
or
turn
off
sounds,
so
the
program
can
be
resumed
by
typing
CONT l;l§iii;lll.
Commands
11

NOTES
12
Not
es
Other manuals for 400
14
This manual suits for next models
1
Table of contents
Other Atari Desktop manuals

Atari
Atari 520ST User manual

Atari
Atari CX2600 User manual

Atari
Atari 400 The Basic Computer User manual

Atari
Atari 400 Use and care manual

Atari
Atari 400 User manual

Atari
Atari 130XE User manual

Atari
Atari XL User manual

Atari
Atari PC3 User manual

Atari
Atari 600XL Instruction manual

Atari
Atari 800 XL ROSE User manual

Atari
Atari 800 User manual

Atari
Atari 520STE Quick start guide

Atari
Atari 1200 XL User manual

Atari
Atari 400 User manual

Atari
Atari 600XL Instruction manual

Atari
Atari 800 XL ROSE Quick start guide

Atari
Atari 800 XL ROSE User manual

Atari
Atari MEGA STe User manual

Atari
Atari 850 User manual

Atari
Atari 2600 User manual