EasyManuals Logo

Atari 800 Basic Reference Manual

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

Table of Contents

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