EasyManua.ls Logo

Commodore Plus 4 - Page 387

Commodore Plus 4
464 pages
Print Icon
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...
The
Printer
37S
Dot
Mode
When
the
printer
is
placed
in
dot
mode
with
CHR$(8),
the
data
characters
it
receives
are
interpreted
as
dot
patterns.
Each
column
of
seven
dots
is
addressed
individually.
The
low
bit
is
the
top
dot
in
the
column,
and
bit
6
is
the
bottom
bit
in
the
column.
When
the
bit
is
a
1,
the
dot
is
inked,
and
when
the
bit
is
a
0,
the
dot
is
left
blank.
The
high
bit
of
a data
byte
must
always
be
set
to
1.
The
printer
uses
this
bit
to
determine
that
it
has
received
a
data
byte
rather
than
a
control
byte
while
in
dot
mode.
In
dot
mode,
the
spacing
between
lines
is
exactly
the
height
of a
column.
This
results
in
nine
lines
per
inch.
The
print
head
can
be
positioned
to
any
column
position
required
by
using
the
CHR$(27)
and
CHR$(16)
commands.
First
the
CHR$(27)
is
sent
to
indicate
a
positioning
based
on
dot
columns
(rather
than
character
positions).
Then
the
CHR$(16)
is
sent
to
indicate
that the
head
is
to
be
positioned.
The
first
character
following
the
CHR$(16)
is
interpreted
as
the
high
bit
of
a
9-bit
column
position.
The
next
character
is
interpreted
as
the
low
byte of
the
column
position.
For
example,
PRINT#4,CHR$(8)CHR$(27)CHR$(
16)CHR$(
1
)CHR$(4)CHR$(255)
prints
a
vertical
bar
(specified
by
CHR$(255))
in
column
260
(counting
from
0).
In
dot
mode,
it
is
possible
to
repeat
a
given
column
of
dots
a
number
of
times.
This
is
done
using
the
CHR$(26)
command.
The
byte
following
this
command
is
interpreted
as
the
number
of
repetitions
of
the
column,
and
the
next
byte
as
the
data
to
repeat.
For
example,
PRIM-T#4,CHR$(8)CHR$(S55)CHR$(26)CHR$(10)CHR$(193)
CHR$(255)
prints
a
rectangle
consisting
of a
vertical
bar
(CHR$(255)),
followed
by
10
copies
of
a
column
with
dots
at
the
top
and
bottom,
and
finished
with
another
vertical
bar.
Example:
This
example
program
is
meant
to
be
run
from
a
computer
attached
to
an
MPS-801
printer
set
to
device
number
4.
It
prints
out
the
lyrics
of
the
Star
Spangled
Banner,
with
little
(custom-made)
flags
beside
them.
Inside
the
quota
tion
marks,
type
everything
in
upper
case
while
holding
down
the
SHIFT
key
and
everything
in
lower
case
without
using
SHIFT.
10
0PEN4,4,7
20
PRI1TT#4,CHR$(14)//Tlie
Star
Spangled
Banner"
30
F0RI=
1TO11
:READA:A$=A$+CHR$(A):NEXT
40
FORI=1TO8:READL$(I):3STEXT
50
PRINT#4,CHR$(8)