EasyManuals Logo

Atari 800 User Manual

Atari 800
326 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 #126 background imageLoading...
Page #126 background image
124
User's
Handbook to the Atari 400/800 Computers
Line
10
begins a FOR/
NEXT
loop. The
counter
(J)
is
set equal
to
0
the
first
time
through
the
loop
. Line
20
calls the
subroutine
at
line
100.
As
a result,
line
100
is
executed next. The
subroutine
prints
the
value
of
J and proceeds
to
line
110.
At
line
110,
the
program
is
returned
to
the
point
where the
subroutine
was
called
(line
20).
The statement at
line
30
is
then
executed. The
NEXT
statement
causes
the
loop
to
be
incremented
and repeated. The
counter
(J)
is
set equal
to
1, and
the
subroutine
is
called again
from
line
20.
At
line 100,
the
value
of
J
is
printed.
Line 110 returns
the
program
to
line
20.
These steps are also repeated
for
J =
2.
When
the
loop
has
been
executed 3 times,
the
program will proceed
to
line
40.
J
is
assigned the value 5, and the
subroutine
is
cal led again at
line
50.
The
subroutine
prints the value
of
J. The
program
then returns
to
line
60
where
it
ends.
GOSUB can also be used
with
ON
to branch a
program
to
one
of
several subroutines.
CONFIGURATION
ON
EX
GOSUB
LN
[,LN] [,LN] ...
The expression after the
ON
statement indicates
which
l
ine
number
the
program
proceeds to. This
is
ca
lled
the
control
expression. The
control
is
evaluated and
rounded
off.
If
the
value
is
negative
or
greater than
255,
an
error
occurs.
Ifthe
value
of
the
contro
l
is
1, the program continues at the first
line
number
after GOSUB.
If
the
contro
l
is
equal
to
2,
the
program
continues
at the second
line
number
after GOSUB, etc.
If
the value
of
the
control
is
0
or
greater than the
number
of
line
numbers,
the
line
after the
ON
/ GOSUB statement
is
executed.
EXAMPLE
ON
X GOSUB
100
,
200,
300,400
This statement executes the
subroutine
at
line
100
if
X =
1.
If
X =
2,

Other manuals for Atari 800

Questions and Answers:

Question and Answer IconNeed help?

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

Atari 800 Specifications

General IconGeneral
ProcessorMOS Technology 6502
Processor Speed1.79 MHz
ROM10 KB
GraphicsANTIC and GTIA chips
Release Year1979
Display Resolutionup to 320 x 192
Colors128 colors
Sound4 channels
StorageCartridge, cassette, floppy disk
PortsCartridge, serial, monitor
Operating SystemAtari OS

Related product manuals