EasyManua.ls Logo

Sharp MZ-800 - 6.7 Machine Language Control Statements

Sharp MZ-800
221 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
Loading...
6.7
Machine
Language
Control
Statements
PEEK
Format
PEEK
<address>
Explanation
This
function
returns
the
contents
of
the
specified
address
as
a
decimal
number
from
0
to
255.
<address>
may
be
a
decimal
number
from
0
to
65535
or
a
4-digit
hex-
adecimal
number
from
$0000
to
$FFFF.
Example
The
following
program
displays
data
stored
in
the
area
from
40960
($A000)
to
40975
($AO0F):
10
FOR
AD=40960
TO
40975
20
PRINT
PEEK
(AD)
30
NEXT
AD
40
END
POKE
Format
Explanat
ion
POKE
<address>,
<data>[,
<data>]
...
The
POKE
statement
writes
a
consecutive
number
of
data
values
starting
at
the
speci-
fied
address.
<address>
may
be
a
decimal
number
from
0
to
65535
or
a
4-digit
hexadecimal
number
from
$0000
to
SFFFF,
<datan>
may
range
from
0
to
255
or
from
$00
to
$FF.
This
statement
can
write
data
to
any
memory
location,
regardless
of
the
limit
set
by
the
LIMIT
statement.
Therefore,
careless
use
of
this
statement
can
des-
troy
the
monitor
or
BASIC
interpreter.
POKE
$D000,$5F
.
POKE
53248,95
...
The
two
statements
above
perform
the
same
function.
..
Uses
hexadecimal
numbers.
..
Uses
decimal
numbers.
INP@
Format
Explanat
ion
INP@
<port
number>,
<variable>
The
INP@
statement
reads
8-bit
data
from
the
input
port
specified
in
<
port
num-
ber
>,
converts
it
into
a
decimal
number
and
assigns
it
to
<variable>.
<port
num-
ber>
may
be
in
the
range
0
to
127
(hexadecimal
$00
to
$7F).
Port
addresses
128
to
255
($80
to
$FF)
are
reserved
for
optional
peripheral
devices.
=a
fr
tes

Other manuals for Sharp MZ-800

Related product manuals