TRS-SO
MODEL III
I/O to theRS-232-C Interface
If
the default sett!ngs are correct, you are ready to begin serial
110.
Tochange 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
110
(both were used in the simple terminal
program):
$RSTX
$RSRCV
Send a character
Receive a character
Both subroutines are simple to use from
BASIC via the USR function.
ToSend a
Character
1.
The Computershould be connected to the serial device.
2. Define a
USR call to $RSTX (address 85) by executing these BASIC statements:
POKE 16526, 85
POKE 16527, 0
3. Sendthe characterby storing the ASCII code in memory location 16880. Suppose
A$ contains the character. Then execute this statement:
POKE 16880, ASC(A$)
4. Make the USR call with a dummy argument:
x=
USR(O)
If
the Computeris using the
Don't
Wait procedure, then control will return to
BASIC even
if
the character was not sent.
If
the Computeris using the Wait
procedure, control will return to
BASIC after the character
is
sent.
5. Repeat steps 3 and 4 until all the datahas been sent.
ToReceive a
Character
1.
The Computershould be connected to the serial device.
2. Define a
USR call to $RSRCV (address 50) by executing these BASIC statements:
POKE 16526, 50
POKE 16527, 0
3. Get the characterby making the USR call with a dummy argument. Forexample:
x=
USR(O)
Uponreturn from the subroutine, USR returns the ASCII code
of
the character
received in memory location
16872. A zero indicates no value was received.
8/4