EasyManua.ls Logo

Radio Shack 26-1145 - Page 29

Radio Shack 26-1145
35 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...
Example
Applications
Program
for Line Printer
A common application
for the Radio Shack RS-232-C
is
the
output
of serial
data to a
line
printer.
Before
continuing with
the specifics of the software, an
overview
of
the
I/O driver
organization of
Level II BASIC is in order.
Shortly after power
on
in
Level 11 BASIC,
a set
of addresses
relating
to
the I/O drivers
is
written
into the lower part of
RAM. These
addresses direct the BASIC software
to each of the
I/O drivers
as needed
(i.e.
LPRINT,
PRINT,
CLOAD,
CSAVE,
LIST,
LLIST,
etc.).
These addresses remain in
low
memory
as long as
power
is
supplied
to the computer or unless they are written
over
with new information.
In general, these addresses are not written over in normal
operation
and are
purposely located
in an area of
memory
which is
not
disturbed by
Level II BASIC. We
can,
however,
purposely
write
over the addresses in order
to
direct BASIC
to
an I/O driver of
our
own design. The addresses noted above, along with other I/O
specific information, are referred
to
as
"device control blocks" or
DCB's.
The
DCB for
the
Line
Printer
begins
at
memory
address
4025H and
is
organized as
shown
below.
MEMORY
ADDRESS MEMORY CONTENTS
4025H
DCB
TYPE
(Input, or output operation)
4026H
DRIVER ADDRESS
(Low order Byte)
4027H DRIVER
ADDRESS (High
order
Byte)
The line printer
driver
normally referred to
by
the DCB is located in
the
Level II ROMS
and expects
a
Centronics parallel type
interface
to be utilized.
If
we purposely alter this DCB to point to an address
in
RAM and place our own I/O
driver at this address,
we can utilize
the
Level
II commands which refer to the line printer
(LPRINT,
LLIST) with the serial line printer.
For this example let's assume that we wish to interface a
Level
II
TRS-80 to a serial line printer operating at 300 baud. The
line
printer
expects
a
seven-bit word,
one stop bit,
and even parity.
Let
us also assume that the printer has one
output
line
which can be
tested to
determine
if
the
printer
can accept
data.
When status line
is
low it means that the printer is not busy and
can accept
data from
the Interface; when it is high, it means that the printer is
busy and
cannot accept
data for the time being.
26

Other manuals for Radio Shack 26-1145

Related product manuals