Atari XL User manual



THE
ATARIXL
HANDBOOK


THE
ATARIXL
HANDBOOK
PETER
LUPTON
&FRAZER ROBINSON
CENTURY
COMMUNICATIONS
LONDON

Copyright
e
Peter
Lupton
and
Frazer
Robinson
1984
All
rights
reserved
First
published
in
Great
Britain
in
1984
by
Century
Communications
Ltd,
12 - 13
Greek
Street,
London
WI
V
5LE
ISBN
0
7126
02259
Reproduced,
printed
and
bound
in Great
Britain
by
Hazell Watson &Viney Limited,
.
Member
of
the
BPCC
Group,
Aylesbury,
Bucks
Typeset
by
Spokesman,
Bracknell

CONTENTS
Acknowledgements
Introduction
1
Computers
and
Programs
1
2
Setting
up
your
XL 3
3
First
Steps
8
4
Programming
18
5
Program
Control
31
6
Data
and
Programs
45
7
Pieces
of
Strings
52
8
Functions
63
9
Logical
Thinking
70
10
Memory
Managemen
t74
11
Sound
and
Music
77
12
Characters
105
13
Graphics
136
14
Advanced
Graphics
153
15
Player-Missile
Graphics
172
16
Permanent
Storage
188
17
Advanced
Techniques
196
APPENDICES
1
BASIC
Commands
204

2
BASIC
Error
Codes
3
Speeding
Up
Programs
4N
umbering
Systems
5
Graphics
Modes
6
Colour
Codes
7
Character
Codes
8
Display
List
Instructions
9
Useful
Memory
Locations
10
Music
Frequencies
11
Musical
Notation
12
System
Memory
Map
Index
215
223
225
230
231
232
234
236
238
239
243
244

ACKNOWLEDGEMENTS
Our
thanks
to
all
those
who
in
some
way
made
the
creation
of
this
book
possible,
especially
friends
and
colleagues
whose
enthusiasm
and
interest
was
invaluable
as
our
stocks
of
midnight
oil
burnt
low.
Special
thanks
to
Herbert
for
all
his
contributions,
and
to
Richard
Gollner
for
his
continuing
optimism
and
sense
of
humour.
Once
again
our
families
have
given
us
much
encouragement,
for
which
we
are
grateful,
and
sound
nutritional
advice,
which
we
have
ignored.

INTRODUCTION
This
book
is
an
introduction
to
the
ATARI
XL
range
of
computers
and
their
facilities.
It
takes
you
from
the
first
steps
in
BASIC
programming,
pointing
out
the
pitfalls
and
explaining
how
to
make
the
most
of
the
features
of
ATARI
BASIC,
through
to a
detailed
understanding
of
how
to
write
good,
structured
programs,
with
many
illustrative
examples
along
the
way.
A
chapter
is
devoted
to
the
extensive
sound
capabilities
of
the
XL,
including
details
of
the
sound
generating
chip
itself
which
allow
you
to
create
a
wider
range
of effects
than
is possible
using
the
standard
commands.
Four
chapters
cover
the
incredible
graphics
facilities
of
the
machines,
including
many
spectacular
examples
and
useful
programs.
An
advanced
chapter
shows
how
a
detailed
knowledge
of
the
way
graphics
are
created
leads
to
even
more
exciting
effects.
A
comprehensive
set
of
appendices
ensure
that
the
book
will
remain
a
valuable
reference
work
long
after
you
have
grasped
the
principles
of
the
machine.
We
hope
that
you
will
find
this
book
both
enjoyable
and
instructive
and
that
it
enables
you
to
exploit
the
potential
of
your
XL to
the
full.
PETER
LUPTON
and
FRAZER
ROBINSON
1984

