EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 54

Radio Shack TRS-80 Model III
274 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...
\
s
TRS-80
MODEL
I/O
to the
RS-232-C
Interface
If the
default
settings
are
correct,
you
are ready
to begin
serial I/O.
To
change
any of
the
settings,
you need
to re-initialize
the RS-232-C
interface.
See
"To
Change
the
RS-232-C
Characteristics"
.
There
are two ROM
subroutines
for
serial
I/O
(both were
used in
the
simple
terminal
program):
SRSTX
Send
a character
SRSRCV
Receive
a character
Both
subroutines
are
simple
to use
from
BASIC
via the
USR function.
To
Send
a Character
1
.
The
Computer
should
be
connected
to the serial
device
.
2. Define
a USR call
to
SRSTX
(address
85)
by
executing
these
BASIC
statements:
POKE
16526,
85
POKE
16527,0
3
.
Send the
character
by
storing
the
ASCII
code in
memory
location
16880.
Suppose
A$
contains
the
character.
Then
execute
this
statement:
POKE
1
6880, ASC(A$)
4. Make the USR
call
with
a
dummy
argument:
X
=
USR(0)
If
the Computer
is
using
the
Don't
Wait
procedure,
then
control
will
return
to
BASIC
even
if the
character
was not
sent.
If the
Computer
is
using
the
Wait
procedure,
control
will
return
to BASIC
after the
character is
sent.
5.
Repeat
steps
3 and
4 until
all the
data has
been
sent.
To
Receive
a Character
1
.
The
Computer
should
be
connected
to the
serial
device
.
2. Define
a USR
call to
SRSRCV
(address
50)
by
executing
these
BASIC
statements:
POKE
16526,
80
POKE
16527,0
3
.
Get the
character by
making
the USR
call
with
a dummy
argument.
For
example:
X
=
USR(0)
Upon
return from
the
subroutine,
USR
returns
the ASCII
code of
the
character
received
in memory
location
16872.
A zero
indicates
no
value
was
received.
44

Other manuals for Radio Shack TRS-80 Model III

Related product manuals