

ERROR CODES
ERROR
CODE
2
Memory Ins
3
Va
lue
4
5
6
7
8
9
10
11
Many
Too
String
Out
of
Number
Input
Array
Argument
Fl
oating
Underflow
12
Line
Not
13
No
Matching
14
Line
Too
15
GOSUB
16
RE
TURN Error
17
Garbage
18
Invalid
Note
:
Th
that
.
e foll
resu
provid
rors
printers, or oth
fo
rmation is
ware
ERROR
CODE
ufficient
Error
Variabl
Length
Data
greater
Statement
or
String
Stack
Point
es
Error
Error
than
Error
DIM
Overflow
Overflow
Error
Found
FOR Statement
Long
Error
or
FOR
Lin
e Del
Error
String
owing
lt during the u
er
Character
are
INPUT/OUTPU
se
accessory devices. Furth
ed
with the au x ili a
MESSAGE
32767
Error
/
eted
dis k
ry
T er -
dri
er inhard
ves,
of
ERROR
CODE
142
143
144
145
146
147
160
161
162
163
164
165
166
167
168
169
170
171
-
ERROR
Ser
ial Bus
Serial
DevicP
b u s
rlone err
Read aft
Funct
ion
In
sufficient
Drive
Too
Disk
U
File
File
numb
many
full
nrecoverab
number
name
er
CODE
Data
Frame Overr
data frame
or
write
not
implemen
RAM
er error
OPEN
le
system
m i
smatch
error
POINT data length
File l
ocked
Command
inva
lid
Directory full
File
not
found
POINT invalid
MESSAGE
checks
compare
ted
files
data I/0 error
error
un
um error
error
19
20
21
128
129
130
131
132
133
134
135
136
137
138
139
140
141
LOAD
Device
L
BREAK
program Too
Number
OAD
File
Abort
IOCB
Nonexistent
IOCB
Write
Invalid
Command
Device or
BAD IO
IO
CB
CB Read On
EOF
Truncat
De
D
evice
Seri
C
ursor
vice
al
ed R
Timeout
NAK
Bus
Out
Error
Device
Only
File
~umb
ly
eco
of Rang
Long
Larger
not Open
er
Error
rd
e
For expl
an a
tion
of
Err
or
Mes
sages
see
Appendix
B.

TABLE OF MODES
Gr.
Mod
0
1
2
3
4
5
6
7
8
e Ty
Mode
pe
XT
TE
TEXT
TEXT
GRA PHI
APHICS
GR
GRA PHI
GR
A PHI
GR
APHI
GRAPH
(Column
CS
CS
CS
CS
ICS
MODE, SET COLOR, COLOR TABLE
D e
fault
Colors
LIGH T BLUE MODE 0 a
DARK BLUE ALL
BLACK
ORANGE
LI
GHT
GREEN
DARK BLUE
RED 2
BL
ACK
ORANGE
LIGHT GREEN MODES
DARK BLUE
BLACK
ORANGE
BLACK 4 0
LIG
HT GREEN
DARK BLUE
BLACK 2 L
Mode or
Co
nditi
on
nd
TEXT
WINDOWS
MODES 1 1
a
nd
Text
Mod es)
(
3,
5, 1 2
and
7 2
(Four-color
Mode
s)
MODES 4
an d 6 1
(Two-color
Mo
de
s)
MODE 8
(1 Col
or
uminances)
AND
s )
Vert.
Scre
determines
ch
be
actually
ch a
Split
20
10
20
40
40
80
80
1
60
C
olo
(aex
tu
aracter
p lotted
determine
ra
cte r
Horiz.
40 -
20
20
40
80
80
160
160
320
OLOR
SETC
(aexpl)
C
olor
gi
st er N o.
R e
0 COLOR da ta
1 ac
2
3
4
0 COLOR
2
3 plo tt
4
0 1
3
4 0
0 1
2
3
0 - -
1
2
3
4
SCREEN FORMATS
Vert.
(Rows)
e n
r
p)
a lly
to
data
to
be Ch
ed
3
1
0
s Ch
(Rows)
Full
Screen
24
24
12
24
48
48
96
96
1
92
D ESCRIP
-
ra
cter
Ch a
Bac k
ground
-
Borde1·
Cha1·acter
aracte
aracter
Ch ar
acte
Backgro
und, Bord
Graph ics
Graphi
cs
Graph
ics
-
Gr a
phics
Grap
h ics
-
-
-
aphics
Gr
Graphics p
Graphi
cs
-
Bor
der
II
Of
Colors
2
5
5
4 2
2
4
2
4
1/2
TION AN
luminance (sa
r
r
poin
poin
poi
point
point
point (background default),
oin
poi
t
t
nt
t lum i
nt
er
(ba c
(ba
ckgroun
D COMMENTS
m e color as
kground
nan
ce
(sa
d d eliiUlt )
defa
me
ult
col
Requir
bac
), Border
Bor
or
as background)
RAM
(B
y tes)
993
513
26
73
537
1
017
2025
3945
7900
kground
der
e d
1
)

CONTENTS
PREFACE
GENERAL INFORMATION
1
Terminolog
Sp
ec
ial
Abbreviations Used
Operating
Spe c
ial
Arithmetic
Operator
Built-In
Graphics
Sound
ra
p a
W
Error
COMMANDS
2
BYE
CONT
ND
E
LET
LIST
NEW
REM
RUN
S
TOP
y
Notations Used In
In
Modes
Function Keys
Operator
Precedence
Functions
and
Games
round
Messages
and
s
Key
This Manual
This Manual
board
Rollover
vii
1
3
4
5
5
6
7
7
8
8
8
8
9
9
9
10
10
10
10
11
11
EDIT FEATURES
3
ee
n E
Scr
Control
Shift
Dou b le K
Cursor
Keys
Keys
Special
Break Key
Escape Key
4
PROGRAM STATEMENTS
FOR/NE
GOSUBIRETURN
GOTO
I
F/THEN
diting
(CTRL) Key
Key
ey Functi
Control
Used With
Used W
Function
XT/STE
ith
P
on s
Key s
CTRL Key
Shi
ft Key
Key s
Contents
13
13
13
14
14
14
14
14
14
14
15
16
17
18
iii

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

LEN
STR$
VAL
Str
ing Manipulation
38
38
38
s
39
ARRAYS
8
DIM
CLR
GRAPHICS
9
GRAPHICS
Graphics
ModeO
Modes 1
Mod
Modes4 and6
Mode8
COLOR
DRAWTO
LOCATE
PLOT
POSITION
PUT /GET
SETCOLOR
XIO (Spe
Assigning
Graphic
SOUND
10
Modes
and
es
3, 5, an d 7
cial
Fill
Colors
s Contr
AND
AND
MODES
2
Application)
to
Text Modes
ol Char
GAME
MATRICES
AND
acter
COMMANDS
s
CONTROLLERS
41
43
45
45
46
46
47
48
47
48
48
48
49
49
49
50
54
54
56
SOUN D
PADDLE
PTRIG
ST
ICK
STRIG
11
ADVANCED
Mem or y Con
Programming
APPENDIX
APPENDIX
APPENDIX
APPENDIX
PROGRAMMING
servat
ion
In Mac
A
BASIC
B
ERROR
C
ATASCII
WITH
hin
e La
RESERVED
MESSAGES
DECIMAL
HEXADECIMAL
D
ATARI
MEMORY
TECHNIQUES
ngu
age
WORDS
CHARACTER
/
LOCATIONS
400/800
MAP
SET
Conte
A-1
B-1
C-1
D-1
nts
57
59
59
59
60
61
63
V

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

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