CHAPTER
1
COMPUTERS AND PROGRAMS
Despite
everything
you
may
have
heard
about
computers
being
hyperintelligent
machines
which
are
on
the
point
of
taking
over
the
world,
a
computer
is
not
really
intelligent
at
all.
A
computer
is
at
heart
little
more
than
a
high-speed
adding
machine,
similar
to
an
electronic
calculator,
but
with
more
sophisticated
display
and
memory
facili
ties.
The
feature
that
gives
computers
their
immense
flexibility
and
potential
is
this:
they
can
store
lists
of
instructions
which
they
can
read
through
and
obey
at
very
high
speed.
These
lists
of
instructions
are
called
programs,
and
most
of
this
book is
concerned
with
how
these
programs
are
written.
The
computer
instructions
which
form
programs
must
follow
certain
rules,
or
the
computer
will
not
be
able
to
understand
them.
The
rules
for
wri
ting
programs
resemble
the
rules
of
a
spoken
language,
and
so
the
set
of
instructions
is
often
said
to form a
programming
language.
There
are
many
different
computer
programming
languages;
the
one
that
the
Atari
XL
understands
(in
common
with
most
other
personal
computers)
is
called
BASIC.
(The
name
BASIC
is
an
acronym
for
Beginners'
AII-
purpose
Symbolic
Instruction
Code.)
A
programming
language
is
much
simpler
than
a
human
language
because
computers,
for
all
their
power,
are
not
as
good
at
understanding
languages
as
people
are.
The
BASIC
language
used
by
the
1

