The Eighth Bit; Eighth Bit On - Citizen 120D+ User Manual

Dot matrix printer
Table of Contents

Advertisement

ODDS AND ENDS
THE EIGHTH BIT
Some computers, most notably Apple ll's, send only seven
bits of information to their printer instead of the more
common eight bits. Since the standard ASCII character set
(ASCII 0 to 127) uses only seven bits for its codes, this
limitation isn't normally a problem.
But the 120D+ uses high-bit, or eight-bit, ASCII codes
(ASCII 128 to 255) for block and line graphics and many
other special characters. If you have a seven-bit computer,
you can print these high-bit characters on the 120D+ by
using the three commands described below.
Eighth bit on
BASIC
CHR$(27) " > "
Hex
1B3E
The command ESC > instructs the 120D+ to interpret all
subsequent codes as high-bit codes even if your computer
is sending seven- or low-bit codes. In effect, it adds 128 to
any ASCII code in the range of 0 to 127. Once your send
ESC > to the 120D +, the 120D + will continue to add 128
to any code it receives in the range of 0 to 127 until you tell
it to stop with the command ESC #.
The ESC > command can be turned off with either ESC =
or ESC #. The difference is that ESC # allows the 120D + to
receive all codes — whether seven-bit or eight-bit — as they
are sent from your computer. ESC = forces all codes to
their seven-bit value even if your computer sends eight bits.
Example:
10
l PRINT CHR* (27);
20
LPR I NT CHR*(27);
30
FOR N : = 65 TO 90
40
LPRI NT A$
50
LPRINT CHR*(27)j
60
LPRINT A*
70
LPRINT CHR* (27);
00
END
" ^jl'l" ;
"tl";
A$ = A* + CHR$(N>:
NEXT
" £ " .
AEC DEFGHIJKLMN0PQR 3 T UVV
v A
l i_
|..jj_|i.
JL-11-J
U_ L
T r!(- -||—inrnr-
U-L-
nr
En¬
in the program above, line 10 turn on the alternative
character set. Line 30 then prints A$, defined in line 20 as
ASCII codes 65 to 90, the codes for capital letters. Line 40
turns on the eighth bit and line 50 then prints A$ again,
this time defined as ASCII 193 to 218, the codes for
graphics and special characters from the alternative
character set.
114

Advertisement

Table of Contents
loading

Table of Contents