RND RDDRESS IN RON
C4025H}
+
i
:
POKE
16423,
127
DRIVER INTO HIGH MEM
<7F00H>
BASIC Program for DECWRITER
10 REM
**
POKE HEN
DCB
TYPE
20 POKE 16421,
2
:
POKE 16422,
20 REM
+*
POKE
RS--232-C I/O
40 FOR X=32512
TO 32584
50 RERD
V
60 POKE X, V
70 NEXT X
75 END
8@ DRTR 229, 137, 245,
58, 72,
127, 254, 1, 40
90
DRTR
32, 62,
1,
50, 72,
127, 211,
232, 219,
233
100 DRTR 230, 248, 246,
4, 50, 71,
127,
211,
234
110 DRTR 219, 233,
230, 7, 33,
63, 127, 6, 0, 79,
9
120 DRTR
126, 211, 233, 241, 193, 225, 219,
234
130 DRTR 203, 119, 40, 250, 121, 211, 235, 254
140 DRTR
13, 32, 4, 14,
10,
24, 239, 201, 34, 68
150 DRTR
85,
102,
119, 170, 204, 238, 0,
The initialization code must reset the UART, read the
configuration
sense switches, load the UART
with the control
information
specified by
the
switches (stop bits,
word length,
and parity
convention), load
the BRG with the
correct code for
the
baud
rate
specified by
the switches,
and set
the initialization
flag in
memory.
Lines 500
through
620 accomplish
the
actual output of data to
the
printer.
The software first checks
to see if
Data Set Ready
is
low
and loop-tests each time
if not. When
found low, it checks the
UART's transmitter holding register status-bit for
a
high
(indicating
the UART can accept
a
new character
for
transmission),
loops
if
not,
or loads the UART holding register with the next
character if
so.
The character just loaded is then
tested to
see if it
was
a carriage
return
(0DH) and if so, a line feed (0AH) is
transmitted also. This line feed may or may
not
be
necessary
depending upon the
specific printer being interfaced.
(This part of
the code can be
deleted
if desired.) Control is now
transferred
back to
BASIC.
Following the
assembly language driver on page 28
is a
BASIC
program listing. This BASIC program
accomplishes two tasks,
writing a
new address in the line printer
DCB
(line
20)
and writing
the actual printer driver code into high memory (lines
40 through
1 20).
Lines 80 through 1 50 are data statements which contain
the decimal
equivalents
of each byte of the
driver
object
code shown
in the
second column of the assembly language listing on pages
27 and
28.
To use
this
program,
see
page 30.
29