EasyManuals Logo

Atari 400 User Manual

Atari 400
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 #73 background imageLoading...
Page #73 background image
Intr
od
uct
ion
to Atari BASIC
71
The
execution
of
subroutines
is
controlled
by
the
COSUB and
RETURN
statements. The
format
for
the COSUB statement
is
as
follows.
COSUB
lin
e
numb
er
The
computer
will begin execution
of
the s
ubroutine
beginning
at
the
lin
e
number
indicated. Statements
will
continue
to
be
executed in
order,
until
a
RETURN
statement
is
encountered.
Upon
execution
of
the RETURN statement,
the
computer
will
branch
out
of
the
subroutine
back
to
the
first
line
following
the
original COSUB statement. This
is
illustrated
in
the
following
example.
Illustration 3-5.
BASIC
Program With a Subroutine
Subroutine
050
DIM
ER$(50)
,
B$(50)
100
PRINT
"ENTER
CHECK
AMOUNT"
200
INPUT A
300
COSUB
900
400
PRINT "
ENTER
PAYEE'S
NAME"
500
INPUT
B$
600
PRINT
B$
, A
700
COTO
100
900
REM
ERROR
SUBROUTINE
910
ER$
=
"NOT
ALLOWED"
920
IF
A < 0 THEN
COTO
100
930
IF
A>1000
THEN PRINT
ER$
940
IF
A = 0 THEN
999
950
RETURN
999
END
Subroutines can
help
the
programmer
organize
his
program
more
efficiently. Subroutines also can make
writing
a
program
easier.
By
dividing
a
lengthy
program
into
a
number
of
smaller
subroutines,
the
complexity
of
the
program
will
be reduced.
Individual
subroutines are smaller and
therefore
more
easily
written.
Subroutines are also
more
easily
debugged
than a
longer
program
.

Other manuals for Atari 400

Questions and Answers:

Question and Answer IconNeed help?

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

Atari 400 Specifications

General IconGeneral
ManufacturerAtari
Model400
TypeHome Computer
Release Year1979
CPUMOS Technology 6502
CPU Speed1.79 MHz
ROM10 KB
Operating SystemAtari OS
KeyboardMembrane keyboard
RAM8 KB (expandable to 48 KB)
GraphicsANTIC and GTIA chips
Sound4 channels
DisplayRF output for connection to TV
StorageOptional cassette tape drive or floppy disk drive
PortsCartridge
Display Resolution320x192 (16 colors)

Related product manuals