Radio Shack TRS-80 Operation Manual page 23

Ptc-64 printer controller
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

3.
Tell the printer
which
dots
to
print.
This
step will
be explained
in detail
with a
specific
example.
Suppose you wish
to
redefine special character
144 and
make
it
a
"P." The
procedure
below
illustrates
how
this
is
done:
On
a
5x7
grid
draw
dots
in
all
the
desired squares
to
produce
a
letter
"P"
(see
illustration
below).
1
2
4
8
e
16
32
64
You'll notice
that in
the
first
column
every square has
a dot.
According
to
the
procedure
above,
we
should
add
all
the
Dot
#s
and
then
add
128
to their
sum:
1+2 +
4
+
8
+
16
+
32
+ 64=127
and
127
+
128
=
255
At
this
point, the control
sequence
for
redefining character
144 should look
like:
LPRINT CHR*(27)i CHR$(39)i CHR$(144)i CHR$(255)i
In the
second,
third,
and
fourth
columns, only
two
squares
have
dots,
namely Dot
#s
1
and
8.
Continuing with
the
procedure,
Dot
#s
1
and
8
must
be added
to
each
other
and
then
to
128:
1+8 =
9
and
9+128=137
Now
the
sequence
would
look
like:
LPRINT CHR$(27)i CHR$(39)! CHR$(144)i CHR$(255)5
CHR$(137)i CHR$(137)5 CHR$(137)5
Finally, in the
fifth
column,
Dot
#s
2
and 4
are on:
2
+
4
=
6
and
6+128=134
The
entire
sequence
to
redefine special character
144
is
then:
LPRINT CHR$(27)i CHR$(39)i CHR$(144)i CHR$(255);
CHR$(137)i CHR$(137)5 CHR$(137)5 CHR$(134)5
CHR$(
128)
5
CHR$(
127)
5
The
last
two
bytes
of information
are there for a reason.
CHR$
(
128)
simply
inserts
a
blank space
after
the character
and
CHR$
(
1
27
)
is
used anytime
the
number
of
bytes
sent
is
less
than
24.
Having
redefined
this
character,
anytime
CHR$
(
144
)
is
called
out
the
letter
"P"
will
be
printed.
15

Advertisement

Table of Contents
loading

Table of Contents