2The
Atari
XL
Handbook
XL
has
only
about
80
words.
The
rules
for
combining
the
words
-
the
(grammar'
of
the
language
-
are
much
more
strict
than
for a
language
like
English,
again
because
it
is
difficult
to
make
computers
that
can
use
languages
in
the
relaxed
sort
of
way
in
which
we
speak
English.
These
may
seem
like
limitations,
but
in
fact
as
you
will
discover
BASIC
is
still
a
powerful
language,
and
it
is
possible
to
write
programs
to
perform
very
complex
tasks.
Finally,
remember
this.
Your
computer
will
not
do
anything
unless
you
tell
it
to, so
whatever
happens,
you're
the
boss.
The
XL
won't
take
over
the
world
unless
you
make
it!

CHAPTER 2
SETTING UP YOUR
Xl
Before
you
can
use
your
Atari
XL,
you
must
connect
it
to a
power
supply
and
to a
television.
To
Peripheral
port
Parallel
Bus
TV
Monitor
Power
aNI
socket
socket
socket OFF
The
Atari
XL
Connectors -
Rear
View
00
PORT 1 PORT 2
The
Atari
XL
Connectors -
Side
View
load
and
save
programs
you
will
also
need
to
connect
a
cassette
unit
to
the
XL.
Before
connecting
anything,
make
sure
you
know
what
should
plug
in
where.
The
diagrams
above
show
all
the
connector
sockets
of
the
XL.
3

4The
Afar;
XL
Handbook
There
are
several
sockets
through
which
the
XL
passes
and
receives
information,
and
one
through
which
it
gets
the
electrical
power
it
needs
to
operate.
The
sockets
are
clearly
labelled,
but
refer
to
the
diagram
before
plugging
anything
in.
POWER
The
XL
needs
alow
voltage
DC
supply,
and
this
is
obtained
from
the
power
supply
unit
supplied
with
your
computer.
Plug
this
power
supply
into
the
mains,
and
plug
the
output
lead
into
the
computer
at
the
socket
labelled
PWR.
IN
on
the
back
of
the
computer.
Do
not
switch
on yet!
DISPLAY
The
Atari
XL
uses
a
standard
domestic
TV
to
communicate
with
you,
and
for
this
almost
any
TV
will
do. To
get
the
best
results,
use
a
modern,
good
quality
colour
TV.
If
you
use
a
black
and
white
set,
the
colour
displays
produced
by
the
computer
will
appear
as
shades
of
grey.
To
connect
the
XL to
the
TV,
plug
the
supplied
aerial
lead
into
the
aerial
socket
of
the
TV,
and
plug
the
other
end
into
the
socket
labelled
TV
at
the
back
of
the
computer
(check
the
diagram).
The
lead
has
a
different
type
of
plug
at
each
end,
so
take
care
that
you
don't
try
to force
in
the
wrong
one.
CASSETTE
RECORDER
The
Atari
XL,
like
most
other
small
computers,
uses
cassette
tapes
to
save
programs
or
information,
so
that
you
don't
have
to
type
them
in
every
time
you
need
them.
Y
ou
cannot
use
an
ordinary
cassette
recorder
wi
th
the
XL:
you
must
use
the
special
Atari
cassette
unit,
which
is
available
at
extra
cost.
The
power
for

Setting
up
your
XL 5
the
cassette
unit
is
taken
from
the
adaptor
supplied
with
it.
Plug
this
adaptor
into
the
mains,
and
plug
the
lead
into
the
socket
labelled
POWER
IN
on
the
back
of
the
cassette
uni
t. To
connect
the
cassette
unit
to
the
computer,
plug
one
end
of
the
lead
supplied
into
the
socket
marked
PERIPHERAL
on
the
back
of
the
computer,
and
the
other
end
into
either
of
the
sockets
marked
I/O
CONNECTORS
on
the
back
of
the
cassette
uni
t.
DISK
DRIVE
Programs
can
also
be
stored
on floppy
disks.
A
floppy
disk
drive
is
faster
than
a
cassette
unit
and
is
more
flexible
in
use.
(It
is
also
much
more
expensive).
The
disk
drive
connects
to
the
socket
labelled
PERIPHERAL
at
the
rear
of
the
computer.
The
disk
unit
requires
its
own
power
supply
and
so
must
also
be
plugged
into
the
mains.
PRINTER
If
you
have
a
printer,
its
lead
plugs
into
one
of
the
I/O
CONNECTORS
socket
at
the
rear
of
the
cassette
unit.
If
you
are
using
a
disk
drive
you
should
plug
the
printer
lead
into
the
spare
socket
at
the
rear
of
the
disk
drive.
The
printer
also
has
a
separate
mains
lead.
SWITCHING ON
When
you
have
connected
everything
together,
you
are
ready
to
switch
on.
The
equipment
must
be
switched
on
in
the
right
order,
or
there
is a
risk
of
damaging
the
computer.
First
swi
tch
on
the
TV.

6The
Atari
XL
Handbook
Second,
swi
tch
on
the
disk
drive
and
then
the
printer.
Remember
that
you
should
never
switch
a
disk
unit
on
or
off
with
disks
inside
it.
Last,
switch
on
the
computer
itself,
using
the
swi
tch
on
the
back
next
to
the
PWR.
IN
socket.
Switching
off
should
be
carried
out
in
the
reverse
order:
first
the
computer,
then
the
disk
drive
and
prin
ter,
and
last
of
all
the
TV.
'fUNING
To
get
a
display
to
appear
on
the
TV
screen,
tune
to
channel
36,
or,
on a
pushbutton
set,
use
a
spare
channel
and
keep
tuning
until
you
see
this
appear
on
the
screen:
READY.
If
you
are
unable
to
tune
the
television,
perform
the
following
checks:

Setting
up
your
XL
1
Check
that
the
aerial
lead
is connected.
7
2
Make
sure
the
computer
is
connected
to
the
mains
and
switched
on.
The
red
power
indicator
should
be on.
3
Try
tuning
the
TV
again,
and
-
if
possible -
try
a
different
TV.
With
a
little
time
and
careful
tuning,
it
is
possible
to
get
a
clear
and
stable
display
on
nearly
all
types
of
TV.
If
you
are
unsuccessful,
consult
your
dealer.
If
you
are
thinking
of
buying
a
TV
especially
for
use
with
your
XL,
it's
worthwhile
taking
the
computer
to
the
shop,
as
certain
types
of
TV
seem
to
give
better
results
than
others.
For
the
best
quality
display,
you
could
buy
a
monitor.
This
is
a
display
specifically
designed
for
use
with
a
computer,
and
contains
no
circuitry
for
TV
reception.
However,
a good
colour
monitor
can
cost
twice
the
price
of
the
computer!
The
XL
provides
a
standard
output
for a
monitor,
through
the
socket
next
to
the
TV
socket.
Your
dealer
can
advise
you
on
the
connecting
leads
required.

CHAPTER 3
FIRST
STEPS
Before
you
can
make
use
of
your
Atari,
you
must
find
out
how
to
communicate
with
it.
Communication
is a
two-way
process:
you
must
give
the
Atari
instructions,
and
you
must
be
able
to
find
out
how
it
responds
to
them.
You
give
instructions
using
the
keyboard,
and
the
computer
displays
its
response
on
the
TV
screen.
Type
the
following
phrase
on
the
keyboard:
PRINT "ATARI XL"
You
will
see
the
letters
appear
on
the
screen
as
you
press
the
keys.
The
light
blue
square
-
called
the
cursor
-
will
move
to
indicate
where
the
next
letter
you
type
will
appear.
Nothing
else
happens
though:
the
computer
has
not
yet
obeyed
your
instruction.
Now
press
the
RETURN
key.
The
words
ARI
XL'
appear
on
the
screen,
and
the
word
is
printed
to
tell
you
that
the
computer
is
waiting
for
your
next
command.
If
instead
of
printing
XL'
the
computer
prints
0,
or
prints
and
reprints
your
instruction,
it
means
you
have
made
a
typing
mistake.
Try
again!.
So, to
give
the
Atari
a
direct
command
you
type
it
at
the
keyboard
and
press
RETURN.
Try
another
command:
8

PRINT
"HELLO!"
First
Steps 9
Again,
the
letters
between
the
quotation
marks
are
printed.
You
can
tell
the
Atari
to
print
any
sequence
of
letters,
but
you
must
remember
to
put
them
between
quotation
marks.
Try
making
it
print
your
name.
You
don't
have
to
type
(1
RINT
in
full
every
time
-
the
command
can
be
abbreviated
to
PRe
(the
full
stop
must
be
included),
or
to a
question
mark.
Try:
PRe
"HELLO"
and:
?
"ATARI"
(remembering
to
press
RETURN
after
typing
each
command,
of
course).
MANAGING
THE DISPLAY
As
well
as
typing
on
to
the
screen,
there
are
a
number
of
different
ways
to
alter
the
display.
The
Cursor
The
cursor
can
be
moved
around
the
screen
using
the
key
labelled
CONTROL
at
the
left
of
the
keyboard
and
the
four
keys
at
the
right
with
arrows
marked
on
them.
To move
the
cursor,
hold
down
the
CONTROL
key
and
press
one
of
the
arrowed
keys.
This
method
of
assigning
two
functions
to a
key
is
similar
to
the
use
of
a
SHIFT
key
on a
typewriter,
except
that
on
the
Atari
computer
it
is
taken
a
stage
further,
with
the
CONTROL
key
as
well
as

10 The A
tar;
XL
Handbook
the
SHIFT
keys,
so
any
of
the
other
keys
may
have
three
different
uses.
Try
moving
the
cursor
around
the
screen
(it
will
continue
to
move
for
as
long
as
you
press
the
key).
Notice
that
when
the
cursor
reaches
one
edge
of
the
screen
it
reappears
at
the
opposite
edge.
The
TAB
key
is
used
in
the
same
way
as
that
on a
typewriter.
Pressing
TAB
moves
the
cursor
right
to
the
next
preset
posi tion.
You
can
set
and
clear
the
tab
stops
by
using
SHIFT
and
TAB
together
to
add
a
new
stop
at
the
current
horizontal
position
of
the
cursor,
and
CONTROL
and
TAB
together
to
clear
a
stop.
When
you
first
switch
on
the
Atari
there
are
five
TAB
stops
set
automatically,
at
eight
column
intervals
across
the
screen.
You
will
notice
after
a
little
experimenting
that
the
TAB
key
may
move
the
cursor
to
different
positions
on
successive
horizontal
lines.
This
is
because,
as
you
will
discover
later,
it
is
possible
to
type
an
instruction
which
extends
over
two
or
even
three
lines
of
the
screen,
and
the
TAB
key
is
moving
to
preset
points
along
this
114
character
line.
Screen
Scrolling
When
you
move
the
cursor
down
to
the
bottom
of
the
screen
with
the
cursor
keys,
it
will
reappear
at
the
top
and
continue
to
move
downwards.
However,
if
you
use
the
RETURN
key
to
move
downwards,
when
the
cursor
reaches
the
bottom
the
display
will
begin
to
move
upwards.
This
movement
is
called
scrolling.
Anything
which
disappears
from
the
top
of
the
screen
can
not
be
recovered,
as
the
screen
will
only
scroll
one
way.
Table of contents
Other Atari Desktop manuals

Atari
Atari 130XE User manual

Atari
Atari 1200 XL User manual

Atari
Atari ST User manual

Atari
Atari PC User manual

Atari
Atari 800 XL ROSE User manual

Atari
Atari 800 XL ROSE Quick start guide

Atari
Atari 1200 XL User manual

Atari
Atari PC5 User manual

Atari
Atari 520ST User manual

Atari
Atari 600XL Instruction manual

Atari
Atari 400 User manual

Atari
Atari 800 XL ROSE User manual

Atari
Atari 800 XL ROSE User manual

Atari
Atari PC3 User manual

Atari
Atari 400 User manual

Atari
Atari MEGA STe User manual

Atari
Atari 800 XL ROSE Quick start guide

Atari
Atari 600XI Quick start guide

Atari
Atari 400 Quick start guide

Atari
Atari 400 Instruction Manual