EasyManua.ls Logo

Sharp MZ-800 - Page 142

Sharp MZ-800
221 pages
Print Icon
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...
OUT@
Format
OUT@
<port
number>,
<numeric
expression>
Explanation
The
OUT@
statement
converts
the
decimal
number
specified
in
<numeric
expres-
sion>
(0
to
255)
to
a
binary
format
and
sends
it
to
the
output
port
specified
in
<port
number>.
<port
number>
may
range
from
0
to
127
(hexadecimal
$00
to
$7F).
Port
addresses
128
to
255
(hexadecimal
$80
to
$FF)
are
reserved
for
optional
peripheral
devices.
Peripheral
devices
are
controlled
by
data
transmitted
to
I/O
ports.
Consequently,
specifying
an
illegal
number
in
<port
number>
may
cause
peripheral
device
mal-
function.
USR
Format
USR
(<address>[,<input
string
variable>]
[,<output
string
variable>])
Abbreviated
Format
Explanation
U.
The
USR
function
transfers
control
to
a
machine
language
program
which
starts
at
the
specified
address.
As
with
CALL
<address>,
control
is
returned
to
the
state-
ment
following
the
USR
function
when
a
return
instruction
RET
or
RET
cc
is
en-
countered
in
the
machine
language
program.
<address>
must
be
a
decimal
or
4-digit
hexadecimal
number.
The
parameters
are
loaded
into
the
following
registers
when
the
main
program
trans-
fers
control
to
the
machine
language
program:
DE
register:
Starting
address
of
<input
string
variable>
in
memory.
B
register:
length
of
<input
string
variable>.
IX
register:
address
of
the
error
processing
routine,
if
declared.
The
machine
program
loads
processing
results
into
the
following
registers
when
it
returns
control
to
the
main
program:
DE
register:
starting
address
of
<output
string
variable>
in
memory.
B
register:
length
of
<output
string
variable>.
The
following
steps
are
necessary
when
error
processing
is
required
in
the
machine
language
program:
1.
Declare
an
error
processing
routine
in
the
BASIC
program
using
an
ON
ERROR
GOTO
statement.
2.
Write
a
program
segment
which
loads
the
A
register
with
the
error
code
and
causes
program
execution
to
jump
to
the
address
specified
in
the
IX
register.

Other manuals for Sharp MZ-800

Related product manuals