This
section
used
in
Personal
BASIC
commands
explains
this
manual,
Computer
BASIC
and
Systems
deal
with
terminology,
the
special
keyboard
specific
GENERAL
INFORMATION
special
keys
on
.
It
also
applications.
notations, and
the
AT
points
ARI 400™
to
other
abbreviation
and
AT
sections
ARI
1
800
where
s
™
TERMINOLOGY
BASIC:
BASIC
used
for
BASIC
RUN.
Constant:
by a variable
100
Command
same
Expression:
operators,
either
Function:
called
expression.
"returned"
RND
functions. In
var
mediately.
might
Beginner's
Keyword:
in a statement, as a command,
a list
of
all
Statement:
A
is a constant.
String:
numbered
and
arithmetic,
A
for
by
It
to
(random),
iable)
for
See Section 6
appear
All-purpose
Any
"reserved
Usually
constant
name. For
An expression
functions
function
the
is really a subroutine used
the
man
lat
in
is a
(See
Variable.)
Multiple commands
line
separated
logical,
user
's
main
FRE
(unused
y cases the v
er use.
programs
Symbolic
reserved
words"
value
example,
used
or
is a
computation
program. A function
program
In
other cas
for
word
"legal" in
or
for
or
keywords
begins
is i
string
memory
more
are:
with a keyword, like
expressed
in
the
statement
(or program statem ents) plac
by
colons.
my legal combination
together
alue
to
.
built
when
space),
is simpl
es
it
on
functions.
the
may
Instruction
any
other
in
as a number
compute a value.
into
is
NOT
to comput
subroutine
and
y as
sign
b e
Code.
the
BASIC
purpose.
AT
ARI BASIC.)
rather
X =
100
of variables
the
computer
a
statement
e a value which
returns.
INT
(integer) are examples
ed to a variabl
print
ed
out
Examples
language.
(See
Appendi
LET,
PRINT,
than
represented
, X is a v
Expressions
of
ariable
, c
so
that
; it
is
COS (Cosine),
e (stor ed
on the
functions
ed
onstan
it
part
scr
een
May
x A
and
on the
can
can
of
is
then
in
im-
as
they
be
or
ts,
be
be
an
of
a
10
PF.:HH
F.l[l(
0)
(
print out
numb
(add
return
sto
re t he tota
variable
the
er ret
urn
the
value
ed to 100 a
X)
General Information 1
random
ed)
re-
nd
l in

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

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

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

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

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

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

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

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

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

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

NOTES
12
Not
es

In
addition
control
conjunction
The
following
keys
to
that
with
the
key
special
allow
the
4.jiii$M or
functions
function
immediate
Gml Gml
4
111
41
1
Gml
Gml
Gml
D
D
Gml
41111jM
AiU!il
@I
hiM
=
Gml
=
keys
described
Gml
are
described
11
H-i3;il
editing
capabilities.
keys.
in
mDI
•t:M3;''
mma
MIP.!itiJ«•M;M
EDIT
FEATURES
in
this
Section 1,
These
section:
m1l
Gml
m1l
there
keys
1
2
3
'='d:t.U'
..
are
are
3
cursor
used
in
SCREEN
EDITING
The
keyboard
known
l;iiiii!;ill
in
Example:
To
key.
program.
The
41111$4
as
key
RAM.
delete
Merely
screen
screen
must
1
2t1
30
line
deleting
and
and
editing.
be
f1
F.~Ei'1
F·R
F·~~Ir·iT
20
from
keyboard
display
Each
pressed.
PF.~E~:;::;
I
~-iT
:
PP
HTHI~:;
the
program,
the
line
as
Control
the
that
the
on
setting
program
Striking a key
duce
three
Shift
numeric
upper
are
logically
time a change
Otherwise,
~:ET~JR~·~
I
f·.iT
IS
LI:·-~E
type
from
the
screen
I/0
devices
key.
arrow
keys
allow
the
screen
the
without
screen.
and
lists,
the
upper-left
functions.
key:
This
keys
half
oft
combined
the
change
AFTEF
1
the
line
display
are
described
Striking
produces
user
Other
clearing
and
while
key
to
display
hose
is
completed
is
L I
f·~E
Ot·~
THE
number
this
the
to
move
changing
key
of
tabs,
the
graphics
holding
symbol
is
used
the
keys.
It
for a mode
on
the
not
made
to
EDIT
:::cPEEf·-i.
and
press
does
not
delete
in
Section 5.
key
in
conjunction
cursor
the
combinations
in
is also
control
cursor
any
characters
halting
control
the
Gml
on
those
conjunction
symbols
used
of
operation
screen,
the
program
!1
the
it
from
functions
anywhere
already
control
and
restarting
symbols.
key
will
keys
with
shown
in
conjunction
the
l;iiill;lll
the
with
on
the
pro-
having
the
on
the
Edit Features
13

with
other
normal,
function
tion,
and
brackets,
keys
to
upper
case
symbols
[ ],
above
multiplication
and
question
insert
letter
and
delete
display,
the
subtraction
operators
mark,?.
lines,
and
to
display
, equals,
as
well
return
as
to
the
addi-
the
a
DOUBLE-KEY
FUNCTIONS
1£11
Like
more
Bml
Bml
D
the
than
2
3
other
1
h
keys
second
on
the
causes
Cursor
Moves
cursor
the
program
Moves
cursor
ing
the
Moves
cursor
ing
the
cursor
Moves
the
program
Atari
the
keys
Keys
Used
Inserts
Deletes
Stops
without
Rings
buzzer
Indicates
Control
program
program
keyboard,
one
one
temporarily
"breaking
end-of-file.
Keys
up
one
or
display
one
down
one
or
display.
to
repeat.
With
character
character
.
physical
space to
or
display.
one
or
display.
space
holding
BiD
space.
or
and
out" of
.
the
physical
to
the
left
the
space.
restarts
the
line
without
right
without
line
without
cursor
program.
without
disturbing
control
screen
changing
disturb-
chang-
keys
for
display
14
Edit Features
«iUii+
41hliM
1
Vt1:taM
l:mm
Keys
Used
Inserts
Deletes one
Returns
characters.
Special
Stops
READY
Allows
be
Gml
screen
program
and
PRINT "
one
Function
program
on
commands
placed
190.1;1
in
E!D
screen
Deferred
line
Ia
With
physical
physical
execution
the
screen,
in
Deferred
clears
number.
together.
GmJ
E!71J1!
line.
line.
display
Keys
and
normally
mode;
the
mode,
Press
IUf.i;i
to
or
displays
used
screen
type
"
upper-case
program
cursor.
in
Direct
e.g
.,
In
display.
the
following
1B
then
alphabetic
list,
prints
mode
Direct
To
clear
after
press
a
to
mode,
the
the
Em1l

This
section
conditional
plains
variables.
The
following
FOR,
GOSUB/RETURN
GOTO
branches,
the
means
TO,
STEP/NEXT
explains
the
error
of
accessing
commands
commands
traps,
and
data
are
described
IF/THEN
ON,GOSUB
ON,GOTO
associated
subroutines
and
the
in
PROGRAM
STATEMENTS
with
loops,
optional
this
section:
and
their
command
POP
RESTORE
TRAP
conditional
retrieval.
used
It
for
and
also ex-
defining
4
un-
FOR
(F.),
TO,
STEP/NEXT
(N.)
Format:
Examples:
This
command
cuted.
The
NEXT
avar
aexp3
in
the
decimals,
increments
stops
and
NEXT
statement;
Loops
can
pleted
nested
before
loop
10
FOF.:
:::IJ
PF.:HH 110UTER
30
Z=f1
40
Z=Z+2
50
FOP
6~3
PF.:It·H
7f1
t·~E>::T
:::0
t·4E>::T
90
am
FOR
avar = aexp1
NEXT
avar
FOR X = 1
NEXT X
FOR Y = 10
NEXT Y
FOR INDEX = Z
NEXT INDEX
sets
up a loop
loop
variable
statement
STEP
statement.
or
fractional
by
one.
When
the
program
it
may
be
nested,
program.
>=:=
'·.1-i
1-1
'··'
I
>=:
one
returning
1
TO
3
C" ,-......
TO
·-'
II
I
Nt·iE~:
TO
10
TO
20
TO
and
(avar) is
is
encountered,
The
numbers.
the
proceeds
be
on
within
to
the
LOOP"
~:,
-,
.::
I t.:-
.::..
LOOP
TO
aexp2
STEP 2
100 * Z
determines
initialized
aexp3
If
there
loop
completes
to
the
the
same
another.
outer
loop.
n
[STEP
to
the
loop
can
is
statement
line
In
this
The
how
the
variable
be
no
STEP
the
or
case,
following
aexp3]
many
value
of
positive
aexp3
limit
immediately
on
the
next
the
times
the
aexp1.
is
incremented
or
negative
command,
as
defined
sequential
innermost
example
loop
is exe-
Each
time
by
integers,
the
by
aexp2,
following
line.
loop
is
illustrates
the
the
loop
it
the
com-
a
Figure
4-1.
Nested
Loop
Program
Program
Statements
15

In
Figure
before
the
the
of
passes
been
this
inner
NEXT
defined
complete
The
aexp3
value
The
2.
program
4-1,
the
outer
first
loop
loop. Note
statement
is
determined
as 0,
three
passes
in
the
step
run
loop
reaches
that
for
the
by
then
redefined
through
statement
is
illustrated
will
its NEXT X
the
NEXT
outer
the
STEP
the
in
complete
statement,
statement
loop.
In
statement
as Z +
inner
could
also
Figure
three
the
2.
Using
loop
have
4-2.
passes
the
for
the
example,
(STEP
this
before
returning
been
(X
= 1
program
inner
loop
the
inner
Z).
In
data,
the
defined
to 3 ).
gives
must
loop's
this
case, Z
computer
to
the
outer
as
the
However,
control
to
precede
number
has
must
loop.
numerical
GOSUB (GOS.)
RETURN (RET.)
OUTEF.:
I
I
I
OUTEP
I
I
I
OUTEP
IHt·4ER
I
t·4t-~EF.~
I
t·~HE~~
The
return
dresses
when
Format:
Example:
referred
used,
LOOP
t·~t·-IEF.:
LOOF'
t-~t-~EF.:
LOOP
t-~HEP
LOOP
LOOF'
t·~t-lE~:
LOOP
t-~t-~EP
LOOP
t-~t-~ER
LOOP
LOOP
LOOP
LlJOP
LOOP
Figure
address
the
for
to
as a stack.
information
GOSUB
lineno
RETURN
100
GOSUB
2000 PRINT "SUBROUTINE"
2010 RETURN
the
lineno
2000
4-2.
loops
is
The
"popped"
Nested
are
placed
information
Loop
off
Execution
in
a special
is
"pushed"
the
stack
group
(see
on
POP.)
of
memory
the
stack
ad-
and
16
Program Statements
subroutine*
A
generally
gram
sequence
user
to
"call"
contain
line
Like
uses a
a RETURN
following
the
preceding
stack
normally;
"popped"
• Generally, a
and
program-entering
is a
program
used
when
using
the
subroutine!,
statement.
the
GOSUB
FOR/NEXT
for
its
return
e.g., a GOTO
off
the
stack
subroutine
can
time,
an
operation
the
same
address.
lineno
(see
do
anything
and
or
routine
must
or
different
if
necessary.
The
RETURN
statement.
command,
If
before
POP)
or
that
to
make
programs
used
to
be
replaced
values.
The
statement
the
the
subroutine
a RETURN,
it
could
cause
can
be
done
easier
compute a certain
several
This
last
line
GOSUB/RETURN
the
future
in a program.
to
read
ofthe
goes
is
not
GOSUB
and
times
command
subroutine
back
allowed
address
errors.
It
is
used
debug.
value, etc.
within a pro-
allows
must
to
the
physical
command
to
complete
must
to
save
memory
It
the
is
be

To
main
ing
H3
:::·r_-1
-'"
30
4~-:-1
5[
6~1
70
:::o
90
1
101[1
prevent
program),
program
accidental
place
demonstrates
PRH-H
:;,
.·.F~~-~.
")"
E',:-!,H·.
~.
- L!.:r - r
i,F'L
>=:=100
co::;tJE:
1
::<=120
GOSUE:
1
1
oo~J
0(1~3
>::=50
Go::;ut: 1 a·.;:Jo
Et·~D
~1(1~1
'/=3::;::::-::
;:-:;:;;::+\'
triggering
an
....
t '
~.-.
END
the
E
,-,r
of a subroutine
statement
use
of
subroutines.
~-,-
..
-.,
'P
·.liJ.::~_
'F.'ET'jr•L'
Iu.··
preceding
•, : ! f':.ri
(which
the
subroutine.
normally
(Clear
follows
The
screen)
the
follow-
GOTO
(G.)
In
the
above
times
to
compute
the
results
of
400
480
200
Format:
Examples:
The
GOTO
command
command.
number
stant
non-existent,
preceding
statement
IF/THEN)can
lustr
will
ates
They
or
make
line
will
two
Figure
program,
executing
and
4-3.
print
301-J
360
15(1
Figure
{GO
GOTO
100 GOTO 50
500 GOTO
arbitrary
an
may
not
be used
uses
4-4.
TO} aexp
is
both
express
renumbering
error
result
be
executed.
to break out
of the GOTO
GOSUB/RETURN
the
subroutine,
out
different
this
program.
GOSUB/RETURN
(X+ Y)
an
unconditional
immediately
ion. How
the
results.
in
an "endless" loop. Statements
Note that a conditional
command.
beginning
values
transfer
ever,
program
Any
GOTO
of
a GOTO
branch
using
difficult.
Program
at
of X andY.
Program
statement
program
anything
If
statement
loop. The
Listing
line
1000, is
Figure
Run
just
control
other
the
target
that
following
branching
following
called
4-4
illustrates
like
the
GOSUB
to a target
than
line
number
bran
ch es
a GOTO
statement
program
three
lin
a con-
to
(see
il-
e
is
a
Program
Stat
eme
nts
17

10
20
30
40
50
6f1
65
70
:::0
90
95
1
fij
11(1
E'0
130
14(1
150
PRHH
F'~:ItH
PR
nn
P~:
HH
PRI~H
P~:nn
GOTO
PF.:ItH
P
F.~ I r-~T
F•k: I t·iT
Et-iD
F'F.:
H-iT
FtR
I
t·iT
F'F.:It·H
F,F.:
I
f·~T
F)~~ I ~-iT
GOTO
:PRINT
"n.~r
"ONE
11
"THPEP
"FOUP"
11
"FI'..JE
101:1
"$$$$$$$$$$$$$$$$$"
II~-~~-~;-~~-~~-~~-~~-~~-~~·~~-~~
11
???'??????:?????'?'?? n
!!
~=;I:=-::
II
II
::;El.)Et
·f'
-~~-
~~-~~-~~-~~-~~-~"
aEIGHF
II
t·i1
t·~E
H
!I
TEf·~
II
70
Upon
execution,
the
three
rows
temporarily
with
the
printing
cond
GOTO
just
an
example.
were
used.)
Ot
·£
the
of
while
statement
This
The
program, when
HID
Tl-f.:EE
FOUF.:
FI!..JE
~:;£1.,.1£
t·~
EIGHT
t·HNE
THl
$$$$$$$$$$$$$$$$$
'?'??????'?'
'?'
?''?'?'?'?'???
Figure
numbers
symbols.
the
program
of
the
which
program
Figure
4-5.
in
The
symbols
numbers
transfers
could
4-6.
GOTO
the
above
executes
" SIX"
program
be
executed,
GOTO
Program
listing
listed
on
the
GOTO
through
rewritten
looks
Program
Listing
will
be
lines
70,
100
"TEN
control
so
that
like
Run
listed
80,
command.
" ,
then
back
no
the
follow ing:
first
and
90
executes
to
line
GOTO
followed
are
ignored
It
proceeds
these
70
.
(This
statements
by
-
is
IF/THEN
18
Program
Statements
Format:
Examples:
IF
aexp
IF
X =
IF
A$
IF
AA
IF X =
THEN {
100
THEN 150
= "
AT
= 145
100
THEN X = 0
lineno
statement [:statement
ARI
and
" THEN
BB
200
= 1 THEN PRINT
... ]
}
AA,
BB

The
IF/THEN
occurs
arithmetical
the
false
to
In
and
statements
ecuted
on
The
statement
The
only
program
(a
logical
the
next
the
format,
specifies
if
and
the
same
statements
following
Y = 3
statement
if
certain
or
logical.
executes
0),
the
numbered
IF
aexp
the
line
occur
after
only
if
line. For
R=9
will
program
is a conditional
conditions
If
the
aexp
the
THEN
rest
ofthe
line.
THEN lineno,
number
the
THEN, se
the
expression
example:
: GOTO 100
be
executed
demonstrates
are
following
part
of
statement
lineno
to go to
parated
is
true.
will
be
if
X=
5.
the
branch
met.
the
the
statement.
is
ignored
must
if
the
Several IF
executed
IF/THEN
statement.
These
IF
statement
and
be
a cons
expression
by
colons,
only
statement.
This
conditions
is
If,
however,
program
tant,
is
then
statements
if
X=S
type
may
true
not
true.
they
and
ofbranch
be
(non-zero),
the
control
an
expression
If
will
may
be
Y=3. The
either
aexp
is
passes
several
be
ex-
nested
5
GRAPHIC~;
10
? =?
20
IF
~:;
HEF.~E
30
? = ?
s
HH~E
40
IF
REALL'l'
WLL
BE
50
·?
:?
1
OF.:
AFTEF:
LA'r'ED.
6f1
GOTO
Et-HER
A
Et·l
E>{ECUTIOt-~
IS
THE
A
t·WT
R ''lES)
EtHER
A=1
A
'/ES ) IT
E::<ECUTIOt-~
R
"'i'E~:;
..
ENTEP
A
0:?
"ENTER
A=
1
THEH
~·JILL
t£UEF.~
II
A
I~:
;
L·JHH~
THE
A=l
THEt
·i ? ; '?
1.
II
:
REt-1
E>TCUTED
HE>~ECUTIOf·~
I 'rE; ·'
u
10
1 .
E:;::ECUT
E:=O::PRESSIOt-~
COtH
IT
IS
IS
F.:EALL
COtH
IT
I::;
:?
II
Au
j:
HlPUT
4t1 : F.:Et-1
BE
E:=<ECUTED!
HOT
1 .
D~PPE::s
11
A=1
t1UL
iiPLE
ot·ll\'
COt·iT
IT
I
~3
Figure
4-7. IF/
IOH
IS
FAL~3E.
H~UES
REALL\'
H4UE::;
F.:EALL'r'
\'
HERE
1'
1 .
HEF.:E
1'
A
t·1i-'ttT I PLE
E:=<ECUT
IF
I
oN
I
Ot
·i r s
II:?
"\'ES..
:~;TATEt1HHS
A=l
! !
I
~-iUE~;
HEF.:E
REALL'r'
THEN
COt-H
H~UE~3
IF
A<> 1 OR
IS
DISPLAYED
IF
A<>
IS
DISPLA'/ED.
FALSE
1 I
DH10
11
IF
:::TATH1Et·H
!
com r
t·UE
.
II
IT'
IS
HEPE
IF
A<
>
Is
D I
SF'
Program
HEF.~E
~JH
AFTE
.
1
OR
AFTE
(enter
(enter
ed
ed
Z)
1)
Figure
4-8. IF/
THEN
Program
Execution.
Program
Statements
19

ON/GOSUB/
RETURN
ONIGOTO
Format:
Examples:
Note:
These
statement. However,
positive
number)
passes
resulting
and
so on.
in
the
statement
the
selected
ment.
The
following
1 a
:=<=r.:
:C.'€1
Ot-.1
313
IF
413
GOTO
50
END
100
GOSUB
two
statements
number
value
to
the
number
If
the
list,
the
which
subroutine
+ 1
:=<
GOTO
:-:::>5
10
PRHH
ON
aexp
100
ON
100
ON A GOSUB
100 ON
and
which
up
to
first
is 2,
resulting
conditions
may
routine
Tli'H~
"t·IDL·J
10
200
PF.:IrH
"t·[I~J
Hi
3tl)
F'RHH
"t·KIL·J
10
40J)
10
50t1
PF.:ItH
PF.:HH
"t·[ll·J
"t·~O~·J
w
{ GOTO}
GO
X GOTO 200, 300, 400
SQR(X)
GOTO
are
these
is
255.
lineno
program
or
may
is
demonstrates
100
..
200
PRHH
L·JO~~f:::WG
~·JO~:K
L·JOF.:K
l
·JORK
l·
JOF.:KIHG
lineno [ ,lineno
SUB
1000, 2000
GOTO
30,
may
not
be
also
conditional
two
are
more
then
rounded
If
the
resulting
in
the
list
control
number
are
executed
not
..
30f1
not
is 0 or
met
be
..
400}
located
and
"CIX1PLETE.
AT
LH~E
I
~-~G
AT
LH~E
I
t·~G
AT
LWE
I
t·~G
AT
LH~E
AT
Lir~E
the
..
.]
10, 100
abbreviated.
branch
powerful.
to
the
nearest
number
following
passes
is
and
then
ON/GOTO
the
to
greater
program
on
the same
control
500
II :
HID
100'':
GOTO
200" =
GOTO
300" :
GOTO
11
400
:GOTO
501-3"
:
GOTO
statements
The
aexp
positive
is
1,
then
GOSUB
the
second
than
the
control
line.
passes
statement:
like
the
IF/THEN
must
evaluate
integer
program
or
GOTO.
lineno
number
passes
to
With ON/GOSUB,
to
the
in
the
of
the
next
to
(whole
control
If
list,
linenos
next
state-
a
the
POP
20
Program
Stat
emen
ts
When
the
t·~Ol·J
t·~C~·l
r~Ql.l
t·mL·l
~·JOF.:KH~
L·lO~:t:::
~·lORK
l·lORK
t·mL·J L·JOF.:K
COt·1PLETE
Format:
Example:
program
WG
n~,;
Hf.~
AT
I
t·~
~
AT
.
Figure
POP
1000 POP
Figure
is
AT
LmE
AT
LINE
AT
LI
L
L I
4-9 ON/
executed
100
200
t-~E
300
It-~E
40(1
t·~E
500
4-10 ON/
GOTO
, it
GOTO
looks
Program
like
the
Program
Listing
following:
Execution

In
the
description
of
memory
controls
GOSUB.
memory
GOSUB
for a new
The
POP
1.
It
must
2.
It
must
back
The
following
GOSUB
10
Go~:;us
15
F.:Et-1
:::1:.1
PF.:
AGE.
30
PF.:WT
SSAGE.
40
POP
999
1
f1t-:::1~~1
1010
1020
of
the
addresses
the
number
If a subroutine
location
is
executed,
GOSUB,
command
to
when
be
in
follow
the
main
example
the
of
that
use
must
the
the
RETURN is
1000
LINE
20
I
t·n
II
t·~OPt·1AL
H
11
ABt·iOlmAL
11
HiD
F~~~
I
t·iT
II
t·~o~~J
GOTO
30
~:ETUF:ti
FOR/NEXT
reserved
of
loops
is
not
the
stack
top
location
a POP
to
be
used
execution
execution
program
demonstirates
WLL
F.:ETuft:t·~
PETUF:t-l
E::<ECiJT
statement,
for
return
to
be
executed
terminated
is still
clear
according
path
of
any
by
a RETURN
not
executed:
t·mT
BE
FR I t·ns
I
t·i~~
the
addresses.
and
by
a RETURN
loaded
needs
the
of
to
data
the
program.
GOSUB
the
with
be
from
to
the
statement.
use
E>=:ECUTED
TH
I~=;
PPrt-n::;
~:;uE:F.:CHJT
THI::;
I
stack
The
the
RETURN
some
cleared.
the
top
following
statement
of
the
t·1Ef;~:;
r·1E
t·1E
.
!I
was
defined
top
entry
statement,
numbers.
To
location
that
POP
command
in
target
prepare
in
rules:
is
not
as a
group
the
line
the
If
another
the
the
brought
with
stack
for
top
stack
stack.
a
a
RESTORE (RES.)
Format:
Example:
The
Atari
keeps
track
tional
aexp,
in
the
pointer
statement
10
20
30
40
50
60
70
00
90
On
the
50
will
Figure
RESTORE [aexp]
100 RESTORE
Personal
ofthe
the
program.
to
the
first
permits
FOR
N=1
READ
A
Computer
DATA
RESTORE
Used
with
DATA
repetitive
TO
2
RESTORE
READ
B
t·l=A+B
PRIHT 11TOTAL
NE:>\T
N
END
DATA
30,15
first
print
pass
SUM
Figure
through
4-12.
TOTAL
4-11.
GOSUB
System
statement
statement
the
item
use
optional
on
the
of
the
item
resets
EQUALS 11;M
Restore
the
loop, A
EQUALS
will
60,
Statement
contains
to
that
aexp,
line
specifed
same
Program
be
but
be
read
pointer
the
by
data.
Listing
30
and B will
on
the
With
POP
an
internal
next.
Used
to
RESTORE
the
value
be
second
pass, A
without
the
first
statement
ofthe
30 so
"pointer"
DATA
sets
aexp.
the
total
will
equal15
the
that
op-
item
the
This
line
Program
Statements
21

and
B,
PRINT
because
statement
of
the
in
RESTORE
line
50
will
statement,
display
SUM
will
TOTAL
still
equal
30.
EQUALS
Therefore,
45.
the
TRAP
(T.)
Format:
Example:
The
TRAP
an
error
when
an
The
TRAP
ecuted,
the
the
that
but
trap
beginning
the
message
of
the
line
statement
TRAP
TRAP
aexp
100 TRAP 120
statement
is
detected. Without
error
statement
once
with
another
TRAP
(see
Appendix
where
is
is
encountered
works
an
error
of
the
section
is
reset
the
error
with
used
has
TRAP
after
B).
256
an
aexp
to
direct
the
program
a TRAP
and
on
been
command.
of
each
displays
any
detected
code
statement,
error
that
This
that
handles
error.
an
and
TRAP
PEEK(195)
*PEEK(187)+ PEEK(186)
occurred.
whose
The
value
TRAP
is
from
to
the
error
may
occur
trapped,
command
input
may
32767
a
specified
program
message
after
it
is
from
will
give
will
give
be
cleared
to
line
number
stops
executing
on
the
screen.
it
has
necessary
may
be
the
keyboard
you
you
the
by
executing
been
placed
an
ex-
to
reset
so
error
number
if
at
65535 (e.g., 40000).
a
22
Program
Statements

5
INPUT/OUTPUT
INPUT/OUTPUT
DEVICES
COMMANDS
This
section
them.
The
commands
input/output
data
into
the
mands
geared
The
CLOAD
CSAVE
DOS
ENTER
The
individual
system
peripheral
single
symbolic
must
trol
are
for
commands
hardware
provides
entry
device
be
opened
Block
(IOCB).
describes
devices.
RAM
and
those
associated
generating
described
configuration
manuals
the
devices
point
in
and a device-independent
name
before
From
the
input/output
explained
The
input
the
devices
output
in
INPUT
LOAD
LPRINT
NOTE
furnished
user
with a single
a (largely)
used
to
access
then
in
commands
with
retrieving
.
this
section
of
each
with
independent
identify
and
each
on,
the
devices
this
section
geared
of
the
each.
it;
must
device
AND
and
how
are
those
are
those
for
accepting
data
from
are:
OPEN/CLOSE
POINT
PRINT
PUT/GET
following
The
interface
calling
e.g.,
be
is
Central
to
manner.
sequence.
K:
for
assigned
referred
devices
the
DEVICES
data
is
moved
that
allow
associated
input. The
RAM
and
READ/DATA
SAVE
STATUS
XIO
is
illustrated
Input/Output
access all
This
means
Each
keyboard.
to
an
Input/Output
to
by
its
access
with
output
the
of
the
device
Each
IOCB
between
getting
devices
(CIO)
system
there
device
number.
to
com-
in
sub-
has
Con-
the
the
is
a
a
ATARI
System
includes
variables.
IOCB
user
IOCB
IOCB
IOCB
through 5 are
IOCB
statements
Keyboard:
converted
Line
characters, a line
Program
device
cassette
track
through
BASIC
the
the
AT
to
use.
may
not
11'6
for
11'7
is
number
11'7
is
Printer:
Recorder:
which
has
cannot
the
information
command,
ARI BASIC
BASIC
request
input
used
may
use.d
in
use,
from
(K:)
(ATASCII)
can
two
be
television
contains 8 blocks
it
needs
buffer
reserves
IOCB
and
output
by
BASIC
also
in
opening
it
will
being
performed.
Input
keyboard
(P:)
Output
at a time.
(C:)
be
used
tracks for
recorded
speaker.
sets
for
be
only
Input
length,
up
IOCB
11'0.
The
to
the
referred
the
prevent
device.
data
only
It
recognizes
as
either,
sound
from
in
RAM
which
to
perform
the
ItO
for
GRAPHICS
the
screen.
LPRINT, CLOAD,
to
other
LPRINT
The
as
device.
and
Output
and
the
ATARI
buffer
lOCH's,
1/0
as
the
devices
keyboard
each
no
but
never
program
an
address,
but
to
(This
device
or
key
The
control
device.
system,
identifies
I/0
operation.
and
the
user
the
Screen
statement
is
the
and
(or
for
input/output
some
allows
is
pressed.
line
printer
characters.
The
as
both
recording
but
I/0
to
the
This
two
auxiliary
must
specify
Editor,
(see Section
graphics
CSA
VE
commands.
file)
number.
of
the
other
the
user
prints
recorder
Commands
is a
simultaneously.
purposes.
may
be
Operating
information
control
which
therefore
9)
opens
window
The
IOCB's 1
operations.
BASIC
to
read
ATASCII
read/write
The
The
audio
played
and
Devic
back
es
the
S:).
If
I/0
the
23

Disk
Drives:
installed,
is
attached,
the
(Dt:,
ATARI
there
D2:, D3:,
can
is
no
need
use
D4:)
from
to
Input
and
one
to
four
add a number
Output
disk
after
devices.
drives.
the
symbolic
If
If
only
16K
of
one
disk
device
RAM is
drive
code
D.
CLOAD
(CLOA.)
Screen
and
this
position.
allows
entire
record
TV
characters
screen
See
Interface,
face
contains a parallel
tached.
Format:
Examples:
This
from
to
However,
structions
Recorder
paragraphs
Editor:
display
device
Reading
the
logical
to
be
Monitor:
addressing
Section 9 for a complete
with
command
cassette
indicate
Manual.
(E:)
(see
TV
causes
user
from
RS-232:
RS-232-compatible
do
for
data
from
to
enter
line
transferred
(S:)
Input
and
mechanism.
port
CLOAD
CLOAD
100 CLOAD
can
tape
into
that
the
not
press
CLOADing a
under
CHAINING
Input
Monitor)
to
and
within
and
write
(R:)
to
be
used
RAM
PLAY
PLAY
Steps
and
to
appear
this
device
edit
which
by
CIO
Output
characters
Both
description
The
RS-232
devices
which
in
either
for
button
until
program
for
loading
PROGRAMS
Output
simulate a screen
data.
to
the
execution.
device.
on
the
activates
Whenever
the
cursor
the
user
device.
to
text
and
of
device
such
80-column
Direct
needs
after
the
are
oversized
display
the
resides
program.
This
the
display,
graphics
the
graphics
enables
as
printers,
printer
or
Deferred
On
entering
to
be
tape
contained
at
This
device
editing
starting
screen
the
l;ljiil;ill
is
(See Section
device
using
operations
the
terminals,
(ATARI
mode
pressed
has
been
in
the
programs
the
end
uses
terminal.
at
the
editing
key
selected
allows
the
the
modes.
AT
ARI
system
825TM)
to
load a program
CLOAD,
followed
positioned.
ATARI
are
included
of
this
section.
the
keyboard
Writing
current
process
is
pressed,
as
the
9).
user
cursor
are
supported.
and
plotters.
can
one
bell
by
Specific in-
410
to
cursor
and
the
current
to
read
as
the
to
inter-
It
be
at-
rings
lam
Program
in
the
.
CSAVE
24
I/0
Commands
(CS.)
and
Devices
Format:
Examples:
This
command
onto
cassette
ing
CSA VE
be
pressed
tape
has
rather
Notes:
than
Tapes
patible
It
CSAVE.
For
cue
CSAVE
CSAVE
100 CSAVE
100
tape.
two
followed
been
positioned.
a SAVE
saved
may
specific
the
cs.
is
usually
CSA
VE
bells
ring
by
li!IBJ. Do
"C"
using
be
necessary
Otherwise,
instructions
tape,
etc.,
used
in
Direct
saves
the
to
indicate
It
is
faster
(see SAVE)
the
two
to
enter
CSAVE
on
see
the
ATARI
mode
to
tokenized
that
not, however,
to
because
commands,
may
how
version
.the
PLAY
save a program
short
an
LPRINT (see
not
work
to
connect
410
Program
save a RAM-resident
ofthe
program.
and
RECORD
press
these
buttons
using
inter-record
SAVE
and
properly.
and
LPRINT)
operate
Recorder
gaps
CSA VE,
Manual.
buttons
this
are
are
before
the
hardware,
program
On
enter-
must
until
the
command
used
not
com-
using
.

DOS
(DO.)
Format:
Example:
The
DOS
(DOS).
If
puter
will
to
Direct
displayed.
then
passes
Cartridge)
The
DOS
program.
DOS
DOS
command
the
Disk
go
into
mode.
If
To
clear
to
BASIC.
on
the
command
For
more
is
used
Operating
Memo
Pad
the
Disk
the
DOS
Control
DOS
Menu.
is
usually
details
to
go
from
System
mode
and
Operating
Menu
from
can
also
used
in
on
this,
has
the
System
be
Direct
see
BASIC
not
been
user
the
screen,
returned
mode;
the
Atari
must
has
to
the
booted
press
been
press
to
BASIC
however,
DOS
Disk
Operating
into
memory,
IMMM';!i@!ll
booted,
the
DOS
*'itii#&l;li!Mi.
by
selecting B (Run
it
may
Manual.
be
System
the
com-
to
return
Menu
Control
used
in
is
a
ENTER(E.)
INPUT
(I.)
Format:
Examples:
This
statement
using
LIST (see
tokenized)
complete,
used
with
the
old
program
old
and
new
Format:
Examples:
This
statement
puter
displays
is
usually
information
String
are
The
which
then
If
liiii!Jml,
the
variables
not
allowed.
#aexp
the
input
several
same
type
line
ENTER filespec
ENTER
ENTER "D:DEMOPR.INS"
form,
it
may
the
programs.
INPUT [
100 INPUT X
100 INPUT N$
100 PRINT "ENTER THE VALUE
110 INPUT X
preceded
being
is
data
is
from
strings
the
"C
causes a
Section
and
is
be
run
disk
drive.
from
requests
a?
prompt
by
requested.
are
allowed
optional
is
to
be
the
are
to
next
separated
cassette
2,
LIST).
interpreted
in
the
Note
memory
This
ENTER
#aexp
{ ; } ] {
keyboard
when
a PRINT
only
and
is
input
(see
screen
be
input
string,
l;i§iii;lll , etc.
by commas.
tape
to
The
program
as
the
normal
that
both
before
statement
data
the
program
statement
if
they
used
to
Input/Output
editor
(E:).
from
play
back a program
data
is
way.
The
LOAD
loading
~~;~
specify
the
the
}
[,
Of
from
the
encounters
thCJ.t
prompts
are
not
the
Devices).
screen
Arithmetic
originally
is
entered
received.
ENTER
and
CLOAD (see Section 2)
new
is
usually
{
~~~~
X"
user.
subscripted.
file
editor,
in
When
command
one
. ENTER
used
} ... ]
In
execution,
an
INPUT
the
user
or
device
If
no
type
numbers
unprocessed
in
as
Matrix
#aexp
one
can
recorded
the
loading
may
merges
Direct
the
statement.
to
the
variables
number
is
specified,
string,
be
typed
(un-
also
clear
the
mode.
com-
type
from
press
is
be
It
of
on
10
PRWT 11Et-iTER 5 NUt"18EPS
20
FOR
t·~=
1
TO
5
30
I
t·~PUT
::-::
40
C=C+>::
50
NE>::T
t·~
60
70
PR r HT
um
II
THE :::ut
·1
oF
Figure
'/OUP
5-1
Input
TO
BE
SUt·1t·1ED
Nut·1E:ER::: If:
Program
11
II
; c
Listing
I/0
Commands
and Devices
25

LOAD
(LO.)
Format:
Example:
This
command
LOAD
uses
long
ized
version
to
specify a number
LOAD filespec
LOAD "D1:JANINE.BRY"
is
similar
inter-record
ofthe
to
program.
after
CLOAD
gaps
When
the
"D"
except
on
using
because
the
the
tape
only
the
full file
(see
CLOAD)
one
disk
default
name
drive,
is
disk
system
and
uses
it
is
drive
can
the
not
necessary
#1.
be
used.
token-
LPRINT (LP .)
NOTE
(NO.)
Format:
Example:
This
statement
on
the
screen.
device
The
entered
Format:
Example:
This
and
current
read
disk
second
specifier
above
command
the
or
written
file (see
file
LPRINT
LPRINT "PROGRAM TO CALCULATE
100 LPRINT X;" ";Y;"
program
by
the
NOTE
100 NOTE #1,
current
read
or
POINT).
which
[exp][
causes
the
It
can
be
and
no
user.
To
#aexp,
is
used
byte
number
write
is located.
The
is
then
{ : }
computer
used
in
either
OPEN
or
CLOSE
listing
illustrates a program
print a program
avar,
avar
X,
Y
to
store
the
within
position
in
This
NOTE
information
used
as
an
exp
... ]
";Z
to
print
Direct
current
the
the
specified
command
in
index
data
on
or
Deferred
statement.
listing
the
disk
sector
NOTE
into
on
sector
in
file
is
the
X"
the
line
modes.
(BASIC
that
will
the
line
number
the
second
where
used
when
command
first
file.
printer
uses
printer,
the
rather
It
requires
IOCB
add 5 numbers
see
in
the
avar.
This
next
byte
writing
is
written
#7.)
LIST.
first
data
than
avar
is
the
to
to
into
no
be
a
a
OPEN
(0.)
CLOSE (CL.)
26
J/0
Commands
and
Devices
Formats:
Examples:
Before a
a specific
trol
parameters
#
aexp
device
variables,
OPEN
#aexp,aexp1,aexp2,
CLOSE
100 OPEN #2,8,0,
100 A$ =
110 OPEN #2,8,0,A$
150 CLOSE #2
IOCB
for
Mandatory
user.
Reference
for
m ay
#aexp
can
be
to
the
appropriate
and
passes
the
OPEN
future
be 1 through
"D1:A
accessed,
IOCB
use
"D1:A
TARI800.BAS"
it
any
device-specific
command
character
or
file
(as
in
7.
filespec
T ARI800.BAS"
must
be
opened.
device
handler,
are
defined
that
must
number
CLOSE
command).
This "opening"
initializes
options
be
to
to
as follows:
entered
same
parameters
any
the
device
by
the
Number
process
CIO-related con-
handler.
links
The

aexp1
aexp2
Code
number
tion.
Code 4
Device-dependent
parameter
(see
appropriate
to
8
12
6
9
indicates
determine
input
operation
output
input
disk
(In
tion.)
end-of-file
also
This
line
operation
and
directory
this
case,
used
mode
from
lim!Jm.
auxiliary
sideways
manuals
input
or
output
output
for
E:
for
operation
input
operation
the
filespec is
append
allows a program
code.
(output) operation.
a special
without
printing
control
An
waiting
83
codes
opera
-
the
search
screen
on a printer
in
this
).
editor
to
for
the
input
input
user
specifica-
Append
mode
the
next
to
press
is
.
filespec
Device
Code
Device
Number
(optional)
Required
Colon
File
name
(up
to
8
charactersmust
begin
with
alphabetic
character)
Period
as
separator
extender
Extender-------------------~
(optional)Includes
0-3
characters
Specific file
tion
marks.
is
shown
"D
-----.:1•
__
____.Jl
-
-------'
--------------'
required
is
-------------..l
if
used.
designation.
The
format
in
Figure
5-2.
Must
for
the
be
enclosed
filespec
1 : A T A R I 8 0 0 . B A
......
V'
,
~
in
quota-
parameter
S"
Note:
Filenames
not
used
the
program
recorder.
are
with
The
CLOSE
an
OPEN
#charact
ment.
command
command.
er
must
be
Figure
simply
Note
in
the
sam
5-2
Filename
closes files
the
example
e as
the
Breakdown
that
have
that
the
aexp refere
been
aexp
nce
previously opened
following
number
IIO
Commands
in
the
the
mandator
OPEN
and Devices
with
state
27
y
-

POINT
(P.)
Format:
Example:
This
command
sector
number
the
next
pointer
to
the
data
in
more
byte
to
the
stored
detail
POINT
#aexp,
100 POINT
is
used
and
the
will
be
read
specified
on a disk
in
the
DOS
avar,
112,
when
second
or
location
file.
Manual.
avar
A,B
reading
avar
written.
in
The
a file
specifies
Essentially,
the
file.
POINT
into
This
and
RAM.
The
first
avar
the
byte
within
it
moves a software-controlled
gives
the
NOTE
that
user
"random"
commands
specifies
sector
are
discussed
the
where
access
PRINT
(PR
PUT(PU.)/
GET(GE.)
or?)
Format:
Examples:
A PRINT
mode,
quotation
screen
command
this
command
marks
will
display
RAM-resident
specifier
the
A
comma
several
mediately
second
of X will
semicolon
the
(may
value
of
causes
tab
jumps. A semicolon
after
example a space
not
is
next
PRINT
Format:
Examples:
PRINT [#aexp] {
PRINT X,
100 PRINT
Y,
Z,
"THE
:}
[exp] [,exp
A$
VALUE OF X
..
.]
IS
100 PRINT "COMMAS", " CAUSE",
100
PRINT
exactly
program.
be
A$
will
tabbing
the
be
used
will
PUT
GET
100
PUT
200 GET
can
prints
the
any
number
be
preceding
placed
at
the
start
#aexp,
#aexp,
116,
111,X
#3,
A$
be
used
whatever
as
it
appears.
current
In
the
values
last
between 1 and
printed.
to
the
next
causes
expression
is
placed
immediately
end
of
a PRINT
on
the
aexp
ASC("
A")
in
either
information
In
of
example,
(See
Input/Output
tab
location.
the
before
the
after
following
Direct
the
first
X,Y,Z,
next
with
ending
the
statement,
line.
";X
"COLUMN",
or
Deferred
is
contained
example,
and
A$
PRINT
as
PRINT #3,A$,
7)
that
controls
Devices.)
Several
aexp
no
commas
or
sexp
spacing.
quotation
word
"IS".
then
a
£lmD
"SPACING"
mode.
between
X,
Y ,Z,A$,
they
appear
the
#3
to
which
in a row
to
be
Therefore,
mark
so
If
no
is
output
In
Direct
in
is
the
device
cause
placed
in
the
value
comma
the
the
the
file
imthe
or
and
READ
DATA
28
I/0
Commands
(REA.)
(D.)
and
Devices
The
PUT
and
0-255
to
the
commands).
designate
variable
avar.
Formats:
Examples:
These
always
1
A
Direct
two
used
mode
GET
are
opposites.
file
the
specified
The
GET
file,
READ
DATA
etc.
command
on
var
[ ,
adata
by
#aexp.
diskette
var
... ]
[ ,
adata
100 READ A,B,C,D,E
110
DATA
12,13,14,15,16
100 READ A$,B$,C$,D$, E$
DATA
110
commands
in
Deferred
READ
EMBEE, EVELYN, CARLA, CORINNE, BARBARA
are
always
1
mode
•
will
only read
data
The
PUT
command,outputs a single
(II
is a
mandatory character
reads
one
or
elsewhere)
..
.]
used
together
The
DATA
if a DATA statement
statement
byte
and
and
from
then
was
0-255
the
can
executed
stores
DATA
be
located
in
(using
the
byte
statement
in the pro
byte
from
both
these
#aexp
in
the
anywhere
gram.
to
is

in
the
program,
the
READ
screen.
String
variables
subscripted.
a READ
The
statement.
more,
fined
The
statement.
DATA
the
in
the
following
10
FOR
2~1
F.~EAD
30
t·1=M+D
40
t·~E>::T
50
PF.~
I
60
END
70
DATA
but
must
statement.
used
(See
STRINGS
statement
It
cannot
data
type
in
corresponding
program
t·~=1
TO
D
t·~
NT
II
SUt1
30
..
15
..
contain
Otherwise,
in
READ
Section).
holds a number
include
the
totals
as
an
statements
arithmetical
DATA
READ
statement.
a list
5
TOTAL
106
EQUAL::;
..
17
..
87
many
"out
must
Neither
of
statement
of
numbers
II
;
t1
pieces
of
of
data"
be
dimensioned
may
array
string
data
operations,
must
match
in a DATA
data
as
error
variables
for
functions,
there
is
displayed
may
access
the
variable
statement:
are
and
by
etc.
defined
on
cannot
be
used
the
READ
Further-
type
in
the
be
in
de-
SAVE
(S.)
STATUS
XIO
(X.)
(ST.)
The
program,
Format:
Example:
The
SAVE
name
system
one
disk
record
Format:
Example:
The
The
stored
as
Format:
Example:
gaps
STATUS
status
in
the
RS-232
Figure
when
SAVE filespec
SAVE "D1:YVONNE.P
command
can
be
drive.
The
on
the
STATUS
350 STATUS #1,Z
command
of
the
STATUS
the
specified
interface.
XIO
cmdno,
XIO 18,#6,0,0,
5-3
executed,
is
similar
used.
default
cassette (see
#aexp,avar
calls
variable
Read/Data
will
print
SUM
TOTAL EQUALS 255.
AT"
to
the
CSA
The
device
is
to
the
command
(avar).
#aexp,
"S:"
code
disk
drive
CSA
VE)
and
STATUS
(see
This
aexp1, aexp2,
Program
the
statement:
VE
command
number
#1. SAVE,
the
tokenized
routine
ERROR
may
for
be
filespec
Listing
except
is
optional
like
LOAD, uses
form
the
specified
MESSAGES,
useful
for
future
that
the
when
of
the
device
Appendix
devices
full file
using
only
long
inter-
program.
(aexp).
B)
such
is
The
XIO
tions. One
command
example
is a
is its
general
use
to
input/output
fill
an
area
statement
on
the
screen
I/0
used
for
between
Commands
special
plotted
and
Devices
operapoints
29

and
fined
lines
with a color
as
follows:
(see Section 9).
The
parameters
for
this
command
are
de-
cmdno
cmdno
3
5
7
9
11
12
13
17
18
32
33
35
36
37
38
254
aexp
aexp1
aexp2
Number
be
OPERATION
OPEN
GET RECORD
GET CHARACTERS
PUT
PUT
CLOSE
STATUS REQUEST
DRAW
that
stands
performed.
RECORD
CHARACTERS
LINE
for
the
particular
EXAMPLE
Same
These 4 commands
BASIC
respectively.
Same
Same
Same
FILL See
RENAME XIO
DELETE
LOCK
FILE
UNLOCK FILE
POINT
NOTE
FORMAT
Device
it
Two
depends
most
is
ignored,
auxiliary
cases,
number
on
but
control
the
they
(same
must
particular
are
XIO 33,111,0,0, "D:TEMP .BAS"
XIO
XIO 36,111,0,0,"D:TEMP.BAS"
Same
Same
XIO 254,111,0,0,
as
in
OPEN). Most
be
preceded
bytes.
device
unusecl
command
as
BASIC OPEN
INPUT
as
GET, PRINT,
BASIC CLOSE
are
to
similar
as BASIC STATUS
as
BASIC DRA
Section
32,111,0,0, "D:TEMP.CAROL"
35,111,0,0, "D:TEMP.BAS"
9
as
BASIC
as
BASIC NOTE
by
Their
usage
and
command.
and
are
set
POINT
"D2
of
II
.
to
0.
the
WTO
:"
time
In
and
to
PUT
CHAINING
PROGRAMS
30
I/O
Commands and
Devi
filespec
If a program
string
1.
2.
3.
4.
5.
6.
7.
8.
9.
ces
programs
Type
in
The
last
number
Cue
the
tape
for
later
both
remain
Type
SA
When the
When
the
Repeat
As
the
the
second
possible
If
there
part
is a RUN"C:"
String
enclosed
mands,
filespec,
requires
ofless
the
first
line
of
and
the
to
the
RUN pur
down.
VE"C:"
beeping
screen
above
part
to
re-use
is a third
expression
in
quotation
like
Fill (Section 9),
it
must
more
memory
than
the
part
ofthe
the
first
part
command
blank
section.
poses. Press
and
press
sound
displays
instructions
ofthe
program
the
line numbers
part
of
the
command.
that
specifies
marks.
still
be
included
than
maximum
program
of
the.
RUN"C:"
Write
PLAY
IBil3.
occurs,
"READY",
press
for
the
is
program,
the
Although
do
not
is
available,
memory
in
the
program
down
and
RECORD
lj'I'J'i!lm
rio
not
second
device.
look
in
the
normal
the
move
part
Must
some
com-
at
the
statement.
use
the
available
way.
should contain
program
buttons
aga
in.
tape.
Type
ofthe
essentially a totally new
used
in
the
first
part
make
sure
the
last
be
following
into
one
only
counter
on
the
deck
NEW
program.
program,
of
the
program.
line
ofthe
steps
program.
the
line
number
so
that
m:i!Im
it
second
to
.
is

To
execute a "chained"
program,
use
the
following
steps:
MODIFYING A
BASIC PROGRAM
ON
DISK
1. Cue
2.
3.
4.
The
sounds a "beep"
tape
Note:
CSA VE
Note:
The
demonstrated
1.
2.
3.
4.
5.
6.
7.
8. To
9.
10.
11. To
the
tape
Press
PLAY
Type
RUN"C:"
When
the
computer
motor
for
A
one-part
and
CLOAD
Remember
procedure
Turn
off
ATARI
Connect
Wait
Insert
Turn
To
Modify
Always
To
Upon
type
followed
disk
for
Busy
diskette
on
console.
load
program
program
save
program
wait
get a Directory
lliilm,
it,
and
by
return
"beep"
in
to BASIC,
to
the
beginning
button
automatically
the
for
press
pressing
on
ll!I.I.!ImJ
sounds,
to
indicate
second
program
can
to
boot
modifying
the
following
console
drive
and
Light
to
(with
DOS
from
(or
type
on
for
the
listing,
the
DOS
liill!m
type
the
.
LOAD/RUN.
be
DOS
go
DOS)
should
disk,
Busy
lliilm
recorder.
press
loads
when
can
be
used.
before
an
steps:
and
insert
turn
out
and
disk,
LOAD
in
new
type
SAVE
light
do
Menu
twice
then
B liill!m
of
part 1 of
ll!I.I.!ImJ
the
first
to
hit
the
The
recorded
typing
existing
it
and
boot
type
not
will
BASIC
BASIC
on
-without
for
the
close
door.
in
and
"D:filename.ext
program).
"D:filename.ext
to
go
out
remove
DOS
be
displayed.
to
list
the
P:
liill!m to list
or
press
the
program.
again.
part
of
the
space
bar
loading
and
in
cartridge.
drive
before
directory
reloaded
your
program
inserting
to
the
screen
diskette
takes a few
program.
stop.
removing
Select
Utiii!&l;li@:U
program,
or
Em
in
stored
diskette.
Open
show
and
type
command
on
the
screen;
directory
.
runs
to
trigger
seconds.
the
same
on a diskette
disk
drive
READY.
diskette.
letter
or
on
the
it,
and
the
way
or
door.
A,
type
printer.
is
A
IIO
Commands
and
Devices
31

NOTES
32
Notes

This
section
tions
incorporated
and
returns
computational
radians
functions.
or
The
(RAD)
Each
Deferred
following
describes
into
the
result
use.
Included
and
degrees
function
mode.
Multiple
functions
the
arithmetic,
the
ATARI BASIC. A
(usually a number)
in
the
(DEG),
described
functions
and
statements
trigonometric,
trigonometric
that
are
in
this
are
function
for
either a print-out
functions
frequently
section
perfectly
are
described
FUNCTION
LIBRARY
and
special
performs a computation
used
may
be
used
legal.
in
this
are
with
section:
two
in
purpose
or
trigonometri
either
func
additional
statements,
Direct
6
-
c
ARITHMETIC
FUNCTIONS
ABS
CLOG
EXP
ABS
CLOG
EXP
INT
LOG
RND
SGN
SQR
Format:
Example:
Returns
or
negative.
Format:
Example:
Returns
theses.
Format:
Example:
CLOG(O)
ABS(aexp)
100 AB = ABS (-190)
the
absolute
The
CLOG (aexp)
100 C = CLOG(83)
the
logarithm
EXP
100 PRINT EXP(3)
value
returned
should
(aexp)
to
give
ATN
cos
SIN
DEG/RAD
of a number
value
is
always
the
base
10
an
error
without
of
the
and
CLOG(1)
regard
positive.
variable
ADR
FRE
PEEK
POKE
USR
to
or
should
whether
expression
be
0.
it
is
positive
in
paren-
INT
Returns
by
returned
digits.
Format:
Examples:
the
the
expression
value
ofe
(approximately
in
parentheses.
is 20.0855365.
INT (aexp)
100 I = INT(3.445)
100 X
=
INT(-
In
some
14.66778)
2.71828283),
In
the
cases
, EXP is
example
accurate
(3
(-15
raised
given
would
would
to
the
power
above, the
only
to six
be stored
be
stored
Function Li
specified
number
signifi
in
I)
in
X)
brary
cant
33

Returns
This
is
Thus,
in
example,
than
or
function
the
true
our
X is
equal
used
greatest
whether
first
example
used
to
-14.66778).
on
calculators
integer
the
to
store
less
than
expression
above, I is
the
number-
This
INT
that
simply
or
equal
evaluates
used
to
15
function
truncates
to a
store
(the
to
the
positive
the
first
should
(cuts
value
number
whole
not
off)
of
or
negative
number
be
confused
all
the
expression.
3.
In
the
that
decimal
number.
second
is
less
with
the
places.
LOG
RND
SGN
Format:
Example:
Returns
LOG(O)
Format:
Example:
Returns a hardware-generated
returns
and
has
be
used.
statements
like.
Here's a simple
1 0
20
33
Format:
Example:
Returns a -1
1
if
aexp
LOG(aexp)
100 L = LOG(67.89/2.57)
the
natural
should
:~~=~~NO(
F.::x:=IHT<
PRINT
give
an
RND(aexp)
10
A=RND
1.
The
variable
no
effect
on
Generally,
or
the
functions
0)
1000:~~:;()
R?i
SGN(aexp)
100 X = SGN(-199}
ifaexp
evaluates
evaluates
to a
the
routine
logarithm
error
(0)
or
expression
numbers
RND
to
return a number
that
positive
of
the
number
and
LOG(1)
random
in
parentheses
returned.
function
to a negative
is
used
returns a random
number.
should
number
However,
in
for
numbe
or
expression
be
0.
between 0 and
following
the
dummy
combination
games,
number
r;
a 0
decision
(0
is
(-1
would
ifa
exp
in
parentheses.
1,
but
RND is a
variable
with
other
making,
between 0 and
dummy
variabl
be returned)
evaluates
never
dummy
must
BASIC
and
the
999.
e)
to 0,
or
a
s~
TRIGONOMETRIC
FUNCTIONS
ATN
cos
34
Funct
ion
Library
Format:
Example:
Returns
Format:
Example:
Returns
Format:
Example:
Note:
Presumes
Returns
SQR(aexp)
100 PRINT SQR(100) (10
the
square
ATN(aexp)
100 X = ATN(65)
the
arctangent
COS(aexp)
100 C = COS(X+Y+Z)
the
trigonometric
root
of
of
the
X,
Y, Z previously
cosine
the
variable
aexp
of
which
or
defined
the
expre
must
expression
!
be
ssion
would
positive.
in
parentheses
in
parentheses.
be printed)
.

SIN
Format:
Example:
Note:
SIN(aexp)
100 X = SIN(Y)
Presumes Y previously
defined.
DEGIRAD
SPECIAL
PURPOSE
FUNCTIONS
ADR
Returns
Format:
Example:
These
trigonometric
DEG is specified.
to
See
Format:
Example:
Returns
parentheses.
tion
the
trigonometric
DEG
RAD
100 DEG
100
two
statements
function
return
to
radians.
Appendix E for
ADR(svar)
ADR(A$)
the
decimal
Knowing
to
USR
routines,
RAD
Once
the
memory
etc. (See
sine
of
allow
the
programmer
computations.
the
DEG
statement
additional
address
the
address
USR
the
expression
The
computer
has
been
trigonometric
ofthe
string
enables
and
the
Appendix
in
parentheses.
to
specify
defaults
executed,
functions
specified
programmer
D)
degrees
to
RAD
that
b y
the
to
pass the
or
radians
radians
must
can
be
derived.
expression
informa-
unles
be
for
s
used
in
FRE
PEEK
POKE
Format:
Examples:
This
function
Direct
memory
used
within
Format:
Examples:
Returns
specified
teger
between 0 and
tion
(not
a
ran
ge from
ROM locat
whether location
ple,
the
Format:
Examples:
FRE(aexp)
PRINT FRE (0)
100 IF
returns the
mode
with a dummy
space
remains
a BASIC
PEEK(aexp)
1000 IF PEEK (4000) =
100 PRINT
the
contents
must
be
hexadecimal). The
0 to
ion
s.
PEEK
function
POKE
POKE 82, 10
100 POKE 82,
FRE
for
program
of a specified
an
integer
65535
255.
This
In
the
4000
(decimal)
is u
aexp1,
(0)<1000
number
variable
completion
in
"LEFT
or
and
number
function
first
examp
sed
to
aexp2
20
THEN PRINT "MEMORY CRITICAL"
ofbytes
Deferred
MARGIN IS"; PEEK (82)
memory
an
arithmetic
represe
contains
examine
of user
(0)
to
inform
of a program.
mode.
255
THEN
address
nts
the
returned
allows
le
the
above, the
the
the
RAM
left.
the
programmer
Of
course
PRINT
expression that
memory
will
number
left
location
also
be a decimal
user
to
PEEK is us
margin.
"255"
address in
examine
255.
Its
primary
(aexp).
evaluates to
ed
In
the
Function Li
FRE
The
decimal
integer
either
to
second
use
is
how
much
can
also
address
an in-
nota-
with
RAM
determine
exam
brary
in
be
or
-
35

Although
associated
memory
aexp1
be
poked.
cannot
it
is
contents
original
The
position
spaces
ti"ti•341;1J1jj
this
with
location
is
the
Note
be
used
advisable
of
contents
above
Direct
of
2 to a
to
the
0
decimal
the
right.
is
not a function,
the
PEEK
or
modifies
address
that
this
number
to
alter
ROM
to
look
at
the
location.
can
be
poked
mode
example
new
position
To
restore
it
function.
data
of
the
locations.
memory
Then,
into
of
the
is
included
This
POKE
already
location
is a decimal
In
gaining
location
if
the
POKE
the
location.
changes
10.
In
the
other
margin
in
this
command
stored
to
be
there. In
poked
number
familiarity
with a PEEK
doesn't
left
screen
words,
to
its
normal
section
because
inserts
the
and
aexp2
between 0 and
with
and
write
work
as
anticipated,
margin
the
new
margin
default
it
data
above
is
the
255. POKE
this
command
down
from
its
position,
is closely
into
the
format,
data
to
the
the
default
will
be
press
8
USR
Format:
Example:
This
function
pression,
integer
routine
These
that
to
should
65535. A
nearest
These
integer.
values
floating
the
hardware
direct
control
ture
of
the
USR
100 RESULT =
returns
aexp1,
must
represents
be
performed.
be
non-integer
will
point
number
stack,
of
hardware
(aexp1
[,
the
be
an
the
arithmetic
value
be
converted
format
composed
the
6502
stack.
(Number
(High
(Low
(High
(Low
(High
(Low
(Low
(High
aexp2][,
results
integer
decimal
The
aexp3
USR
(ADD1,A *2)
of a machine-language
or
arithmetic
memory
input
arguments
expressions
may
be
used;
from
to a two-byte
of a group
microprocessor
of
arguments
byte
of
argument
byte
of
argument
byte
of
argument
byte
of
argument
byte
of
argument
byte
of
argument
byte
of
return
byte
of
return
..
.])
subroutine.
expression
address
aexp2,
of
aexp3,
within a decimal
however,
BASIC's
binary
of
chip.
on
Binary
number,
RAM
Figure
the
it
memory
6-1
stack-may
X)
X)
Y)
Y)
Z)
Z)
address)
address)
that
the
machine
range
will
be
Coded
illustrates
The
evaluates
etc.,
are
of 0 through
rounded
Decimal
then
pushed
locations
be
0)
first
to
language
optional.
to
the
(BCD)
onto
under
the
struc-
ex-
an
36
Function
Library
Note:
second,
See Section 11
gramming.
language
programming.
Figure
X is
Z is
for a description
the
argument
the
6-1.
third,
Hardware
etc.
of
Appendix D defines
following
There
the
USR
the
bytes
Stack
Definition
the
address
are N pairs
function
in
RAM available for
of
of
bytes.
in
machine
the
routine, Y is
language
the
pro-
machine

This
section
Each
string
variable
together.
(including
string
and
perly
dimensioned
from 1 to
sioned
length
The
string
ASC
CHR$
LEN
describes
must
must
The
the
any
the
functions
be
dimensioned
end
with
individual
Atari
special
substring
(see
current
of
the
string.
strings
a $. A
characters
keyboard
is
accessible
end
of
string
described
and
the
(see
string
section).
length,
in
this
functions associated
DIM
statement,
itself
is a group
may
be
symbols.) A substring
in
Atari
BASIC
The
characters
which
section
STR$
VAL
is
less
are:
Section
of
letters, numbers,
if
the
in a string
than
7
STRINGS
with
string
handling.
8)
and
each
string
characters "strung"
or
symbols
or
is a part
string
equal
of a longer
has
been
are
to
the
pro-
indexed
dimen-
ASC
CHR$
Format:
Examples:
This
function
string
expression
mode. figure
10
DH1
20
A:f.=11P
30
A=ASC(
40
PF.:H-H
When
executed,
ter
"E".
Note
marks.
Format:
Examples:
This
character
represented
is
returned.
CHR$
functions,
ters
of
the
ASC(sexp)
100A
returns
(sexp).
7-1
is a short
A$0::
3)
A$)
A
this
that
when
CHR$ (a
100
PRINT
100
A$
string
by
the
In
the
the
alphabet.
= ASC(A$)
the
AT
This
Figure
program
the
exp)
CHR$ (65)
= CHR$ (65)
function
A TASCII
above
examples,
following
ASCII
function
program
7-1.
ASC
prints
string
code
number(s)
program
code
can
illustrating
Function
a 69
itself
is
returns
the
letter
prints
number
be
used
which
u s
ed,
the
in
A is
the
for
the
first
in
either
the
ASC
function.
Program
is
the
AT
ASCII
it
must
be
enclosed
character,
parentheses.
returned.
upper case
character
Direct
code
in
string
Only
one character
Using
the
and
lower
or
Deferred
for
in
quotation
format,
ASC
case
of
the
the
let-
and
let-
Str-ings
37

10
~'0
I)
30
FOR
I=0
PR I HT
t·~E>=:T
TO
CHfU(
I
25
ASC(
..
A
11
)+I ) )
CHF.:$(
A:
:;C(
"a"
)+
LEN
STR$
Note:
There
Format:
Example:
This
function
tion
may
variable
the
string. Strings
It
is
possible
However,
was
stored
The
following
10
Dir-1
2~3
A:i=u
3(
1
F'~~ I f
The
result
Format:
Example:
Figure
can
be
only
LEN (sexp)
100 PRINT LEN(A$)
returns
then
is
simply
to
the
beginning
(using
routine
A!(
AT
-~T
ofrunning
STR$ (aexp)
A$=
the
be
printed
the
have a length
store
STO)
10
>
A~~
In
LEt·i<
A$
Figure
STR$(65)
7-2.
ASC
one
STR$
length
or
used
index
for
into
the
of
the
there
previously.
illustrates
>
7-3.
LEN
the
above
and
CHR$
and
in
bytes
later
the
character
ofO
until
middle
string
one
use
Function
program
Program
only
one
CHR$
of
the
designated
in a program.
which
characters
of
the
string
will
contain
of
the
LEN
Example
would
be
Example
in
a logical
string. This
The
is
currently
have
been
by
using
garbage
function:
5.
comparison.
length
at
stored
subscripting.
unless
informa-
of a string
the
end
of
in
them.
something
VAL
38
Strings
This
string
parentheses. The
would
Note:
F
or
exa
Format:
Example:
This
string.
can
perform
ple
program:
10
20
30
40
from
b e
recognized
There
mple, A=
function
This
is
DH1
B:f.:
II
E:=SG!~\
PRHH
can
VAL(sexp)
100 A = V AL(A$)
returns a number
the
arithmetic operations
8$(5 )
10(10(11!
jB
Figure
number
above
only
STR$(1) > STR$(2) is
opposite
I..JAL(
11
THE
function
example
by
the
be
one
of
B$) )
SQUAPE
7-4.
VAL
computer
STR$
of
a STR$
POOT
Function
returns
would
as a
and
only
not
the
function.
on
strings
OF
the
return
str
one
valid
same
II ,
;8$
Program
string
the
actual
ing
.
CHR$
and
will
value
as
Usi
ng
this
as show n
.;
II IS
form
of
the
number
in
a logical
not
wor
the
number
function, the
in the
following exam-
II
number
65,
but
comparison.
k cor:rectly.
stored
as
computer
in
it
a

Upon
execution,
It
is
not
number,
however,
number
the
possible
or
1,000,000,000.
to
that
intrepret
use
cannot
screen
the
be
floating
displays
VAL
function
interpreted
point
THE SQUARE ROOT OF
with a string
by
numbers;
the
e.g.,VAL("1E9")would
that
computer
B$
IS
100.
does
not
start
as a number.
return
with
It
can,
a
the
STRING
MANIPULATIONS
Strings
rearranged,
manipulations.
String
Concatenation
string.
substring
tain
can
program.
In
String
can
Concatenation
Each
up
to 99
be
stored
this
program,
10
D I
t1
:::.'0
A$=
[I
II
30
E:$=
GUIDE
4~3
C$=~~---CHAPTE~:
50
A$(
6£1
A$(
70
F'k:HH
Splitting
be
must
Figure
A$(
II
sr~:
11
IN
Ill
LEt-K
LHK
manipulated
and
sorted.
means
string
characters
in
A$
A$
putting
to
be
dimensioned
another
7-5 is a
A$,
B$,
1m;
) ,
8$(
I
~-lGS
::.:
'AT
A~:
I
H 1
)=B$
)+
1
>=C$
A$
Figure
in a variety
The
be
included
(including
string
sample
and
100 ) ..
suB:;rp
BA:::IC--A
9.
II
7·5.
String
following
two
or
in a larger
(see
DIM).
spaces).
variable,
program
C$
are
concatenated
C$(
1 (u) )
I
~-iGS
SELF-
Concatenation
of
ways.
paragraphs
more
strings
In
Atari
After
printed,
demonstrating
ARE
o I
TEACHmG
They
can
together
string
is
called a substring. Each
BASIC, a
concatenation,
or
used
and
placed
~:cu:;sE
Example
be
split,
describe
to
substring
in
later
string
in
concatenated,
the
different
form
one
large
can
con-
the
substrings
sections
concatenation.
A$.
of
the
The
format
The
svarname
$).
aexp1
dicates
of
the
greater
Figure
string
10
DH1
20
S$="A8CD#"
3e
PRWT
40
END
Result is
(without
of a subscript
indicates
the
ending
substring
than
the
7-6
illustrate
with
an
~:$(
S$(
BCD.
ending
is
used
the
location
is
the
current
ending
5)
2)
location)
string
svarname(aexp1[
to
indicate
starting
of
current
length
a split
Figure
string
location
7·6.
variable
the
location
the
substring.
end
of
of
indicated.
Split
is
as
,aexp2])
unsubscripted
oft
he
If
no
the
string.
the
string. The
with
no
end
10
D m
20
S$=11ATAPI
30
PR
40
END
Result
(with ending
String
follows:
string
substring
aexp2
The
starting
two
location
:::$.::
2~::1
I t·H
S$( 7 ..
is 800.
loc
Examples
variable
and
is
specified,
example
indicated
>
80(1
9 >
ation
name
aexp2
(if
then
location
programs
E:A:::IC
)
(with
used)
in-
the
end
cannot
and a split
11
Strings
be
in
39

String
In
string
with
numbers.
ble
sort.
In
using
assigned
1.
AT
values
2.
Upper
ters.
upper
Comparisons
comparisons,
The
second
logical
an
ATASCII
ASCII
and
case
To
operators,
codes
are
letters
obtain
case value,
and
Sorts
the
logical
program
remember
code
number. A few
for
numbers
always
lower
have
the
AT
ASCII code
add
32
operators
lower
to
the
in
Appendix
that
are
sized
than
the
numerical
for a lower
upper
are
used
His a simple
each
letter,
general
in
codes
values
case code.
exactly
rules
order
for
case
number,
apply
of
the
letters
than
letter
the
way
example
and symbol
to
these
numbers'
(see
Appendix
the
lower
if
you
they
are
of
bub-
is
codes:
real
C).
case let-
know the
Note:
memory
vary
if a program
Atari
to
BASIC's
make
memory
room
is
modified
for
new
management
statements.
or
Direct
mode
system
This
causes
is
used.
moves
the
strings
string
around
address
in
to
40
Strings

8
An
array
is a one-dimensional
e.g.,
A(O),
A(1), A(2).
8-1
illustrates a 7-element
A
matrix,
umns.
stored
first
Figure
Rows
by
row
in
BASIC
are
8-2
illustrates
this
run
stored
Subscripts
arra
Figure
context,
horizontally
in
is a two-dimensional
row-ma
first,
followed
a 7 x 4
list
range
y.
8-1.
and
jor
order.
matrix.
of
numb
from 0 to
A(O)
A(1)
A(2)
A(3)
A(4)
A(S)
A(6)
Example
columns
This
by
all
ARRAYS
MATRICES
ers
assigned
of
an
run verticall
means
the
elements
to
subscripted variables
the
dimensioned
Array
table containing
y .
Matrix
that all
the elem
of
the
AND
value.
rows
elements
ents
second
Figure
and
of
row,
col-
are
the
etc
;
.
DIM
(DI.)
This
section
strings, and
tion
are:
DIM
CLR
Format:
Examples:
M(O,O)
M(1,0)
M(2,
M(3,
M(4,0) M(4,1) M(4,2) M(4,3)
M(5,
M(6,0) M(6,1) M(6,2)
describes
how
to
load
D M {
svar(aexp)
1
mvar(aexp[
DIM A(100)
DIM M(6,3)
DIM B$(20)
0)
0)
0)
Figure
the
two
both
Columns
M(0,1) M(0,2)
associated
and
}
IJ{
,svar(aexp)
~
,mvar(aexp[
M(1 ,2)
M(2,2)
M(3,2)
of a Matrix
matrices.
STRINGS
M(1
,1)
M(2,1)
M(3,1)
M(5,1) M(5,2) M(5,3)
8-2.
Example
commands
arrays
,aexp])
used with
M(0,3)
M(1,3)
M(2,3)
M(3,3)
M(6,3)
with
The
,aexp
arrays,
com~a
... ] U
matrices,
nds
in
}tl
and
this sec-
Ana,v
s
and
Matr·ices
41

A DIM
statement
a
string,
a
number
for
for a two-dimensional
20
sioned.
gram.
there
Figure
Note:
matrix
matrix
an
array
bytes
Notice
are
The
250
300
310
32f1
array,
in
designated
It
actually 7 elements
8-2
variables
elements
orr·1
FOR
A(3
t·E·<T
is
used
or
matrix. A character
an
array
designated
is a
good
in
Figure
is
dimensioned
ATARI
A(
to 0 at
to
100
Personal
E==0
>=0
E
takes
array
B$.
habit
0,
use
>
TO
to
reserve a certain
six
bytes.
A .
The
second
(matrix)
All
strings,
to
put
all DIM
8-1
that
although
in
the
as
DIM M(6,3), 28
Computer
the
start
of
the
following
ll1l1
number
in a string
The
first
example
designated
arrays,
statements
the
array
array
because
locations
does
not
program
program
oflocations
takes
one
example
reserves 7 rows
M.
and
automatically
execution.
steps:
reserves
The
third
matrices
at
the
beginning
is
dimensioned
of
the 0 element.
are
To
in
byte
in
by 4 columns
example
must
reserved.
initialize
initialize
memory
memory
101 locations
be
of
as DIM A(6),
for
and
reserves
dimenthe
pro-
Although
array
or
array
or
Arrays
READIDA T A
"building"
array
10
2f1
3(1
40
50
and
using
DH1
::·::=
FO~:
::-::=:~
A(E
1
of
(1
=:+
60 t·4E>::T
70
FOP
B(l
PF.:H-JT
90
t·~E::-=:T
10
DH1
20
FOR
30
F.:EAD
40
A(E>=>=:
50
PRHiT
60
t·~E::-=:T
70
am
10(1
DATA
matrices
statements
part
of
the
READ/DATA
A<
we>
E=1
TO
1
)=>=:
E
E=1
TO
E..
A(
E
Figure
A(3)
E=l
TO
>=:
A<E
E
33
.. 45.,
an
E >
).,
are
array
9(1
90
8-3.
3
12
"filled"
and
INPUT
using
statements.
Use
of
with
data
commands.
the
FOR/NEXT
FOR/NEXT
by
to
using
Figure
loop
Build
FOR/NEXT
8-3
and
Figure
An
Array
statements,
illustrates
8-4
builds
the
an
42
Arrays and
Matrices
Figure
8-4.
Use
of
R.EAD/DATA
to
Build
An
Array

Figure
10
20
30
40 tl:
50
60
70
:30
90
8-5
shows
Dit·1
FOP
FOF.~
RC!l·J
t·~E~=:T
FO~:
FOF.:
F'P I rH
t·~E:=<T
an
example
t-1( 6 ..
3 >
Pm·l=0
COL=l
F.:Ol·J=O
COL=l
..
COL
COL
t-1<
F.:Ol·J
=
TO
TO
)=I
t·~E>=:T
TO
TO
COL : F'P
6
3
tH
(
ROH
6
3
·'
COL
I r·H =
~:t-~D
>
t·~E>=:T
of
building
·:: 0 /~::
F.:O~·l
1
00(1
a 6 x 3
)
matrix.
CLR
Note
that
the
words
functions,
which
with X and Y as
Format:
Example:
This
and
It
also
array
command.
or
loop
command
matrices
clears
is
needed
keyword
function
CLR
200
so
the
Figure
ROW
s.
is first.
the
variable
CLR
clears
the
the
memory
values
stored
after a CLR
and
They
The
names.
memory
and
in
command,
8-5.
Building A Matrix
COLUMN
are
simply
program
of
variable
undimensioned
are
variable
could
all
previously
names
it
must
not
BASIC
names
just
can
var
be
dimensioned
commands,
used
here
as easily have
be
used
for
other
iable
s.
If a matrix,
redimensioned
statement
to
designate
been
strings,
purposes.
string,
with
s,
written
arrays,
or
a DIM
Ar.,.ays
and
Matr·
ice
s
43

NOTES
44
Notes

9
GRAPHICS MODES
GRAPHICS (GR.)
This
section
modes
create
The
commands
GRAPHICS
COLOR
DRAWTO
The
PUT/GET
tions
of
Format:
Example:
This
command
marizes
mand
w
hen
code.
The
0 is a full
override
the
GRAPHICS
clearing
To
return
and press l;!jiii;Ui
describes
ofthe
ATARI
graphics
and
the
same
GRAPHICS
GRAPHICS 2
is
the
nine
automatically
printing
text
aexp must
-screen display
the split-screen,
the
scre
to
graphics
the
Personal
for
game,
to
be
described
XIO
commands
commands
used
to
modes and
opens
in
the
be
positive,
command.
en .
mode 0 in
AND
Atari
BASIC
Computer.
graphics, and
in
LOCATE
PLOT
POSITION
described
aexp
select
one
the
the
screen
text window,
rounded
while
modes 1 through 8 are split
add
the
Adding
commands
Using
patterns
this
section
explained
in
Section 5.
of
the
nine
characteristics
, S:(the
it
is
to
the
characters
32
prevents
Dir
ect
mode,
COMMANDS
and
the
the
se
commands,
.
are:
PUT/GET
SETCOLOR
XIO
in
this section
graphics
of
graphics windo
not
nece
nearest
+ 16
to
the
pre
modes.
each. The
ssary
integer. Graphics
the
mode
graphics
ss hiii@l;li@ii
different
are
GRAPHICS
w),
as
to
specify
screen
numb
comma
graphics
it
is
possible
special
Table
applica-
9-1
device
the
displays. To
er (aexp)
nd
or
type
to
sumcom-
116.
So
device
mode
in
from
GR.O
TABLE
Gr.
Mode
0
1
2
3 GRAPHICS
4 GRAPHICS
5 GRAPHICS
6 GRAPHICS
7 GRAPHICS
8
The
following
9.1-TABLE
Mode
Type
TEXT
TEXT
TEXT
GRAPHICS 320
paragraphs
OF
SCREEN
Horiz.
(Rows)
40
20
20
40
80
80
160
160 80
describe
MODES
FORMAT
Vert.
(Col)
Split
Screen
20
10
20
40
40
80
160
the
nine
AND
Vert.
(Col)
Full
Screen
graphics
Graph
SCREEN
Number
24
24
12
24
48
48
96
96
192
modes
ic Modes
FORMATS
Of
Colors
.
and Cmnmand.
Required
2
5 513
5 261
4 273
2 537
4 1017
2
4
1/2
RAM
(Bytes)
993
2025
3945
7900
s
45

GRAPHICS
MODEO
This
mode
Personal
margin
ed
by
poking
have
different
by
the
This
full-screen
border
tion,
use
Method
lineno
lineno
Method
lineno
lineno
lineno
lineno
lineno
is
the
1-color,
Computer.
settings
background
is
1.
2
at 2 and
LMARGN
margin
display
specified
one
of
the
POSITION aexp1,
PRINT
GR.
0
POKE 752,1
COLOR ASC(sexp)
PLOT
GOTO
2-luminance
It
contains a 24
39
allow
and
RMARGN (82
default
color.
Only
has a blue
to
be
another
following
sexp
aexp1,aexp2
lineno
(brightness)
by
40
38
characters
settings. The
the
luminance
display
color).
two
aexp2
To
methods
default
character
and
83). See
color
area
display characters
.
per
ofthe
ofthe
bordered
screen
line.
Margins
Appendix
characters
characters
Puts cursor
sp
ecified
Specifies
Suppresses
Specifies character
printed.
Specifies where
character.
Start
loop to prevent
from
being
same
linerw.J
Press
lll1D:I
loop.
mode
for
matrix. The
may
I.
~orne
IS
can
be
in
black
at a specified
at
location
by
aexp1
and
gr
a phics
cur
mode
sor.
to
to
print
printed. (GOTO
to
terminat
the
AT
ARI
default
be
chang-
syst_ems
determmed
different.
(unless
the
loca-
aexp2.
.
be
READY
e
GRAPHICS
MODES
1AND2
GRAPHICS 0 is also
Deferred
returns
As
are
mod
height.
of
those
to
display
print
mand.
Example:
The
default
Character
Upper
Lower
Inverse
Inverse
Numbers
Inverse
mode.
the
screen
defined
in
Table
both
split-screen
e 1 a
re
twice
Characters
in
Graphics
characters
characters
default colors depend
color
Table
case
case
upper
lower
numbers
in
100
110 PRINT#6;"
and
9-2.
Type
alphabetical
alphabetical
case
case
used
as a clear
It
terminates
to
the
default
9-1,
these
(see
the
width
printed
mode
in
either
the
graphics
GR.
1
color
register
Default
alphabetical
alphabetical
two
Figure
of
in
Graphics
0.
In
the
ATARI"
on
the type
Colors
screen
any
previously
mode
(GRAPHICS 0).
5-color
those printed
the
window,
used
modes
9-1)
modes.
mode 2 are
split-screen
text
window
specify
of
character
for
each
for
Color
command
selected
are
Characters
in
Graphics
mode,
or
device
type.
Specific
Register
0
1
2
3
0
2
either
in
graphics
Text
modes.
printed
0,
twice
the
a PRINT
the
graphics window
#6
after
input.
Table
Input
Direct
However,
in
but
are
width
and
command
the
PRINT
9-2
defines
Types
Default
Orange
Light
Dark
Red
Or
ange
Dark
mode
mode
they
Graphics
the same
height
is us
com-
Color
Green
Blue
Blue
or
and
ed
. To
the
46
Graphic Modes
and
Commands
Note:
See SETCOLOR
to
change
character
colors.

Unless
inverse
756,226.
In
graphics
the
rest
(X=Ol
(Y=O)
Figure
otherwise
form.
To
To
return
modes 1 and
of
the
characters
9-1.
specified, all
print
lower
to
upper
2,
in
Split-Screen
case
case,
there
four
Display
characters
letters
use
POKE
is
no
inverse
different
For
are
and
graphics
756,224.
video,
colors
Graphics
displayed
characters,
but
(see
end
Modes 1 and
in
it is
of
upper
use
possible
section).
case
a
POKE
to
get
S:
Graphics
(graphics
E:
Text
Window
(4
lines)
border
depends
individual
TV's
overscan)
2
non-
Window
or
(size
on
all
tt>xt)
GRAPHICS
MODES
3,
5,
AND
GRAPHICS
MODES
4AND6
GRAPHICS
MODE8
7
The X and Y coordinates
are
the
numbers
This
split-screen
the
characters
Example:
These
three
state,
but
may
Modes 3, 5,
plotting,
drawing,
giving a much
These
two
only
two
colors
of a two-color
it
is
used
when
two
modes
Graphics
This
takes
mode
graphics
a lot
maximum
of
rows
configuration
+ 16
to
the
GRAPHICS 1 + 16
4-color
and 7 are
be
changed
graphics
alike
and
higher
2-color
while
mode
only
also
resolution.
graphics
the
is
that
two
have a higher
3.
mode
gives
of
RAM
to
obtain
of
one
color
start
at 0 (upper
and
columns
can
mode
number.
modes
to
full
except
positioning
modes
other
modes
it
requires
colors
are
resolution
the
highest
this
and
two
different
left
minus
be
changed
are
also
split-screen
screen
that
by
adding
modes 5 and 7 use
the
cursor;
are
split-screen
can
display 4 and
less RAM
needed
and
which
resolution
kind
of
resolution,
luminances.
of
screen).
1 (see
to a full
the
points
displays
space
RAM is
means
of
Table
screen
displays
+ 16
5 colors.
(see
getting
all
the
it
can
The
9-1).
to
the
more
are
and
Table
smaller
other
only
maximum
display
in
by
their
mode
points
smaller,
can
display
The
advantage
9-1).
Therefore,
crowded.
points
modes.
accomodate
values
adding
default
number.
(pixels)
thereby
These
than
As
in
in
it
a
Graphic Modes
and
Commands
47

COLOR (C.)
Format:
Examples:
The
value
of
stored
mands
and
nearest
ways
can
ly
is
usually
in
be
from 0 through
and
its
64
different
in
the
until
integer.
the
color. (The
256-character
COLOR
aexp
110 COLOR ASC("A")
110 COLOR 3
the
expression
display
the
next
an
integer
The
different
graphics
in
the
memory
COLOR
statement
from 0 through
display
graphics
modes. In
255 (8 bits)
two
most
significant
characters
are
set.)
COLOR
for
all
subsequent
hardware
and
determines
bits
available
statement
is
executed. The
255.
Non-integers
interprets
text
modes 0 through
determine
in
these
determines
PLOT
the
character
the
modes
the
and
DRA
value
must
are
rounded
this
data
2,
to
color. This
instead
data
WTO
be
positive
in
different
the
number
be
displayed
is
why
of
the
to
com-
to
be
the
on-
full
DRA
WTO
(DR.)
Tables
and
modes
expression
one
value
pa
Table
numbers.
Note
9-6
the
character/color
generation
easy
5,5
will
display
Graphics
RAM
modes 3 through 8 are
simply
require
or
two
in
the
rticular
9-5,
that
GRAPHICS
Therefore,
and
determines
in
the
bits
color
graphi
which
Colors
when
command
nothing
through 7 when
first
COLOR 1
Fonnat:
Example:
This state
PLOT)
(see
represents
ur
e 9-1 ). T h e color
Fig
.
DRA
100 DRA
ment caus
to
the X coordinate
PLOT.
9-7
at
the
end
assignment.
of
some
of
the
an
orange A character
the
either 0 or
COLOR
will
register
cs
may
BASIC is
1 (1-bit)
statement may
be
used.)
mode
gives
the
be
changed
which
b e
first
(without
seems
no
WTO
to
COLOR statem e
aexp1, aexp2
WTO
es a line to
the
location
specified
of the
ofthis
color
Table
colors.
not
text
of
and
section
9-2
For
example,
in
graphics
modes,
each
four-color
have a value
The
actual
color
corresponds
ing used .
default
happen
This· may be
colors
by
using
powered
+ 32) is
to PLOT
nt
up,
executed
has bee
10, 8
be draw
and
lin
e is the sam e color
n fr
om the last p o
b y
aexp1
the second
illustrate
the
is a simplified
COLOR
modes 1 or 2 at
so
the
pixel.
Two-color
modes
which
is
displayed
to
the
data
de t e
and
the
SETCOLOR.
the
color
, all
of
and
DRA
n execut
and
aexp2.
represents the
as th e point dis
internal
table
ASC("
data
stored
or
two-luminance
require
greater
0, 1, 2 ,
than
depends
of
0, 1,
rmin
ed
by
corresponding
data
is
0,
the
pixels
WTO
in
ed. Cor
rec
int display
The
first
¥-coordinate
character
set
which allow
A"):
PLOT
location
in
the
3,
2,
or 3 in
display
or
3.
but
on
5,5.
(The
onl
the
the
looking
register
and when
are
set to 0.
GRAPHICS 3
t by
doing
ed
b y a PLOT
expression
(see
played
by the
s
y
in
a
a
LOCATE (LOC.)
48
Graphic Modes a
nd Commwu
Format:
Example:
This
command
th
e graph
specified
mode
s 0
4-co
lor
m od es. The t w o arithmetic expre
of the
point. LOCATE
is
LOCATE a
exp1, aexp2, va
150 LOCATE 1
ics w
positions
ind
the invisible
ow,
ret r i
arithmetic variable
through
2;
0
or 1 for
is e
POSITION
2,
15, X
eves th
. T
the
quivale
r
graphics
e d at a a t that pixe
his gives a
2-color
number
graphics modes; and
ssion s specify
nt
to:
aexp1
, a
exp
2:GET #6,av
cursor
at
the
specified loc
l, a
nd
from 0 to
th e X a
ar
stor
255
0, 1, 2,
nd
Y coo
es
it
for
Graphics
or 3 for
ation
in
in the
the
rdinates

Doing
a PRINT
the
pixel
which
repositioning
before
LOCATE
doing
command.
10
GF.:AF'H
;2€1
COLOP
30
::;ETCOLOF.: 2 ..
40
PLOT
5€1
DPAl·nO
6ft
LOCATE
70
F'RH-H
the
the
I
C::;
1
1~3
;:.::
after
was
cursor
PRINT.
3+
..
15
15
_,
12
..
a LOCATE
examined
and
The
16
1
~3,
:3
15
15_,
i<
or
to
putting
following
GET
be
the
from
the
modified.
data
that
program
screen
This
was
read,
illustrates
may
cause
problem
back
is
into
the
the
data
avoided
the
pixel
use
of
in
by
the
PLOT
(PL.)
POSITION
PUT/GET
(PU./GE.)
(POS.)
On
execution,
ment
which
Format:
Example:
The
PLOT
command
the
graphics
Y-coordinate.
luminance
change
COLOR.
mode
the
Table
Format:
Example:
The
at a specified
statement
until
Formats:
Examples:
this
Points
being
total
number
9-1.
POSITION
can
an
I/0
Figure
the
was
PLOT
100 PLOT 5,5
window.
The
in
the
color
used.
POSITION
100 POSITION
location
be
command
PUT
GET
100
200 GET #1, X
9-2.
program
stored
aexp1,
is
color
color
register,
that
can
The
of
rows
statement
on
used
in
which
#aexp,
#aexp,
PUT
#6, ASC("
Example
prints
in
pixel
aexp2
used
in
graphics
The
aexp1 specifies
of
the
register
and
be
plotted
range
of
points
(X-coordinate)
aexp1,
aexp2
8,
12
is
used
the
screen
all modes.
involves
aexp
avar
A")
Program
the
12, 15.
plotted
from
the
on
the
to
place
(usually
Note
Using
data
(1)
determined
modes 3 through 8 to
the
X-coordinate
point
is
the
last
screen
or
the
invisible
precedes
that
screen
COLOR
of
are
at 1
columns
the
color
begins
the
LOCATE
determined
statement
the
plotted
dependent
and
extends
(Y-coordinate)
graphics
a PRINT
cursor
is
issued.
does
by
the
COLOR state-
display a point
and
the
by
the
executed.
point,
on
the
to
one
window
statement).
not
actually
aexp2
hue
and
use
SET-
graphics
less
than
shown
cursor
This
move
in
the
To
in
In
graphics
ment
works
the
cursor
causes
The
byte
the
color
GET is
tion,
into
respond
used.)
work,
hand-in-hand
is
moved
the
one-byte
is
either
data
used
to
the
to
the
PUT
to
input
an
AT
(modes
input
the
specified
values
is
used
with
the
next
(second
ASCII code
3-8).
code
byte
arithmetic
in
the
COLOR
to
output
the
POSITION
location
aexp)
byte
of
the
variable.
statement.
data
to
the
statement.
on
the
screen. Doing
to
be
displayed
for a particular
character
The
displayed
values
(PRINT
Graphic Modes
screen
After a PUT
at
the
character
used
in
and
display.
a PUT
cursor
(modes
at
the
PUT
INPUT
and
This
(or GET),
to
device
position.
0-2)
cursor
and
GET
may
also
Commands
state-
#6
or
posi-
cor-
be
49

Note:
Doing a PRINT
data
in
the
reposition
doing
the
pixel
the
cursor
PRINT.
after a LOCATE
which
was
and
put
examined
the
data
or
to
that
GET
be
modified.
was
from
read,
the
To
back
screen
avoid
into
may
the
this
pixel
cause
the
problem,
before
SETCOLOR (SE.)
Format:
Example:
This
statement
in
the
defined
aexp1
aexp2
aexp3
SETCOLOR
100 SETCOLOR 0, 1, 4
specified
below:
=
Color
=
Color
Color
higher
white.)
TABLE
COLORS
GRAY
LIGHT
ORANGE
RED-ORANGE
PINK
PURPLE-BLUE
BLUE
BLUE
LIGHT BLUE
TURQUOISE
GREEN-BLUE
GREEN
YELLOW-GREEN
ORANGE-GREEN
LIGHT ORANGE
ORANGE
is
used
to
color
register.
register
hue
number
luminance
the
9.3-THE
(GOLD)
aexp1,
choose
aexp2,
the
The
(0-4
depending
(0-15. See
(must
number,
the
ATARI
NUMBERS
aexp3
particular
parameters
on
Table
be
an
even
brighter
HUE
(SETCOLOR
AND
SETCOLOR
hue
and
of
the
SETCOLOR
graphics
9-3)
number
the
display.
COLORS
luminance
statement
mode)
between 0 and
14
is
almost
COMMAND)
(aexp2)
NUMBERS
0
1
2
3
4
6
7
8
9
10
11
12
13
14
15
to
be
14;
pure
stored
are
the
50
Graphic Modes
and
Commands
Note:
Colors
The
ATARI
from 0 through
through
the
these
every
to
because
This
tables
No
Although
than
and
COLOR4,
current
RAM
colors.
locations.
television
specify a color
it
specifies
can
be
in
this
SETCOLOR
128
five
can
SETCOLOR
will
vary
display
4.
The
see
The
(The
frame.)
register.
data
confusing,
section
is
commands
different
be
displayed
statement
with
type
hardware
Operating
Appendix
I -
SETCOLOR
OS
transfers
The
SETCOLOR
The
which
so
only
careful
advised.
are
needed
color-luminance
at
any
is
to
specify
and
adjustment
contains
System
Memory
five
(OS)
Locations)
statement
these
values
statement
COLOR
statement
indirectly
experimentation
if
the
default
combinations
one
time.
The
these
five
of
TV
color
has
five
RAM
where
is
used
to
to
the
requires a value
uses
corresponds
and
set
are
purpose
colors.
or
monitor
registers,
locations
it
change
hardware
different
to a color
study
of
five
possible,
of
the
numbered
keeps
the
from 0 to
of
the
colors
color
used.
(COLORO
track
values
registers
numbers
register.
various
is
used.
not
more
registers
of
in
4

TABLE
9.4-TABLE
OF
SETCOLOR
"DEFAULT"
COLORS*
Set
color
(Color
"DEF
*
Note:
and
A
this section
Register)
0
1
2
3
4
AULT"
Colors may
adjustment.
program
10
GPAFHICS
2'€1
~:;ETCOLO
30
PLOT
40
PLOT 19.'
50
PLOT
60
PLOT
70
POKE
8(1
F'P
HH ; F'P
UTEP~:;"
9(1
I~OTO
occurs
vary
illustrating
is
shown
3
F 0
.~
2
17
..
1 :
DF.'At.JTO
1 :
DRAL·HO
20
..
1 :
D~~AL.JTO
22
..
1 :
DRA
752
..
1
WT
9(1
Defaults
Color
if
not
SETCOLOR
depending
Graphics
below:
_,
B = C
:OL!)P
~.JT
O
II
To
2
12
9
4
0
mode 3 and
1 7
..
1 0 :
19
..
1:::
20
..
1 E
22
..
W:
AT
A~
Luminance
statement
upon
the
1
DPAl·JTO 9 ·' 1 ::
D~:A~·lTO
: I FEF~:~~Gt
Actual
8
10
4 DARK
6
0 BLACK
is
used.
television
the
monitor type,
commands
PINK OR RED
explained
:
30, 18
·
iAL
COi·1P
Color
ORANGE
GREEN
BLUE
condition,
so
far
in
The
SETCOLOR
(see
Table
(orange)
displayed.
sion
ATARI
Note th
col
If the
and
or
(black).
the
at
program
and
COLOR
9.5).
The
SETCOLOR co
and a luminan
Line
90
PERSONAL COMPUTERS
the
background
is execut
string
expression
ce
of 8 ("norma
suppresses
color
ed , it
in
statements
the
was
will
the text window
mmand
l").
cursor
in
never
print
set
The
and
the text
the
the color
loa
line 100
set
because the
Atari
of
the
ds
col
or
regist
next 4 lines plot the
prints
window
logo
in the
as
in
Figure
Graphic
points
er
the
(6
spaces
default
graphics
9-3.
Modes
to
be plotted
0 w i
points
string
in).
is
the desired
and
Commands
th
hue
to
expres-
window
2
be
51

0
~
0
~
'-'
fl.)
E-
z
...
0
C).
fl.)
...
~
~
I
...
18
19
10
11
12
13
14
15
16
17
X-AXIS
POINTS
2
0 1
0
1
2
3
4
5
6
7
8
9
1
2
3
4
4 5 6 7 8
3
9
10
11
1213
1415
16
171819,20
ATARI PERSONAL COMPUTERS
(COLUMNS)
2122
23
2425
26
27282930
31
32
33
3435
3637
38 39
DEVICE
(Graphics
/(TEXT
DEVICE
CODE
Screen
Editor
(Text
"S."
or
Text)
WINDOW)
CODE
"E."
Only)
Figure
9-3.
Atari
Logo
Program
Execution

"
~
;:r
c;·
~
~
;:s
"'
....
g
;3
;3
;:s
"'
~
"'
"'
Default
Colors
LIGHT
BLUE
DARK
BLUE
BLACK
ORANGE
LIGHT GREEN
BLUE
DARK
RED
BLACK
ORANGE
LIGHT GREEN
BLUE
DARK
BLACK
ORANGE
BLACK
LIGHT GREEN
DARK
BLUE
BLACK
Mode
or
Condition
MODE 0
ALL TEXT
WINDOWS
MODES 1
and
2
(Text Modes)
MODES 3, 5,
and
7
(Four-color
Modes)
MODES4
and
6
(Two-color
Modes)
4
MODE8
(1
Color
Luminances)
2
and
TABLE
SETCOLOR
(aexpt)
Register
9.5-MODE,
Color
No.
0 COLOR
1
2
3
4
0
1
2
3
4
0
1
2
3
4
0
1 -
2
3 0
0
1
2
3
4
--
actually
character
-
SETCOLOR, COLOR
Color
(aexp)
data
actually
determines
character
be
plotted
COLOR
data
determines
plotted
1
2
3
- -
0
1
-
-
1
0
-
-
to
to
be
DESCRIPTION
-
Character
Background
-
Border
Character
Character
Character
Character
Background,
Graphics
Graphics
Graphics
Graphics
Graphics
-
-
-
Graphics
-
Graphics
Graphics
-
Border
~--
TABLE
AND
luminance
Border
point
point
point
point
(background
point
point
(background
point
luminance
point
(background
COMMENTS
(same
color
default),
default),
(same
default)
as
background)
Border
Border
color
as
background)

XIO
(X.)
SPECIAL FILL
APPLICATION
Format:
Example:
This
special
plotted
used
The
1.
2. DRA
3.
4. POSITION
5.
6.
The
that
points
for
aexp1
following
PLOT
bottom
WTO
area
to
be
DRA
WTO
POKE
address
This
method
cified
area. The
until
it
reaches a pixel
necessary).
been
filled
will
go
into
which
has
fill
if
this
following
the
XIO
XIO 18,
100 XIO 18, #6, 0, 0,
application
happens
command
#aexp,
ofthe
and
lines
with a non-zero
and
aexp2.
steps
illustrate
right
corner
upper
right
filled.
upper
left
corner
cursor
at
lower
765
with
is
used
to fill
fill
starts
This
means
in
with a non-zero
an
infinite
no
non-zero
.
program
creates a shape
draws
aexp1,
XIO
corner
the
each
at
which
that
loop
pixels
aexp2,
"S:"
statement
the
fill
(point 1).
(point
(point
left
corner
fill
color
horizontal
the
left
contains
fill
cannot
value, as
if
a fill
.
I:I;H!M
in
the
filespec
color
process:
2).
3).
(point
data
and
proceeds
be
the
with
or
and
lines
of
fills
an
area
value.
This
outlines
4).
(1, 2,
or
line
from
across
non-zero
used
to
change
fill
will
zero
(0)
data
(ifjWI;I@§i
fills it
with a data
the
left
and
on
the
Dummy
the
3).
top
to
the
data
(will
stop.
is
attempted
can
bottom
screen
variables
right
bottom
line
wraparound
an
area whi
The
fill
b e
used
(color)
of
between
(0)
edge
of
oft
he
to
the
ch h
command
on a line
to
stop
of
3.
the
figure.
are
the
spe-
right
if
as
the
Note
10
GRAF'H
2'0
COLOF.'
30
PLOT
40
D~:A~-H
:-0
[tRA~~JT~J
60
F'0:3ITI0fi
70
F'OKE
8f1
::-no
9ff
GOTO
Assigning
This
procedure
set.
First,
the
conversion
Example:
1.
In
Table
2.
Using
32
(114-
I
70;
C!
765
1:::
90
Colors
look
Assign
w
9-6,
Table
32 = 82
c:;
5+
3
45
50
.'
W
3(t
..
10
10,45
.:
3.
, #6, o
Figure
describes
up
the
of
that
hose
find
9-7,
16
..
o.,
":;
·"
9-4.
To
Characters
the
character
numb
er
SETCOLOR 0
color
is
determin
the
column
locate
column
).
Example
In
method
numb
required
to
and
4.
"FILL"
Text
Modes 1 and
of
assigning
er
·in
Table
to
ass
lower
case "r"
ed
by
register
number
Conversion
Program
colors
9-6.
ign a co
in
0.
for
" r"
is
the
2
to
the
Then,
see
lor
register
mode
2
(114-column
ch a
racter
Atari
Table
to
4).
number
character
9-7
to
get
it.
minu
s
54
Graphic
Modes
and
Commands

Table
9.6-INTERNAL
CHARACTER
SET
If
0
1
2
3
4
5
6
7
8
9 )
10
11
12
13
14
15
Column
CHR
Spa
ce
!
"
It
$
%
&;
'
(
*
+
'
-
-
I
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
If
1
CHR
0
1 33
2
3
4
5
6
7
8
9 41
42
43
'
44
<
-
45
-
46
>
?
47
If
32
34
35
36
37
38
39
40
Column
CHR
@
A
B
c
D
E
F
G
H
I
J
K
L
M
N
0
It
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
2
CHR
p
Q
R
s
T
u
v
w
X
y
z
[
\
J
A
-
1.
In
m ode 0 these characte
It
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Column
CHR
c
G
ll
g
a
Cl
~
~
~
~
~
~
Iii
Iii
~
~
It
80
81
82
83
84
85
86
87
88
89
.
90
91
92
93
94
95
r s must be precede d w
3
CHR
g
~
=
c
c
~
~
~
~
11
~
CD
~
0
D
Q
Cl
Column
It
CHR
96
D
97
98
99
100
101 e
102
103
104
105 i
106
107
108
109
110
111 0
ith
an escape,
a
b
c
d
f
g
h
J
k
I
m
n
CHR$(27),
It
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
4
to
CHR
D
CD
<D
CD
b e
p
q
u
v
w
X
y
z
...
-4
~
print
r
s
t
I
ed.

Table
9.7-CHARACTER/COLOR
ASSIGNMENT
MODEO
MODE1
OR
MODE2
zSETCOLOR
SETCOLOR 0
SETCOLOR 1
SETCOLOR 2
SETCOLOR 3
3. POKE
Conversion
2
#+32 #+32
_$32
NONE
#+160
#+128
Z.
Luminance
the
Character
ters
or
special
756,226
POKE
or
CHBAS =
756
POKE CHBAS,
1
POKE
controlled
Base
graphics
226
Conversion
756,224
#+32
#+64
#+160
#+192
by
SETCOLOR
Address
characters
2
1,
0, LUM .
(CHBAS)
; e.g.,
Conversion
#-32
#-32
#-64
#+96 #+96
#+64
with
POKE
226
3
to
specify
756,226
Conversion
NONE
#-32
NONE
#+128
lower
case
4
let-
To
return
with
to
224.
4. A PRINT
"r"
to
SETCOLOR 0
Graphic
These
alphabetic
design,
Control
characters
keys
pictures,
upper
case
statement
Characters
are
shown
etc.,
letters, numbers,
using
the
converted
in
mode
2 (see
produced
on
back
in
mode 0 and
when
cover.
and
punctuation
number
Table
9-5).
the
&ml
These
characters
in
modes 1 and 2 if
(82)
assigns
key is
CHBAS
marks
, POKE CHBAS
the
pressed
can
be
lower
used
is
changed
with
to
case
the
draw
.
56
Graph
ic
Mod
es
and Commands

10
SOUND (SO.)
This
section
through
can
be
"played"
also
be
fects.
The
used
to
tions
allow
games,
The
SOUND
Format:
Example:
The
statement
counters
This
etc.
command
SOUND
command
describes
the
audio
used
to
other
manipulate
these
and
SOUND
100 SOUND 2, 204, 10, 12
statement
is
executed.
another
the
statement
system
simultaneously
simulate
commands
controllers
SOUND
can
ofthe
explosions,
the
keyboard,
functions
PADDLE
PTRIG
aexp1,
causes
The
statement
be
used
SOUNDS
CONTROLLERS
used
to
generate
television
creating
described
joystick,
to
be
plugged
covered
aexp2,
the
specified
note
will
in
either
harmony.
whistles,
in
in
this
aexp3,
continue
with
Direct
monitor.
this
and
in
and
section
aexp4
note
the
same
or
AND
musical
Up
to
This
and
other
section
paddle
playing
Deferred
to
deal
controllers.
used
are:
STICK
STRIG
begin
aexp1
GAME
notes
four
different
SOUND
interesting
with
in
BASIC
playing
until
the
or
an
END
modes.
and
sounds
sounds
statement
sound
the
functions
These
programs
as
soon
program
statement.
can
func-
as
ef-
for
the
en-
The
aexp1
aexp2
aexp3
aexp4
SOUND
=
parameters
Voice.
ment.
Pitch.
the
lower
various
one
octavf'
Distortion. Can
sound
gives
an
a
race
with
the
value
of
volume
special effects,
Volume control. Can
barely
mal.
If
should
are
described
Can
be
0-3,
but
Can
be
any
the
pitch.
musical
effects. A 10 is
interesting
track)
1 is
(see aexp4).
audible
more
not
notes
below
be
can
be
distortion
used
to
noise
whereas
than 1 sound
exceed
middle
32.
each
number
Table
ranging
C.
even
numbers
used
buzzer
produced
value
(aexp3)
force
output
The
rest
generation,
be
between 1 and
a 15 is
statement
This
will
as follows:
voice
requires a separate
between
10-1
to
sound. A buzzing
using
0-255.
defines
from
created a "pure"
to
of
and
loud. A value
create
the
two octaves
between
two
separate
alternating
the
speaker
the
numbers
experimental
15.
is
being
an
unpleasant
Sounds
Using
The
larger
pitch
numbers
above
0-14.
Used
tone
sound
(like
SOUND
between 0 and
using
are
used
use.
a 1
creates a sound
of
B is
considered
used,
the
"clipped"
and
Game Controllers
SOUND state-
the
number,
for
the
middle C to
in
creating
whereas a 12
engines
commands
the
for
total
at
1.
A
specified
other
nor-
volume
tone.
57

Using
the
note
write a program
values
that
in
will
Table
"play"
10-1,
the
the
following
C scale.
example
demonstrates
how
to
TABLE
HIGH
NOTES
MIDDLE C
LOW
NOTES
10
F.:EAD
20
IF
30
SOUr·iD
40
FOP
50
PRWT
60
GOTO
70
END
80
DATA
191.·
90
[lATA
Note
that
designated
10.1.
A=256
~·J=1
96.:
the
range.
A
~3
.'
A
10
~·9
..
108.:
12:3.~
DATA
TABLE
~
iHEt·i
A
..
1
(1
.•
1 0
TO
400:
31.·
35,
121
144.~162
Figure
statement
The
256 is
OF PITCH
NOTES
c
B
A#
orB~
A
G#
or
A~
G
F#
or
G~
F
E
orE
D#
D
or
D~
C#
c
B
A#
orB
A
G#
or
A~
G
F#
or
G~
F
E
D#
orE~
D
or
D~
C#
c
B
A#
orB~
A
G#
or
A~
G
F#
G~
F
D
D#
or
I~
D
or
Db
C#
c
HiD
r·iE>~T
~·J
4f)
..
45
..
4 7
..
1:::2.~
193.:217)243
10-1.
Musical
in
line
used
as
VALUES
..
53
..
6(1, 64,
80
ends
an
end-of-data
72
..
Scale
Program
with a 256,
FOR
29
31
33
35
37
40
42
45
47
50
53
57
60
64
68
72
76
81
85
91
96
102
108
114
121
128
136
144
153
162
173
182
193
204
217
230
243
·'
:31
256
marker.
THE
which
MUSICAL
is
outside
ofthe
58
Sounds
and
Game Controllers

GAME
CONTROLLER
FUNCTIONS
Figure
sonal
sonal
fed
directly
10-2 is
an
Computers.
Computer
to
the
illustration
The
controllers
or
to
external
computer
of
the
three
can
mechanical
for
processing
controllers
be
attached
devices
and
used
directly
so
that
control
with
the
to
the
outside
purposes.
Atari
Atari
events
can
PerPer-
be
PADDLE
PTRIG
STICK
Format:
Example:
This
function
controllers
other
functions
controls,
"PADDLE
etc.
ween 1 and
troller
Format:
Example:
The
is
rotated
PTRIG
controller
number
Format:
Example:
This
used
0-3
between 0 and 7 as
function
with
from
left to
Figure
P ADDLE(aexp)
PRINT P ADDLE(3)
returns
are
For
ACTIVE."
228,
the
numbered
or
commands
example,
with
the
status
0-7
Note
counterclockwise
PTRIG(aexp)
100
IF
PTRIG(4)"'0 THEN PRINT "MISSILES FIRED!"
function
is
pressed. Otherwise,
returns a status
STICK(aexp)
100 PRINT
works
the
joystick
STICK(3)
exactly
controller.
right.
10-2.
Game
of a particular
from
left
to
"cause"
the
statement
that
the
number
(turned
it
it
designates
the
same
The
Controller
Controller
Controller
Controller
Controllers
numbered
to
right.
This
further
IF
PADDLE(3) = 14
PADDLE
increasing
ofO
to
ifthe
function
in
the
trigger
returns a value
the
controller.
way
as
the
PADDLE
joystick
1 =
controllers
STICK(O)
2 = STICK(l)
3
==
STICK(2)
4 =
STICK(3)
controller.
function
actions
like
returns a number
size
as
the
left).
button
of
1.
The
command,
are
The
can
be
sound,
THEN
knob
on
ofthe
designated
aexp
numbered
paddle
used
with
graphics
PRINT
the
must
but
can
from
bet-
con-
be
be
a
Figure
troller
10-3
is
moved
shows
in
the
any
numbers
direction.
that
will
be
returned
Sounds
when
the
and
Game Controllers
joystick
con-
59

14
13
STRIG
Fonnat:
Example:
The
STRIG
with
both
Figure
STRIG(aexp)
100
IF
function
the
joystick
10-3.
Joystick
STRIG(3) = 0
works the
and key
Controller
THEN
PRINT " FIRE TORPEDO"
same
way
as
the
board controller
Movement
PTRIG
s.
function
.
It
can
be
used
GO
Sound.s
a nd Gam e
Contro
llers

11
MEMORY
CONSERVATION
ADVANCED
This
section
memory,
grams.
processor
language.
a
careful
These
hints
grams
necessary
1.
less
In
many
characters
true
Statements
were
conventional
keywords
and
This
chip
An
study
due
of
used
the
includes
combining
section
nor
additional
of
Atari's
give
ways
readable
to
memory
small
as
they
ATARI
are
on
program
typewriter)
and
hints
machine
does
not
does
it
purchase
Assembler
of
conserving
and
harder
limitations.
computers,
are
typed
Personal
always
variable
displayed
on
increasing
include
give
eliminating
into
Computer
entry.
between
names.
PROGRAMMING
TECHNIQUES
programming
language
an
instructions
of
the
Atari
Editor
memory
to
modify,
the
keyboard
System,
the
same
Spaces
Here
should
successive
is
programs
instruction
on
Assembler
Manual
. Some
but
there
blank
regardless
be
an
example:
efficiency,
with
set
for
programming
Editor
are
strongly
ofthese
are
cases
spaces
will
which
between
save
removes
of
used
Gust as
keywords
memory. This
Atari
the
6502
in
cartridge*
recommended
methods
where
extra
how
many
in
and
conserving
BASIC
words
typing
micro-
machine
make
this
is
spaces.
spaces
between
pro-
and
pro-
and
not
on
.
is
a
Note
the
cases, a
spaces
2. Each
" logical
used
to
colon
bytes.
*Available
space
statement
are
left
new
line
line".
full
(:)
to
late
between
out,
number
Each
capacity
separate
1980.
10
will
but
logical
or
each
IF A
IF
and A and
be
interpreted
this
is
represents
line
not.
Adding
pair
5 THEN PRINT A
between
correctly
not
always
takes
of
statements
the
beginning
6 b ytes
an
additional
true.
of "overhead
on
Advanced Programming Techniques
THEN
by
the
Use
conventional
of
what
BASIC
the
same
and
PRINT.
computer
is
called a new
" ,
whether
statement
line
takes
In
most
even
if
spacing.
it
by
using
only
all
is
a
3
61

If
10
20
3e
40
5e
and
10
This
3.
Variables
constant
variable
But
its
twice
used
you
need
to
save
>{='r'+1
V=Y+1
Z=X+"i'
PRI~H
GOTO
consolidate
>::=:~+l:Y='l+1:2=::·::+'-f
each
length.
Z
53
lines
consolidation saves
and
constants
(4,5,16,3.14159, etc.) is used,
requires 8 bytes
time
it
is
Thus,
in a program,
throughout
memory,
like
this:
:
PRINT
12
bytes.
should
plus
used
after
if a constant
it
the
being
should
program.
avoid
programs
Z:GOTO
be
"managed"
the
length
defined,
(such as 3.14159) is
be
defined
For
example:
10
it
takes 7 bytes.
of
the
it
takes
as a variable,
like
this:
for
savings,
variable
only 1 byte,
used
too. Each
Defining a new
name
(in characters).
regardless
more
than
and
the
variable
time
once
name
a
of
or
10
PI=3 .
20
PRINT
SQUARED T It1ES
4. Literal
(including
5.
String
(including
ofthe
Obviously,
6. Definition
variable
size
umns).
mately
times
strings
variables
string
name
of
the
Thus,
3 (for
100 (the
14159
"AREA
all spaces)
spaces)
itself(1
the
of a new
matrix
OF
II
require 2 bytes
take 9 bytes
plus
byte
use
of
matrix
plus
the
(product
a 25
row
variable
matrix
A
CIRCLE
i
pI
in
the
string.
the
space
per
string
requires
space
of
by 4 column
name) + approximately
size),
or
IS
overhead
each
plus
eaten
character,
variables
15
needed
the
number
about
for
630
THE
the
up
by
including
is
very
bytes
the
matrix
bytes.
RADIUS
and 1 byte
length
the
plus
DIM
of
would
10
costly
rows
of
DIM
statement
spaces)
in
the
statement
and
require
(for
the
for
the
when
terms
length
plus 6 times
the
DIM
each
character
variable
plus
the
it is
defined.
of
RAM.
of
the
number
15 +
approxi-
statement)
name
size
matrix
the
of
col-
+ 6
82
Advanced Programming Techniques

7. Each
8.
9.
character
people
remove
Subroutines
take
hand, a subroutine
and·
Parentheses
cases
However,
precedence
trying
remark
less
memory
RETURN
if
they
after
REM
takes
to
understand a program,
statements
can
save
memory
than
duplicating
that
is
only
statements.
take
one
byte
make
an
expression
removing
will
unnecessary
same a few
to
save
because
each.
bytes.
one
byte
memory.
called
Extra
more
parentheses
of
memory.
but
sometimes
one
subroutine
the
code
several
once
takes
parentheses
understandable
extra
are
and
Remarks
it
and
several
times.
bytes
a good
to
the
relying
are
helpful
is
necessary
short
On
the
for
the
GOSUB
idea
in
programmer
on
operator
to
to
calls
other
some
.
PROGRAMMING
IN
MACHINE
LANGUAGE
Machine
puter
subroutines
entered
Before it
cumulator
the
ped
The
(decimal),
struction.
in
format
The
subroutine
array
The
decimal
decimal
language
routine.)
language
contains
into a program
returns
stack.
off
the
subroutine
locations 212
to
ADR
function may
or
string,
following
codes, co
number
is
a 6502
from
BASIC
to
(PLA)
instruction
If
this
number
stack
also
should
and
then
The
BASIC
and
obtain
subroutine.
in
machine
program,
the
and
nverting
into
written
microprocessor
BASIC,
return
interpreter
213
value
then
entirely
using
the
by
hand
the
to
remove
is
not
0,
using
PLA. (See
end
by
placing
to
BASIC
into
an
returned
be
used
to
language. Use
use
this
Hexcode Loader,
each
hexadecimal
an
array.
(An
array
in
binary
and
USR
assembly
assembly
the
then
all
Figure
the
using
will
convert
integer
by
the
pass
data
the
address
The
array
is
used
code.
The
AT
it
is possible to call 6502
function. Short
(if
necessary).
language
number
ofthe
input
6-1).
low
byte
an
RTS
the
2-byte
between 0 and
USR
function.
that
is
stored
ADR
function
as
one
of
provides
number
is
then
to
allocate space
routine
(N)
of
arguments
of
its
(Return
binary
65535
in
to
the
USR
the
means
to
decimal,
executed
routines may
get
ARI
must
input
result
from
arrays
the
input
of
in
Personal
machine
then
do a pull
arguments
must
be
in
location 212
Subroutine)
number
in
floating-point
or
strings
address
arguments.
entering
and
storing
as
an
assembly
memory
for
Com-
code
be
ac-
off
pop-
in-
stored
to
of
the
hexa-
the
the
a
Advanced Programming Techniques
63

1. To use
disk
or
10
GRAPHICS
RAI'1"
20
REM
A~t
A,
S'
AT
21
REM
30
REM
0
OUTPUT
31
REM
SR
STATEMENT.
43
DIM
50
REM
60
N=0 = PRWT
ONE
70
INPUT
89
IF
90
FOR
100
:~
I } I ) ) =
110
120
13£1
140
150
190
200
210
220
230
240
250
260
300
ES
IH
999
1000
1910
)
1030
1940
1050
1060
1970
LLO~~S
this
program,
cassette
for
0,
future
PRINT
=PRINT
STORES
OUTPUTS
LI~E
USEJ;.:
REST
A<
INPUT,COt·MEF.:~3IOt
NUMBER
TI-H~
LINE,
OF
50)..
HE:)=:$(
OECit1AL
IN
HITS
BASIC
"Et-HER
IS
IN}
EtHEF.:
1·£:=0::$
HE:~=
II
DONE
1=1
TO
LEW
IF
HE:~<
I,
I ){="9"
GOTO
120
N=~t=n6+ASC<
NE'I.T
I
PRit·IT
A<
C
)=N
IF
N<>999
REM
PRHIT
GRAPHICS
HE:);:$(
H =
C=C+1
THEN
OUT
0=PRINT 111500
c=e
C=C+1
IF
A< C )=999
PRINT
A<C
GOTO
PRIHT
f'E1
A(
C);
II}
)=0
220
"PUT
CORRECT
Lit·E
1000.
:r.~
E>;ECUT
CLR : BYTES=0
TRAP
390:
DIM
FOR
I=l
TO
READ
A=
IF
A>255
POKE
ADR<E$)+J,A
NE:>n
I
REM
BASIC
PART
first
enter
it.
After
entering
use.
"rE:~~CODE
LOADER
EQUILIALHHS
PRINTED • DATA
STAT8·1ENT
1500.
PLACES
CURSOR
ON
"RETURHu, ~ ENTERS
PROGRAM
IOCLUDING
5)
·
V:;TORAGE
1
1-1)::
CODE
. IF
I
DOHE
I •
II;
II
THEN
N=999:
HE:~{$>
H£t-~
L I> >-Asu
GOTO
DATA
LWE
THEt-~
PRHH
II;
t-UMBER
":STOP : REt1
I
Ot~
MODULE
E$(
1 ),
GOTO
N=t-t=~16+UAL<
11
60
AT
DATA
"999
OF
TRAP
:f.::;::
E( I NT<:
8\'TES . ...-6
A"
1500
11
11
B'lTES
TI·El~
GOTO
1060
OF
USER
Is
P~:OI;RAt1
PROG
IN
ARR
PR
It·ITE
OF
DATA.
LAST
130
>+10
;
:STOP
HE:=< BYT
LmE
)+1
it, save
U
HE
FO
this
program
on
64
Advanced
Programming
Techniques
Figure
11-1.
He.-rcode
Loader
Input
Program

2.
Now
add
cluding
example
3.
Count
line
1000
replace
4 .
Run
the
subroutine
DONE
5.
Now
the
the
program
pressed.
6.
Add a program
hexcode
using
CSA
the
program
routine
(ftii@l;li!+ii
reload
the
the
below.)
the
total
when
it.
program
and
DATA
loader
VE
may
the
BASIC
USR
function
number
requested.
pressing
press
IDiiJ.
line
until
line
through
or
SAVE.
containing
cause
.
If
the
program,
language
and
1Di1J
(1500)
the
5 GOTO 1000 to
the
system
and
that
of
hex
If
enter
displays
cursor
line
It
is
important
the
system
doe
correct
part
calls
codes
another
the
after
is
260).
USR
to
sn 't
of
your
program
the
machine
to
be
entered
number
hexadecimal
each
entry. After
on
the
screen.
moved
calL A
crash.
it.
to
bypass
Now
save
to
do
If
respond,
mistake
the
the
this
the
turn
starting
language
and
enter
is
already
codes
of
It
will
DATA
hexcode
the
completed
before
in a machine
system
power
at
subroutine.
this
entered,
the
machine
the
last
not
be
line
and
loader
(or
executing
does
hang up,
off
and
line
1080 in-
number
simply
entry,
entered
fiiiim
delete
program
the
part
language
on
again,
(See
on
level
type
into
is
the
by
of
press
Note:
The
following
Loader
machine
BASIC
1980
1090
1100
1110
1120
1130
1140
1150
1160
After
entering
Type
RUN
This
method
program.
program
graphics
GRAPHICS
FOR
PRIHT
PF~INT
PRIHT
PRIHT
NE:)::T
Q=USR(
FOR
liimmJ.
two
The
changes
design,
I=1
#6j
#6;
#6.:
#6.:
I
ADR<
I=1
this
program,
only
sample
first
then
1+16
TO
11
t10t.hir.s
11
t~OTHH~
11
not.hins
11
NOTHit·~
E$
TO
works
with
programs
program
the
colors.
changes
6
is
IS
ls
IS
)+
1 )
25: t·
E=<T
I =
check
that
1000 CLR:BYTES
relocatable
can
each
prints
colors.
The
second
1v1
t"II0
in::t!
t10UH~G!
1
mo
...
•ins!
t101...!H~G!
GOTO
line
NOTHING
1150
1000 reads:
= 21
machine
be
entered
sample
11
II
11
II
language
into the
IS
MOVING
program
routines.
Hexcode
while
displays
the
a
Ad
vanced
Progra
mmin
g Techn
iqu
es
65

Now
enter
the
hexadecimal
codes
as
shown
column
by
column.
When
completed,
last
entry
Now
run
has
been
5.
The
second
NOTHING
line
1000.
1080
1090
110(1
1110
1120
1130
1140
115(1
1160
117(1
1180
1190
1200
121(1
1220
68
A2
0
AC
C4
2
BD
cs
2
9D
C4
type
(999)
on
the
the
program
added,
type
RUN
program,
IS
MOVING
Follow
steps 2 through
GRAPHICS
SET
COLO~~
SETCOLOF.:
SETCOLOR
CR=1
FOR
::-::=0
TO
COLOR
PLOT
~AL·JTO
CR=CR+0
IF
NE:x:T
:~=US~'(
FOR
GOTO
INT<
801
:;
CR=4
:<
ADR(
1=1
1200
0
::
..
.
125
THEN
TO
DONE
and
DATA
by
line
typing
lilll!lmJ.
which
program. Be
follows,
7+16
€L
91
4
L 9 ..
E:
2~9~4
159
CR)
95
CR=1
E$
)+
1 )
15=N£:;::T
2
E8
EO
3
90
F5
8C
C7
2
60
press
&mJ.
and
pressiDmJ.
GOTO 1000
Press
illil1tito
should
sure
to
check
6.
I
Now
and
place
pressing
stop
be
entered
the
BYTES =
BYTES=
the
l;liilll;!ll,
program
cursor
and
in
place
__
21
after
or
if
delete
of
count
the
line
line
5
the
in
66
Advanced
Type
Enter
Programming Techniques
RUN
lim!liJ3
the
hexadecimal
68
A2
AC
C4
BD
C5
9D
-
CA
codes
for
this
program
2
E8
0
2
2
EO
2
90
F5
8C
C6
2
60
column
by
column.
BYTES=
21

When
completed,
last
entry
Now
run
the
GOTO 1000
5.
(999)
program
and
on
type
type
the
RUN
DONE
DATA
by
typing
lilii!lmJ.
and
press
line
and
GOTO 1000
Press
lilii!lmJ.
press
lilii!lmJ.
and
l!m!!:l
Now
pressing
to
stop
place
limml3,or
program
the
cursor
and
after
add
delete
line
line
the
5
Address
02C4
02C5
02C6
02C7
6000 68
6001
6003
6006
6009
600C
600D
600F
6011 8CC602
6014 60
Object
Code
A200
ACC402
BDC502
9DC402
E8
E002
90F5
Figure
might
prove
Assembler
Line
No.
0100
0110
0120
0130
0140
0150
0160
0170
0175
0180
0190
0200
0210
0220
0230
0240
0250
0260
0270
0280
0290
Label
11-2
LOOP
illustrates
useful.
It
an
is
included
Subroutine
Mnemonic
*=
PLA
LDX
LDY
LDA COLOR1,X
STA
INX
CPX
BCC
STY
RTS
assembler
to
COLORO
COLORO,X
COLOR3
subroutine
here
Rotate
Data
$6000
110
113
LOOP Loop
used
for
the
information
Colors
Routine
From
4
Operating
COLOR 0 = $02C4
COLOR 1 = $02C5
COLOR 2 = $02C6
COLOR 3 = $02C7
Machine
Pop
Zero
Save COLOR 0
Increment
Compare
with
less
Save COLOR 0
Return
routine
..
to
one
colors
are
stack
the X register
2
if X register
than
from
to
rotate
of
rotate
register
rotated.
system
program
(See
Chapter
the
X re.e;ister (add
contents
2
in
machine
colors
the
user.
COLOR
address
starting
contents
COLOR 3
data
to
another.
address*
4)
of X register
level
which
one)
are
sub-
Assembler
Prints
11
Indicates
Routine
*
$
Indicates a hexadecimal
This
data
(source)
is
relocatable
number
Figure
This
11-2.
Portion
is
Using
Assembler
Source
Information
Atari
Subroutine
Assembler
To
Programmer
Cartridge
Rotate
Advanced Programming Techniques
Enters
Colors
67

APPENDIX
A
ALPHABETICAL DIRECTORY
Note:
The
period
RESERVED
WORD:
ABS
ADR
AND
ASC
ATN
BYE
OF BASIC RESERVED
is
mandatory
ABBREVIATION:
after
B.
all
abbreviated key
word
Function
va
riable
Function
Logical oper a
pressions
String
string
Function
sion
Exit
system
returns abs
or e
returns
joined
function
character.
returns
in
radi
from
BASIC
or
console
s.
BRIEF
OF
BASIC
xpr
essio
tor:
by
returns the
an s
or
SUMMARY
STATEMENT
olute
n.
memory
Expression
the
deg
and
processor
address
AND
are
arctangent
r ees.
return
WORDS
value
is
numeric value
.
(unsigned) of
of
a s
true only if
true.
of a number
to
the res
tring.
ident
the
both subex-
of a single
or
expres-
operating
CLOAD
CHR$
CLOG
CLOSE
CLR
COLOR
COM
CONT
cos
CSAVE
CLOA.
CL.
c.
CON.
data
from
Loads
String
to a numeri
Function
sio
I/0
operations.
The opposite
matrices.
Chooses co
work
Sa
Continue. Causes a
next
ing
Function
sion
Outpu
tape
function
n.
statement
.
me
as DIM.
line
a
STOP
(degrees
ts data f
storage.
returns
following
returns
Program
returns a single
c v
alu
used
of
lor reg
.
or
radians).
rom
e b e
twe
the
base
to
close a file
DIM:
ist
er
program
use
the
cosine
RAM
Recorder
en 0
and 255
10
logarithm
Undimension
to
b e used
to
of
restart
the
i·l;it!M key
of
to the Prog
string
at
the
the
into
RAM.
byte
in
AT
of
conclusion
s a ll
in
color
execution
or
variable
ram Rec
equivalent
ASC
II
cod
an
expres-
of
string
graphi
on
encounter-
or
expre
ord
er for
e.
I/0
s;
cs
the
s-
Ap
pendix
A-1

RESERVED
WORD:
DATA
ABBREVIATION:
D.
Part
ofREAD/DATA
succeeding
individual
as
BRIEF
OF
items
data
BASIC
combination.
(which
items.
SUMMARY
STATEMENT
be
separated
Used
must
to
identify
by
the
commas)
DEG
DIM
DOS
DRAWTO
END
ENTER
EXP
FOR
FRE
DE.
DI.
DO.
DR.
E.
F.
Statement
trigonometric
(Default
Reserves
array,
must
be
Reserved
be
displayed.
DEG
functions
in
radians.)
the
specified
or
string.
dimensioned
word
for
(See
Draws a straight
specified
Stops
Program
may
I/0
tokenized
Function
point.
program
may
be
used
command
(source)
returns
execution; closes files;
be
more
used
power.
Used
with
troduces
during
Function
memory
NEXT
the
range
the
execution
returns
(in bytes).
tells
computer
in
degrees
amount
All
string
variables,
with a DIM
disk
operators.
DOS
Manual.)
line
between a plotted
restarted
than
to
using
once
store
form.
e (2.7182818)
to
establish
that
the
loop
of
loop.
the
amount
to
instead
of
memory
arrays,
statement.
Causes
turns
CONT. (Note:
in a program.)
data
or
programs
raised
to
FOR/NEXT
variable
of
remaining
will
perform
of
for
matrices
the
point
off
the
specified
loops. In-
operate
radians.
matrix,
menu
and
sounds.
END
in
un-
user
to
in
GET
GOSUB
GOTO
GRAPHICS
.
INPUT
INT
LEN
A-2
Appendix
IF
GE.
GOS.
G.
GR.
I.
Used
mostly
of
data.
Branch
with
to a
subroutine
number.
Unconditional
Specifies
used. GR.O
Used
another
pression
Causes
ecution
inputting
Function
the
even
String
ing
which
may
to
cause conditional
statement
is
true).
computer
continues
data.
returns
specified value.
when
number
function
in
bytes
or
disk
branch
of
be
on
to
only
the
to
the
used
the
ask
when
next
Rounding
is negative.
returns
characters
operations
beginning
a specified
eight
graphics
to
clear
branching
same
line (only
for
input
i;i§ii@l
lowest
the
length
(1
byte
to
input
at
line
the
number.
modes
a single
specified
byte
line
is to
screen.
or
to
execute
ifthe
first ex-
from
keyboard.
key
is
whole
is
always
of
integer
the
pressed
specified
downward,
after
below
contains 1 character).
be
Ex-
str-

RESERVED
WORD:
ABBREVIATION:
BRIEF
OF
BASIC
SUMMARY
STATEMENT
LET
LIST
LOAD
LOCATE
LOG
LPRINT
NEW
NEXT
NOT
NOTE
ON
LE.
L.
LO.
LOC.
LP.
N.
NO.
Assigns a value
tional
in
Atari
BASIC,
Display
Input
or
from
otherwise
disk,
Graphics: Stores,
controls
Function
Command
Erases all
Causes a
defending
Al
A "
it is
See DOSIFMS
Used
Multiple
depending
loops
1"
is
true,
with
a specified
returns
to
line
contents
FOR/NEXT
on
the
are
executed
returned
a
"0"
Manual
GOTO
branches
on
the
sion.
to
a specific
output
etc.
into
in
a specified
graphics
the
natural
printer
of
particular
only
is
returned.
...
or
to
different
value
and
may
the
to
print
user
RAM.
loop
at
least
if
the
used
only
GOSUB
of
the
variable
be
simply
the
program
computer.
variable,
point.
logarithm
the
specified message.
to
terminate
variables
once
.
expression
in
disk
for
branching
line
numbers
ON
variable
name.
LET is op-
omitted.
list.
the
value
of a number.
or
continue
or
expressions.
is NOT
operations.
purposes.
are
possible
or
that
true.
expres-
If
OPEN
OR
PADDLE
PEEK
PLOT
POINT
POKE
POP
POSITION
PRINT
POK.
POS.
PR.
o.
PL.
P.
or?
Opens
the
Logical
either
one
if
both
are
Function
Function
memory
Causes a
specified.
Used
with
Insert
the
tion
. May
ROM
or
Removes
when
departure
normal
Sets
the
I/0
command
specified
specified file for
operator
is
true,
used
a
"1"
false.
returns
returns
position
decimal
location (RAM
single
point
disk
operations
specified
be
you'll
the
byte
used
only
get
an
loop variable
from
manner.
cursor
to
the
causes
output
device.
input
between
is evaluated. A
of
the
paddle
form
or
ROM).
to
be
plotted
only.
into
the
with
RAM.
error.
from
the
loop is
specified
output
screen
from
of
output
two
of
contents
at
specified
Don't
the
GOSUB stack. Used
made
operations.
expressions.
"0
'
results
game
controller.
of
specified
the
X, Y location
memory
try
to
in
other
position.
the
computer
only
loca-
POKE
than
to
the
If
Appendix
A-3

RESERVED
WORD:
ABBREVIATION:
BRIEF
OF
BASIC
SUMMARY
STATEMENT
PTRIG
PUT
RAD
READ
REM
RESTORE
RETURN
RND
RUN
SAVE
R.
PU.
REA.
or
RES.
RET.
RU.
•
lffilS'J
s.
Function
returns
controllers.
Causes
to
Specifies
degrees
output
the
specified device.
that
when
Default is to
the
Read
specified
Remarks.
may
reference
starts
Allows
RETURN
ly
following
Function
but
Execute
dims
I/0
disk
next
variables.
This
be
printed
by
with
DATA
from
returns a random
never
the
arrays
statement
under
of a single
information
RAD.
items
statement
the
REM
to
subroutine
the
1.
program.
and
causes
filespec
status
of
the
byte
using
the
(See DEG.)
in
the
does
within
the
programmer.
are
not
executed.
be
read
more
to
one
in
which
Sets
string.
data
or
provided
of
is
trigger
data
in
button
from
radians
trigonometric
DATA
list
nothing,
program
Statements
than
once.
the
statement
GOSUB
number
normal
program
with
between 0 and
variables
to
SAVE.
on
the
computer
rather
functions.
and
assign
but
comments
list
for
on a line
immediate-
appeared.
to
be
recorded
game
than
to
future
that
0,
un-
on
1,
SETCOLOR
SGN
SIN
SOUND
SQR
STATUS
STEP
STICK
STRIG
STOP
A-4
Appendix
SE.
so.
ST.
STO.
Store
hue
register.
Function
negative.
Function
(DEG
or
Controls
a
tone
or
Function
status
Calls
Used
with
skipped
Function
Function
if
pressed.
Causes
off
execution
sounds.
and
luminance
returns
returns
RAD).
register,
sound
note.
returns
the
routine
FOR/NEXT.
between
returns
each
position
returns 1 if
to stop,
color
+ 1
if
value
trigonometric
pitch,
square
for
root
specified
Determines
pair
of
of
stick
stick
trigger
but
data
in a particular
is
positive, 0 if
sine
distortion,
of
the
device.
loop
variable
game
button
does
not
zero,
of
given
and
volume
specified
quality
values.
controller.
not
pressed,
close files
color
- 1
value
value.
to
or
turn
if
of
be
0

RESERVED
WORD:
ABBREVIATION:
BRIEF
OF
BASIC
SUMMARY
STATEMENT
STR$
THEN
TO
TRAP
USR
VAL
XIO
T.
X.
Function
value
returns a character
given. For example:
string.
Used
with
statements
trol
passes
Used
loop
Takes
and
directs
Function
with
range
control
are
to
FOR
expressions.
execution
returns
subroutine.
Function
returns
string.
General I/0
DOSIFMS
Manual)
IF:
If
executed.
next
line.
as
in
of
program
results
the
statement
and
string
STR$(65)
expression
If
the
"FOR X = 1
in
to
case
a specified
of a machine-language
equivalent
used
with
in
graphics
equal
returns
is
true,
expression
TO
10".
of
an
line
number.
numeric
disk
operations
work
to
numeric
65
the
THEN
is false, con-
Separates
INPUT
error
value
(Fill).
as a
the
of
(see
a
App
endix
A-5

ERROR
CODE
NO.
ERROR
CODE
MESSAGE
APPENDIX
ERROR
MESSAGES
B
2
3
4
5
6
7
8
9
10
Memory
new
string
Value
pected
Too
(See
String
Out
DATA
Number
32767.
Input
numeric
Array
reference
has
array
Argument
sion.
Error: A value
to
Many
Variable
Length
of
Data
statement(s).
Statement
variable.
or
been
already
or
string.
insufficient
variable.
be
within
Variables: A maximum
Name
Error:
Error: READ
greater
String
is
out
of
Stack
to
expected
a specific
Limit.)
Attempted
than
32767:
Error:
DIM
Error:
the
range
DIMensi
Overflow:
store
range
statement
Attempted
of
oned,
the
statement
to
be a positive
is
not.
of
128
to
store
requires
Value
is
not a positive
to
DIM
size
is
the
dimensioned
or a reference
There
are
too
or
the
new
variable
integer
different
beyond
greater
the
more
INPUT a non-numeric
than
size, or
has
been
many
GOSUBs
is
negative, a value
variable
DIMensioned s
data
items
integer
32767
or
the
array/matrix
made
to
or
too
name
or
to
names
or
an
is
allowed.
tring
than
supplied
is
greater
value
an
array/martix
or
undimensioned
large
an
DIM a
ex-
length.
by
than
into
string
expres-
a
11
12
13
14
15
Floating
refer
to a number
Line
Not
number
No
Matching
FOR,
or
the
NEXT
Line
Too
handle.
GOSUB
and
the
Point
Overflow/Underflow
larger
Found:
.
nested
statement,
Long
or
FOR
corresponding
A GOSUB, GOTO,
FOR
FOR/NEXT
Error:
Line
than
1 x
Statement:
statements
not
at
FOR).
The
statement
Deleted:
FOR
or
96
10
A NEXT
A NEXT
GOSUB
or
or
do
has
Error:
smaller
THEN
was
not
match
is
too
or
RETURN
been
Attempted
than
referenced a non-existent
encountered
properly.
complex
deleted
to
1 x
statement
99
10-
without a previous
(Error
or
too
since
the
divide
•
long
was
last RUN.
by
zero
line
is
reported
for
BASIC
encountered
App
endix
or
at
to
B-1

ERROR
CODE
NO.
ERROR
CODE
MESSAGE
16
17
18
Note:
19
20
21
128
129
130
RETURN
Garbage
code
POKE.
any
Invalid
in
VAL
The
drives,
vided
LOAD
Device
LOAD
BREAK
IOCB
Nonexistent
Error:
Error:
may
indicate a hardware
Try
POKE
String
statement
following
printers,
with
program
Number
File
Abort:
1
already
A RETURN
Execution
typing
NEW
commands.
Character:
is
are
INPUT
or
the
auxiliary
Too
Larger
Error:
Attempted
User
open.
Device
was
of"garbage"
problem,
or
powering
String
not a numeric
/OUTPUT
other
Long:
accessory
hardware.
Insufficient
than 7 or
to LOAD a non-LOAD file.
hit
M,!;@M
key
specified.
encountered
(bad RAM bits)
but
may
down,
does
not
start
string.
errors
devices.
memory
Equal
to 0.
during
without a matching
was
attempted.
also
be
the
result
then
re-enter
the
with a valid
that
I/0
operation.
result
Further
remains
during
information
to
GOSUB.
of
faulty
program
character,
the
use
complete
This
use
without
or
string
of
is
LOAD.
error
of
disk
pro-
131
132
133
134
135
136
137
138
139
140
141
142
1
IOCB
refers
IOCB
Invalid
Device
Bad
IOCB
EOF:
using
Truncated
Device
Device
Serial
Cursor
Serial
to
Input/Output
Write
IOCB
Read
End
Only.
Command:
or
File
Number:
Only
of
File
cassette files.)
Record:
Timeout.
NAK:
Garbage
bus
input
out
of
range
bus
data
Control
READ
The
command
not
Open:
Illegal
Error: WRITE
read
has
Attempt
Device
doesn't
at
framing
for
particular
frame
overrun.
Block.
command
to a
is
invalid
write-only
No OPEN specified
device
number.
command
been
reached.
to
read a record
(NOTE:
respond.
serial
port
or
bad
error.
mode.
The
device
number
for
for
to a
longer
disk
is
device
this
device.
the
device.
read-only
This
message
than
drive.
the
same
(Printer).
device.
may
256
characters.
as
the
IOCB
occur
number.
when
B-2
Appendix

ERROR
CODE
NO.
ERROR
CODE
MESSAGE
143
144
145
146
147
160
161
162
163
164
165
166
167
168
Serial
Read
Function
bus
Device
diskette.
after
data
done
write
not
Insufficient
Drive
Too
Disk
number
many
full
OPEN
(no
Unrecoverable
File
number
File
name
error.
POINT
File
Command
data
locked.
invalid
frame
error
(invalid "done"
compare
implemented
RAM
for
operating
error.
files
free
sectors).
system
mismatch:
length
error.
(special
checksum
error
in
(no
sector
data
I/0
Links
operation
error.
byte):
(disk
handler.
selected
buffer
error.
on
disk
code).
Attempt
handler)
graphics
available).
are
messed up.
to
or
bad
mode.
write
on a write-protected
screen
mode
handler.
169
170
171
Directory
File
not
POINT
full
found.
invalid.
(64 files).
Append£);
B-3

APPENDIX
C
o+..~~
~v'-'o
~
0 0
1
2
3
~v~~
~;]"
~
0~
""
1
2
3
~
v
~~
"-~~
~"
c
G
11
g
AT
CHARACTER
~ ~
0~
~v~~
~0
~+
0
F
v
~~
~
13
~
14
15
16
D
E
10
~~
~6
,.
~
rl
g
~~
26
27
28
29
o+
~v~~
+~'-'"
1A
1B
1C
1D
ASCII
SET
"-~~
~"
~
(,~
£1
~
0
0
4
5
6
7
8
9
10
11
12
4
5
6
7
8
9
A
B
c
g
1:1
~
~
~
lfl
~
~
a
17
18
19
20
21
22
23
24
25
11
12
13
14
15
16
17
18
19
~
=
c
c
~
(I
~
Q
(]
30
31 1F
32 20
33
34
35 23
36
37
38
1E
21
22
24
25
26
Cl
=
Space
"
#
$
sPa
Appendix C·1

~
+t"
~-VJ
"~
0$'
~~
t--v
o~~v
~-VJ
"~
~~
&
t"
"'~~
~C>
~"~
~~
~
&~
~-VJ
~v
()
#
"'~~
~"
+t"
~~
~
~
~~~~
"~
~~
~6
t"
"~
39
40
41
42
43
44
45
46
47
27
28
29
2A
2B
2C
2D
2E
2F
I
(
*
+
-:
55
56
57
58
59
60
61 3D
62
63
37
38
39
3A
3B
3C
3E
3F
7
8
9
<
-
>
71
72
73
74
75
76
77
78
?
79
47
48
49
4A
4B
4C
4D M
4E N
4F
G
H
J
K
L
0
I
C-2
48
49
50
51
52
53
54
Appendix
30
31
32
33
34
35
36
0
1 65
2
3
4
5 69
6
64
66
67
68
70
40
41
42
43
44
45
46
@
A
B
c
D
E
F
80
81
82
83
84
85
86
50
51
52 R
53 s
54 T
55
56 v
p
Q
u

87 57 w
103
67
g
119
77
w
88
89 59
90
91
92
93
94
95
96
58 X 104
5A
5B
5C
5D
5E
5F
60
y
z
[
\
J
A
D
105
106
107
108
109
110
111
112
68
69
6A
6B
6C
6D
6E n 126
6F
70
h
i
j
k
1
m 125
0 127
p
120
121
122
123
124
128
78
79
7A
7B
7C
7D
7E
7F
80
X
y
z
D
IJ
[)
ll
97
98 62
99
100 64 d
101
102
61
b 114
63
65
66
a
c
e
f
113
115
116
117
118
71
72 r
73
74
75
76
q
u
v
129
130
s
t
131
132
133
134
81
82
83
84
85
86
Appendix
C-3

v
\}~
~~~~
"'~~
~"
~~
(;
~
o-+
~~~~
0~
~~vo
+~vo
~~
~~~
.~'"
'-'~
~
o"+..~~
~~\.Jo
+~vo
~~
o-+
~~~~
~'V
~~
~'-'~
~
~
~
~"+..~~
~
vo
s.>~'-'0
~
135 87
136 88
137
138
139
140
141
142
143
89
BA
BB
BC
BD
BE
BF
151
152 98
153
154
155
156
157
158
159 9F
97
99
9A
9B
9C
9D
9E
(EOL)
lm!ml
[t]
[!]
~
[±]
167
168
169
170
171
172
173
174
175
A7
AB
A9
AA
AB
AC
AD
AE
AF
144 90
145
146 92
147
148 94
149 95
150 96
C-4
Appendix
91
93
160
161
162
163
164
165
166
AO
A1
A2
A3
A4
A5
A6
176
177
178
179
180
181
182
BO
B1
B2
B3
B4
B5
B6

~
\>
¢~
~~~v
o~v
~~"o
+~vo
~v
~v~
~c
~
"~
~\.>
~~v
0
~~o~
~v
:V
~
~"~
&
~~
6
~~
+~vo
~v
~
~
~v~v
~~
~6
~
"~
183
184
185
186
187
188
189
190
191
B7
BB
B9
BA
BB
BC
BD
BE
BF
199
200
201
202
203
2
04
205
206
207
C7
CB
C9
CA
CB
cc
CD
CE
CF
215
216
217
218
219
220
221
222
223
D7
DB
D9
DA
DB
DC
DD
DE
DF
192
193
194
195
196
197
198
co
C1
C2
C3
C4
C5
C6
208
209
210
211
212
213
214
DO
D1
D2
D3
D4
D5
D6
224
22
5
226
227
228
22
9
230
EO
E1
E2
E3
E4
E5
E6
Append
ix
C-5

~
o-+
~
'->~~v
~~'->c
~~~v
+~'->c
~v
(>~
~~
6
~
~
o"+.~v
~~'->c
+~
~v
o-+
~~~v
'->c
~
&
~v~
~'->
~
~
o'+..~v
~~'->c
+~
~v
o-+
~~~v
'->c
~
~v~
~'->
~
'->~
231
232
233
234
235
236
237
238
239
E7
E8
E9
EA
EB
EC
ED
EE
EF
240
241
242
243
244
245
246
247
248
FO
F1
F2
F3
F4
F5
F6
F7
F8
249
250
251
252
253
254
255
F9
FA
FB
FC
FD
FE
FF
1
....
1
[I]
[I]
(Buzzer)
(Delete
character)
(Insert
character)
See
Appendix H for a user
Notes:
1. ATASCII
some
2.
Except
Add
3.
4.
To
character,
On
5.
bols
are
C-6
Appendix
stands
of
the
special
as
shown,
32
to
upper
get
ATASCII code, tell
or
number
pages
C-1
on a black
shown
as
for
"ATARI
characters
characters
case code
and
C-3,
background;
black
on a white
program
ASCII".
from
to
computer
of
code. Must
the
normal
that
performs
Letters
are
different.
128-255
get
lower
(direct
use
display
on
pages
background.
and
are
case code
mode)
the
quotes!
keycaps
C-4
and
decimal/hexadecimal
numbers
reverse
for
are
C-6
inverse
colors
same
to
shown
have
letter.
PRINT
keycap
the
of 1 to
ASC
as
white
conversion.
same
values
127.
("
___
sym-
symbols
as
") Fill
those
blank
in
with
ASCII,
letter,
but

APPENDIX
D
Decimal
65535
57344
57343
55296
55295
53248
532
47
49152
49151
40960
ADDRESS
Hexadecimal
FFFF
EOOO
DFFF
D800
D7FF
DODO
CFFF
cooo
BFFF
AOOO
CONTENTS
OPERATING
LOATING
F
HARDWARE
NOT
CARTRIDGE
(may
USED
be
RAM
POINT
ATARI
MEMORY
SYSTEM ROM
ROM
REGISTERS
SLOT
A
if
no A or B cartridge)
400/800
MAP
40959
32768
32767
31755
10880
10879
9856
9855
4864
9FFF
8000
7FFF
7CIF
2A80
2A7F
2680
267F
1300
CARTRIDGE
(may
be
RAM
if
(7FFF
DISPLAY
DISPLAY LIST
(7C1F
FREE
(size
BASIC
(2A80
DISK
DISK
DISK
32K
DATA
if
32K
RAM
varies)
program,
if
DOS, may vary)
OPERATING
I/0
BUFFERS
OPERATING
SLOT B
if
no
system
(size
(size
system
buffers,
B
cartridg~
)
varies)
varies)
, (GRAPHICS
~BASIC
tables, run-time
SYSTEM
(current
SYSTEM
DOS)
RAM
RAMTOP
~
I
OS
(2A7F-700)
(current DOS)
(MSB)
MEMTOP
MEMTO
stack.
l
I
P I
Appendix
D-1

Decimal
ADDRESS
CONTENTS
Hexadecimal
4863
1792
1791
1536
1535
1406
1405
1152
1151 47F
1021
1020
1000
999
960
959
832
831
512
511
256
12FF
700
6FF
600
5FF
57E
57D
480
3FD
3FC
3E8
3E7
3CO
3BF
340
33F
200
1FF
100
MANAGEMENT
FILE
FREE RAM
FLOATING
BASIC CARTRIDGE
]
OPERATING
CASSETTE BUFFER
RESERVED
PRINTER BUFFER
IOCB's
J
MISCELLANEOUS OS VARIABLES
J
HARDWARE
POINT
SYSTEM
STACK
SYSTEM RAM
(used
by
RAM
BASIC)
(47F-200)
(current
DOS)
255
212
211
210
209
208
207
203
202
176
128
127
0
As
the
amount
in
Appendix
D-2
Appendix
addresses
of
memory,
I.
for
the
these
FF
D4
D3
D2
D1
DO
CF
CB
CA
BO
80
7F
0
top
of
addresses
RAM, OS,
are
and
BASIC
indicated
PAGE
FLOATING
BASIC
FREE BASIC RAM
FREE BASIC
FREE ASSEMBLER
ASSEMBLER ZERO
OPERATING SYSTEM RAM
and
by
ZERO
or
the
pointers.
POINT
CARTRIDGE PROGRAM
ends
The
(used
AND
ASSEMBLER RAM
RAM
PAGE
of
OS
and
pointer
by
BASIC)
}
ZERO
BASIC
addresses
BASIC
vary
for
PAGE
according
each
are
to
the
defined

APPENDIX
DERIVED
FUNCTIONS
E
Derived
Functions
Secant
Cosecant
Inverse
Inverse
Inverse
Inverse
Inverse
Sine
Cosine
Secant
Cosecant
Cotangent
Hyperbolic
Hyperbolic
Hyperbolic
Hyperbolic
perbolic
Hy
Hyperbolic
Inverse
Inverse
Inverse
Inv
Inverse
Inverse
Hyperbolic
Hyperbolic
Hyperbolic
er se Hy
Hyperbolic
Hyperbolic
Sine
Cosine
Tangent
Secant
Cosecant
Cotangent
per
bolic Sec
Sine
Cosine
Tangent
ant
Cosecant
Cotangent
Derived
SEC(X)"' 1/COS(X)
CSC(X)"' 1/SIN(X)
ARCSIN(X)
ARCCOS(X)"'
ARSEC(X)
ARCCSC(X)
ARCCOT(X)
SINH(X)"' (EXP(X)-EXP(-X))/2
COSH(X) "'(EXP(X) + EXP(-X))/2
TANH(X),-EXP(-X)/(EXP{X)
SECH(X) = 2/ (EXP(X) + EXP(-
CSCH(X) = 2/(EXP(X)-EXP(-X))
COTH(X) = EXP(-X)/(EXP(X)-EXP(-X)}* 2 + 1
ARCSINH(X)
ARCCOSH(X) + LOG(X + SQR(X * X-1))
ARCTANH(X)
ARCSECH(X) =LOG((SQR(-
ARCCSCH(X) "'LOG((SGN(X) * SQR(X
ARCCOTH(X) = LOG((X + 1)/(X-1))/2
Functions
"'A
TN(X/SQR( -X*
-A
"'ATN{SQR(X
"'A
TN(1
"'A
=LOG(
"'LOG((1 + X)/(1-X))/2
in
TN(X/SQR(-
* X-1)) + (SGN(X-1) *
/SQR(X * X-1)) + (SGN(X-1)
TN(X)
+CONSTANT
X+
SQR(X
Terms
X+
X*
+EXP(-X))
X))
*X+ 1 ))
X*
X+
of
Atari
1))
X+
1)
+CONSTANT
*2
1) + 1)/X)
*X+
Functions
CONSTANT
*CONSTANT
+ 1
1) + 1)/X)
Notes:
1.
If
If
In
2.
derived
expression
in
in
this
RAD
DEG
(default)
mode,
chart, the
function
to
be evaluated.
mode,
constant
constant
= 90.
variable X in
. Obviously,
= 1.57079633
parentheses
any
variable
represents
name
is
the
value
permissible,
or
expression
as
long
as
it
to
be
represents
evaluated
the
number
App
endix
by
the
or
E-1

The
cursor
statement
special
symbols
and
by
screen
pressing
which
OF CONTROL CHARACTERS
control
the
are
characters
IB
shown
PRESS
can
key before
below
to
PRESS
entering
be
• •
be
placed
displayed.
APPENDIX
PRINTED VERSIONS
in
a s
tring
the
character
(Refer
to
SEE
in a program
from
Section 1 -
THIS
the
keyboard.
IB
or
used
Key.)
as a Direct
This
causes
mode
F
the
OR
•
•
PRESS
•
•
•
•
•
•
•
•
•
PRESS
•
HOLD
El
El
El
El
El
El
El
•
AND
PRESS
•
•
•
•
•
•
•
•
•
•
•
•
•
El
El
•
•
•
•
Appendix
F·l

AlphanuDieric:
Array:
The
alphabetic
punctuation
A list
of
numerical
preceded
variable,
variable
by a DIM
and
names.
letters
marks
its
individual
A-Z,
the
or
graphics
values
statement.
stored
elements
APPENDIX G
GLOSSARY
numbers
symbols).
May
in
a series
be
referred
are
0-9,
and
referred
some
of
memory
to
by
to
symbols.
use
of
by
subscripted
(No
locations
an
array
AT
ASCII:
BASIC:
Binary:
Bit:
Branch:
Bug:
Byte:
Stands
change.
High level
purpose
capital letters. Developed
College
A
are 0 and
false,
Short
false,
possibility concept. A
computer
Atari
ecution
gram
line
quence
A
Usually
11111111
an
for
Atari
programming
Symbolic
in
1963.
number
mistake
A TASCH
system
1,
which
on
and
off, etc.
for
Binary
whether a circuit
can
work.
BASIC
executes a program
sequence
can
be
told
earlier
in
the
is called
or
error
eight
bits
in
binary
character
American
Intruction
using
may
Digit. A
bit
can
be
to
skip
program.
"branching".
usually
(enough
notation). A
or a number
Standard
language.
Code.
BASIC
by
Mssrs.
Kemeny
the
base
two.
be
used
in a computer
bit
can
be
thought
is
on
or
off,
is
the
smallest
in
altered
over a certain
This
in
the
to
represent
byte
by
contrived
program
in
Code
Acronym
is
Thus
of
or
unit
order
of
the
programmer,
number
the
of
data
the
range
for
Information
for
always
and
Kurtz
the
only
to
represent
as
representing
any
other
of
data
line
of
lines
change
or
"software"
decimal
can
be
ofO
Beginner's
written
at
Dartmouth
possible
type
with
numbers.
and
or
return
in
execution
number
used
to
to 255.
Inter-
All-
using
digits
true
and
true
of
two-
which
This
ex-
the
pro-
to
.
255
represent
ali
or
a
a
se-
or
Central
Unit
Code:
Con1mand:
Processing
(CPU):
In
microcomputers
microprocessors
any
computer
CPU
or
(in
Atari's
Instructions
An
instruction
example
that
MPU is usually
case a 6502
written
is
the
such
or
MPU.
controlled
in a language
to
the
computer
BASIC
as
the
Atari
At
one
time,
the
memory
found
on
a single
microprocessor
understood
that
command
RUN. (See
systems,
the
integrated
chip).
is
executed
these
are
CPU
was
that
and
peripherals.
circuit
by a computer.
immediately. A good
Statement.)
Appendix
also called
portion
or
Now
"chip"
of
the
G-1

Computer:
Concatenation:
Any
device
manipulate
may
be
varied
computer
ty
to
manipulate
handle
The
longer
numbers.
process
string.
that
can
receive
information.
from
Both
moment
and a programmable
text
as
well
of
joining
two
and
the
instructions
to
moment.
calculator
as
numbers.
or
more
then
The
lies
Most
strings
follow
and
distinction
in
the
computer's
calculators
together
instructions
the
information
between
can
to
form
to
a
abili-
only
one
Control
CRT:
Cursor:
Data:
Debug:
Default:
Digital:
Diskette:
Characters:
Characters
produced
simultaneously
Abbreviation
practice,
display
A
typed
Information
The
square
character
process
this
computer
displayed
of
of
gram.
A
mode
or
condition
something
unless
Information
all
modern
else.
told
to
computers,
that
proach.
A
small
disk. A record/playback
shape
of a flat
The
advantage
storage
The
drive
are
is
that
Atari
800
peripherals
used
interchangeably.
by
pressing
for
"cathrode
is
often
used
output.
on
will
be
any
kind.
locating
"assumed"
For
example,
use
other
can
be
disk
that
of
the
disk
access to
Personal
simultaneously.
holding
another
ray
tube"
to
describe
Also
called a "monitor"
the
TV
monitor
displayed.
and
correcting
by
it
will "default" to
I/0 devices.
represented
especially
is
placed
inside a stiff
over
any
part
Computer
down
the
key
key.
(the
tube
the
television
that
shows
mistakes
the
computer
by
a collection
microcomputers,
medium
like
tape,
envelope
cassette
of
System
In
the
this
or
other
disk
can
manual,
is
virtually
control
labeled
used
receiver
.
where
and
until
screen
ofbits.
use
but
tape
disk
&mJ
in a TV
the
errors
in a pro-
it
is
told
and
keyboard
Virtually
the
digital
made
for
protection.
for
memory
immediate.
up
to 4 diskette
and
while
set).
In
used
to
next
to
do
ap-
in
the
diskette
DOS:
Editing:
Execute:
Expression:
Format:
Hard
Copy:
G-.2
Appendix
Abbreviation
grams
which
either
"dee
Making
To
portion
A
that
string
To
Printed
corrections
do
what a command
thereof.
combination
can
be
or a number.
specify
the
output
for "disk
facilitate
oh
ess"
of
variables,
evaluated
form
as
opposed
operating
use
of a disk-drive
or
"doss
or
changes
or
to a single
in
which
system".
" .
in a program
program
specifies.
numbers, and
quantity. The
something
to
temporary
The
software
system.
or
DOS is
data.
To RUN a program
operators
quantity
is
to
appear.
TV
monitor
or
pronounced
Oike
+,
may
display
.
-,
pro-
etc
be
or
.)
a

HardW"are:
The
physical
apparatus and
electronics
that
make
up a computer.
Increment:
Initialize:
Input:
Interactive:
Interface:
IOCB
I/0:
K:
KeyW"ord:
Increase
in
Set
variables
ray
in
counting
to
an
are
and
string
initial
Information
away
from
always
A
or
The
in
system
two
. All
electronics
relation
that
Input/Output
Operating
System
tion.
Short
monitor,
Stands
for
A
puter
the
for
imately)
the
word
language,
beginning
program
for
"kilo"
1000
Keyboard.
that
value
(usually)
the
number
or
starting
initialized
elements
transfer
the
to
computer.
to
the
responds
personal
Control
used
the
computer
to
Block. A
information
input/output,
recorder,
meaning
bytes
. (Actually
has
meaning
and
thus
of a variable
by
adding
of
repetitions through
value.
to
zero
when
are
not
initialized.
the
computer.
In
this
computer.
quickly
to
the
systems
allow
two
devices
block
it
I/0
devices
printer,
"times
as
must
1000".
1024
bytes.)
an
instruction
not
be
name.
one.
Used a lot
In
Atari
the
command
Output
manual,
user,
are
to
of
data
needs
to
include
and
disk
Thus
Also,
used
for
counting
a loop).
BASIC, all
RUN
is
is
information
input
and
usually
within a second
interactive.
communicate.
in
RAM
that
know
for
an
the
keyboard,
drives.
1 KByte is (approx-
the
device
or
command
as a
variable
non-array
given.
transfer
output
tells
I/0
opera-
type
code
in a com-
name
or
(as
Ar-
are
the
TV
at
Language:
Memory:
Menu:
Microcomputer:
Monitor:
Null
String:
OS:
Output:
Parallel:
Peripheral:
A set
of
conventions
The
part
of a computer
formation.
A list
of
options
A
computer
The
television
A
string
consisting
Abbreviation
programs
"oh
See
Two
for
same
An
to
ess".
1/0.
or
more
example,
time.
I/0
device. See
specifying
(usually
from
which
based
on a microprocessor
receiver
for
aid
things
used
of
no
Operating
the
user
happening
characters
controls a number
Opposite
1/0
of
.
serial.
how
to
tell a computer
RAM
or
ROM)
the
user
may
choose.
chip;
to
display
System.
in
controlling
computer
what
ever.
This
the
is
actually
computer.
simultaneously. A parallel
of
distinct
electrical
that
in
Atari's
stores
output.
a collection
signals
Appendix G-3
what
to
do.
data
or
in-
case,
the
6502.
Pronounced
interface,
at
the
of

Pixel:
Precedence:
Program:
Prompt:
Picture
Element.
graphics
Rules
that
especially
A
sequence
be
in
the
A
symbol
puter
is
ready
form
of
enter
(input)
mode
determine
with
of
instructions
language
that
to accept
the
word
information
One
point
being
used.
the
regard
that
appears
"READY". A
on
the
priority
to
the
the
on
the
keyboard
or
in
arithmetical/logical
that
describes
particular
monitor
input.
"?"
take
other
screen
which
a process. A
computer
screen
In
is also
appropriate
display. Size
operations
operators.
can
that
indicates
Atari
BASIC,
used
to
prompt a user
action.
depends
are
conducted,
program
understand.
the
this
takes
on
must
com-
the
to
RAM:
Random
Generator:
Reserved
ROM:
Save:
Screen:
Serial:
Software:
Special
Character:
Number
Word:
Random
RAM is
May
ber
making
See
Read
Access
used
be
hardware
whose
in
Keyword.
Only
formation
the
user.
Programs
tridges
To
ample,
The
The
quence.
As
A
ter
So
used
copy a program
diskette
TV
screen.
opposite
Example: A serial
opposed
character
nor a numeral.
are
punctuation
Memory.
to
store
value
is difficult to
game
programs,
Memory.
is
stored
with
or
In
of
parallel.
to
Hardware.
that
can
both
(as is
In
by
the
such
the
Atari
or
data
tape).
Atari
be
The
marks,
The
programs
Atari's)
predict.
etc.
this
type
manufacturer
as
the
systems
into
some
BASIC, a
Things
interface.
Refers to
displayed
Atari
graphics
etc.
main
memory
and
data.
or a program
Used
of
solid-state
and
BASIC
interpreter
use
ROM.
location
particular
happening
programs
by a computer
symbols
in
most
that
primarily
electronic
it
cannot
other
than
I/O
device
only
one
and
data.
but
are
special
computers.
provides a num-
for
decision-
memory,
be
changed
and
other
inby
car-
RAM (for ex-
codes "S:"
at a
time
in
se-
is
neither
a let-
characters.
Statement:
String:
Subroutine:
Variable:
Window:
G-4
Appendix
An
instruction
mands
may
to
the
be
considered
computer.
commands. A statement
keyword,
A
sequence
in a string
A
part
(GOSUB)
of a whole
A
variable
stored.
A
portion
graphics
the
value
of
letters,
variable.
of a program
in
BASIC:
This
program.
may
be
Such values
of
the
TV
or
text.
to
be
numerals,
The
that
The
thought
are
display
statements,
contains
operated
string
variable's
can
be
effectively
subroutine
of
as a
typically
devoted
See also
and
all
a line
on,
other
Command.
statements
number
and
characters.
name
executed
gives a single
is a
very
box
in
numbers
and
to a specific
the
l;lilllh!ll
by
statement
powerful
which
strings.
While
are
(deferred
command.
May
must
end
a special
a value
purpose
all com-
certainly
mode), a
be
stored
with
statement
the
power
construct.
may
such
as for
not
a$.
be

CHECKBOOK
BALANCER
This
appendix
capabilities
a Decimal/Hexadecimal
quire
this
This
is
one
writes.
cleared
It
checks
10
0 ) I
0 I
t1SG3$(
of
the
type
of
allows
t1
A$(
contains
Atari
of
conversion.
the
"traditional"
entry
and
credited
30 ) 1
30
) I t·
1SG4$(
0)
2e
OUTSTAt-10=0
30
GRAPHICS
CER"
=?
40 ? "Y•:•u
me
b~
II
50
t·1SGU="OLO
ma~i
enter·
0:? : .,
in~
"
60
t1SG2:f.=110LO
II
70
t1SG3$=
II
80
t1SG4$=110LD
II
90
t-1SG5$:::
II
100
t·1SG6$=
II
150
TRAP
r·Ot).,
f
160
TRAP
fr·c•tn
165
TRAP
170
GOTO
100
CLOSE
11
AL.
185 ? "PLEA:;£
190
PEF.:r·1=0
200
?
on
210
IF
"OLD
"t·B·J
11
1'--EW
1:.0
~our·
160:
~our·
bankst.atelitent
40000
190
#1
"Would
the
.=·r
inter·"; :
LHKA$)=0
=?
·"?
:?
~ou
programs
Personal
program
of
outstanding
t1SG$(
lftake
a
ne~a
CHECK
and
Computer
for
programs
deposits.
4~) ) ~
t·1SG 1 $(
30
) ·'
t·1SG5$(
11
cor·r·
ections
1
t.l
.)e
--
~;TILL
routines
those
checks
CHECKBOOK
do
DEPO:::IT --t·iOT
CHECK --.JU::;T
C:LEAF.:ED
DEP0:3IT --JU3T
CHECK
check
CHECK
(OR
DEPOSIT
"Enter·
be9innin9
bo•Jk
"Enter·
"FRit-H~
be9innire
CONNECTORS
1
ike
a Per·
INPIJf
THEN
200
<
11
11
:
SEf.~t.)
OR
.: : I
.: :
IS
A$
ICE
INTEREST
HPUT
WPUT
NOT
manent.
APPENDIX
PROGRAMS
that
demonstrate
System.
users
that
30 )
30 )
1 1
OUT::;TAt·[lWG
CREDITED
CREDITED
. "
Included
who
every
and
uncredited
..
t·1SG2$(
·'
t1SG6$(
BALAt·~
at.
arr:::~
ar·
•,.•a 1 ue
CHAPGE)
)
ba h.nce
'/OUF.:BAL
ba h.na:e
BAt·~KE:AL
OPERATIOt~
r·ecor·d
in
write
beginning
3
3
t.i
.
this
programs
deposits
H
USER
the
diverse
appendix
computerist
as
that
well
is
re-
as
Appendix
H-1

22f1
IF
A:t<
1 J 1
230
IF
A:t( 1 ..
1 ){
240
TRAP
180
250
LPF.~
I
r·H
:
F::8"1
260
PERt-1:=1
280
LPF.: I t·n
.i
YOU~:E:AL
f'90
LPR
At·CE
r s
400
TPAP
lowin~:"
41
a ? " ( 1
415
·t·
4~'0
·;.·
·t
425
·::·
430
'?
435
""?
440
.-
.
•
49ft
500
INPUT
505
TRAP
510
ON H GOSUB
600f1
J
7[~)0
5~'0
i1SG$=
II
:
At10Ut·lT=\'OUF.:8AL;
539
t1SG$="t·lEJ.~
II
:
At10Ut·lT
540
r·1SG$=
II
:
At10UNT=OUT:3iA~~D
545
IF
550
GOTO
1000
REt·1
1010 t·
1SG$=t·1SG1$:
10'20
OUiSTAt·~O=OUiSTAr·i[H-At·1C;U
1030
F.~ETURN
2000
REt1
II
YOU
I
f·~T
u
EAt·4~< ~3TATEt
$"
.;
BANI<BAL , LPR
400
:?
::o
!I
;
"(
2)
II
'..J
4)
c:"
7)
••
.•
j
.i
II;
1
II
;MSG5:t
II
;ftSG6$
DOt·lE
11
( 3 ) n
II(
II{
11(6)
"(
H : IF
4fl~i€10
II
t·lH~
=8ANK8HL ; GOSU8
II
our::::r
PERt
·1
THEt
400
OLD
OLD
EO
201(1
M:3G$=t1SG2$:
2020
OUT::;TAt·[I=OUT
2030
~:ETURt
·
~
3W3
REr-1
OLD
3010
MSG$=tt3G3$
3020
BANKBAL
3030
F.:ETURt
4000
REt1
4010
t1SG$=tt3G4$:
4020
E:At·~KE:AL
4030
RETURr~
5000
REt1
-
JUST
5010
t1SG$=tt3G5$:
5020
'lOURBAL
=E:ANKE:AL-At"Kll_ir
·
~
OLD
=E:AHK8AL
NEl·l
CLEA~£0
=YOUR8AL
)=II
t-f'
THHl
4(10
>!''r'"
THEH
200
TE~:T
PR
I
r·-iTE~:
F.
:
BEG
I
t·.tt
1 r
r·iG
E;,;Ui!·iCE
·
1Et·~T
BE
I
t·n
:?
tt::G
tt3(~2$
f1SJ~3$
"Chu.:t$e
1 z
o:•ne
t·1SG4$
11
t~
<
1
OR
t·~
>7
THEt-~
10~30
..
20(10
..
30;3[1, 4;300
CHECKBOOK
GOSUB
E:ANK
BALAt·iCE
:3000
STATH1EHi
8000
A~~o
1
t·iG
cHEo:s-DEPos
:
GOSUB
·i
LPR
CHECK
GO~:;UB
DEPOSIT --ST!
GOSUB
:::
TAt·~
CHECK
=
GOSUE:
I
--
--
:30(10
t·H
::;TILL
:31fi0
:::1t1~3
-
At·lOUr
.J
...
r.:;T
:::10t1
r
H
LL
·
n
CLEAF.:EO
·H
DEPOSIT --JUST
GOSUE:
8100
+At·10Ur·H
CHECK
(
0~:
GOSUE:
81£10
:3ERl..J
ICE
-AnOUNT
I::;
I~ I r-
~~-~ I ~·~G
of
the f eo
400
..
5€10(1,
Is
BALAt·~CE
r
TS=
OUT::;TAr
CREDITED
·
[!!t-~G
HOT
CREDIT
CHAPGE
:t
•!
BAL
1
IS
:::
-
H-2
Appendix

5030
?
II
I:;
t·~El·J
CHECl::
:
It~PUT
5040
5050
5055
5057
RED
5058
5060
5070
5075
ouTSTAHD
5080
60€10
ST
6010
602~1
603(1
ED";
6040
605(1
6052
6053 IF
EN
6055
6060
6070
6075
T
6080
7000
7010
G
YOURCHECKBOOK
7020
7030
7035
CE
7036
7037
ms
A$
IF
LEt·K
A:t
)=(1
IF
A$(
1, 1 )(
>II
E:AHKBAL=8At·iKBAL-At10Ut·H
IF
PERt·1
Th'H~
.
II
RETURt·4
IF
A$(
1,
1
){>nyu
OUTSTANO=OUTSTAt
IF
PERt·1
THHi
It·~~
.
II
F.:ETURr·~
RH1
~lB·l
OEPOS
CF~ED
I
TED
11SG:t=r-t3G6$:
'iOURBAL=\'OUF.:E:AL
11
?
HAS
:INPUT
IF
LHK
IF
A$( 1 ·' 1 ){
E:At~K8AL=E;At
PERt1
CRED I TEO
F~ETURt·l
IF
A$(
'lOU~
A$
A$
THEt-i
.
II
1
·'
1 )(
GOSUB
:
HEl·J
)=0
>
.......
·
iK8AL
>II N !I
OUT:3TAt·iD=OUTSTAt
IF
PERt·l
THEt·4
BEEt
·
~
CF.:EO
ITEO
.
II
F.:ETURr~
F.H1
[RJt·iE
11
?
BAt·lK
Is
BALAt
CHEC!<:3-DEPOS I T:3 ) SHOULD
BALAt·iCE
D!F='/OUP8AL
IF
OIF<
? " r s $
Ot-i
'r'OU~:
IF
LHK
IF
A$(
:
'lOUP
CHECKBOOK
-(8At
>0
THH~
11
i
BAt·il<BfiL
BAHK
STATEt-1Et-H
A$
)=(1
11
1
..
1
)=
Y"
srI
LL
THD
·
~
5f13(i
N"
THEt·~
LPF.:
I
t·H
"CHECK
THH~
·
ntAt·10UNi
LPRit-IT
IT ( OR
"CHECK
I
8100
+AmUt·H
OEP0:3
THH~
6030
II
THH~
+At·10Ut·H
LPF.:
I
NT
"DEP0:3
THH~
·
iD-At·10Ut-H
I
HT
t-Ht·t
11
LPR
·
~CE
. u
·iK
E:AL-OUT::;TAt·1D
7040
.i
II
THE
II
THEt~
7035
THE~
?
our::;TAr·iO
$)60
HA::;
5£130
IS
t~TEPEST
IT
BEH~
606~Z1
IT
6030
OEPO::;
IT
u~;
(
oursTA~iOI
r·~m·J
Er·{D
I
~·~G
,; : !
t·4F'UT
'1COt·iGP~1TULATI
BALAr·iCE
HiG"
.•
CLE~I
STILL
) --..JU
CREDIT
HA::;
BE
HA:3
t·iO
H
E@JAL
)
BALAt
·i
A$
::;
! " :
a10
703:3
7040
AL
IS
:GQTO
7050
II
Ut·iDER
7060
11
t·
iS'?
7070
l)E
II
GOiO
706t]
IF
OIF:::{1
$"
;OIF;
7060
'?
"'r'OU~:
''i'
OUF.:
·-::·
~~~~OULD
·{
II
REt1Et18EF.: ·'
DOLLAR
?
'lOUR
Is
TOTAL
LIKE
'lOU
TO
11
\'0UP
TOTAL
TO
CAt·i
t1AK£
THEt-i
II
Ol,IEF~
CHECKBOOK
BAt·iK
~~ou
I..JALUE
CHECKBOOK
t:At·~r<'S
.
!!
t·1AKE
ENTEF.:
TOTAL
IS
$n;
COF.:F.:ECiiO
A
A
CORRECT I ON
TOT
-OIF;
~·iEGAT
. n
I
.
Appendix
H-3