EasyManuals Logo

Atari XL User Manual

Atari XL
262 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #80 background imageLoading...
Page #80 background image
CHAPTER 9
LOGICAL THINKING
As
well
as
doing
arithmetic,
the
Atari
XL
can
perform
tests
to
compare
numbers
and
strings.
We
have
already
seen
this
when
using
IF
...
THEN.
In
this
chapter
we
will
examine
in
more
detail
the
way
in
which
the
XL
makes
comparisons.
Consider
the
program
line:
220
IF
A = 3
THEN
500
The
line
instructs
the
Atari
to
branch
to
line
500
if
the
variable
A
holds
the
value
3.
What
does
the
Atari
do
when
it
encounters
this
program
line?
The
first
thing
the
computer
must
do is decide
whether
A
is
equal
to 3;
or
to
put
it
another
way,
whether
t.A = 3' is
true.
The
XL
tests
this,
and
if
the
expression
is
true,
it
returns
the
answer
1;
if
the
expression
is
false,
the
answer
is
O.
If
the
result
is
true
(1),
the
commands
after
THEN
are
obeyed.
If
the
answer
is
false (0)
the
program
will
continue
with
the
next
line.
Why
are
we
telling
you
all
this?
Because
the
computer
can
compare
numbers
and
return
true
or
false
values
without
IF.
Try
this
short
program:
10
A = 3
20
PRINT A = 3
The
program
displays
t.1'.
If
you
change
line
10 to
70

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari XL and is the answer not in the manual?

Atari XL Specifications

General IconGeneral
Release Year1983
CPUMOS Technology 6502C
GraphicsANTIC, GTIA
SoundPOKEY (4 channels)
StorageCassette tape
PortsCartridge
Operating SystemAtari BASIC
CPU Speed1.79 MHz
RAM64 KB

Related product manuals