EasyManuals Logo
Home>Atari>Desktop>800

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 #44 background imageLoading...
Page #44 background image
USR
36
Function
Library
Although
this
is
not
a
function,
it
is
included
in
this
section
because
it
is closely
associated
with
the
PEEK
function.
This
POKE
command
inserts
data
into
the
memory
location
or
modifies
data
already
stored
there
.
In
the
above
format,
aexp1
is
the
decimal
address
of
the
location
to
be
poked
and
aexp2
is
the
data
to
be
poked.
Note
that
this
number
is
a
decimal
number
between
0
and
255. POKE
cannot
be
used
to
alter
ROM
locations.
In
gaining
familiarity
with
this
command
it
is
advisable
to
look
at
the
memory
location
with
a
PEEK
and
write
down
the
contents
of
the
location.
Then,
if
the
POKE
doesn't
work
as
anticipated,
the
original
contents
can
be
poked
into
the
location.
The
above
Direct
mode
example
changes
the
left
screen
margin
from
its
default
position
of
2 to a
new
position
of
10.
In
other
words,
the
new
margin
will
be
8
spaces
to
the
right.
To
restore
the
margin
to
its
normal
default
position,
press
ti"ti•341;1J1jj
0
Format:
Example:
USR
(aexp1
[,
aexp2][,
aexp3
..
.])
100 RESULT =
USR
(ADD1,A *2)
This
function
returns
the
results
of
a
machine-language
subroutine.
The
first
ex-
pression,
aexp1,
must
be
an
integer
or
arithmetic
expression
that
evaluates
to
an
integer
that
represents
the
decimal
memory
address
of
the
machine
language
routine
to
be
performed.
The
input
arguments
aexp2,
aexp3,
etc.,
are
optional.
These
should
be
arithmetic
expressions
within
a
decimal
range
of
0
through
65535. A
non-integer
value
may
be
used;
however,
it
will
be
rounded
to
the
nearest
integer.
These
values
will
be
converted
from
BASIC's
Binary
Coded
Decimal
(BCD)
floating
point
number
format
to
a
two-byte
binary
number,
then
pushed
onto
the
hardware
stack,
composed
of
a
group
of
RAM
memory
locations
under
direct
control
of
the
6502
microprocessor
chip.
Figure
6-1
illustrates
the
struc-
ture
of
the
hardware
stack.
(Number
of
arguments
on
the
stack-may
be
0)
(High
byte
of
argument
X)
(Low
byte
of
argument
X)
(High
byte
of
argument
Y)
(Low
byte
of
argument
Y)
(High
byte
of
argument
Z)
(Low
byte
of
argument
Z)
(Low
byte
of
return
address)
(High
byte
of
return
address)
Figure
6-1.
Hardware
Stack
Definition
Note:
X is
the
argument
following
the
address
of
the
routine,
Y
is
the
second,
Z is
the
third,
etc.
There
are
N
pairs
of
bytes.
See Section 11
for
a
description
of
the
USR
function
in
machine
language
pro-
gramming.
Appendix
D
defines
the
bytes
in
RAM available for
machine
language
programming.

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
BrandAtari
Model800
CategoryDesktop
LanguageEnglish

Related product manuals