Most computers, printers, and peripheral devices understand
specific types of codes known as ASCII codes. ASCII (pronounced
“ask-key”) stands for the American Standard Code for Information
Interchange. This standard code provides a common ground for
computers and related devices to “talk” to each other, and transfer
data in a way that each can understand. And though there is an
ASCII code for each letter, number, and symbol that we use(please
see Appendices C and E) you will probably not need to know them
for your day-to-day applications. However, you will want to use ASCII
codes to activate the special functions of your printer, so let’s take
a closer look at how they work.
Each ASCII code is available in a number of different forms for
programmers and software writers, as well as for those of us whose
main applications are word processing and spreadsheets. For ex- -
ample, the code for each different function can be entered in both
its decimal and hexadecimal forms, as shown in Table 2-l below.
Table 2-1. Examples of decimal and hexadecimal codes.
FUNCTION DECIMAL CODE HEXADECIMAL CODE
Select the Draft-
Quality Mode 27 53 1B 35 I
Decimal codes
The decimal code is a common representation of ASCII codes,
and is used mainly for writing programs in BASIC. Decimal codes
are so named because their values are expressed using the
decimal-or “base IO”-numbering system. Although you may not
need them very often, we have included the decimal codes for each
of the printer’s functions, and you can find them in Appendix A of
this manual.
-
If you are writing in BASIC, you will notice that we also provide _
the complete BASIC command used to “capture” each decimal code
using the character string function, or CHR$. (For an in-depth look
at programming in BASIC, please turn to Section 6.)
Hexadecimal codes
The name for the hexadecimal code comes from its expression
using the hexadecimal-or “base 16”-numbering system. Hexa-
decimal codes are used mainly by assembly language programmers,
but they can come in handy when you’re “installing” any one of the
printer’s functions into your word processing program. For example,
if you use any other form of ASCII code as you install the “activate
superscript” function into WordStar, your software will respond by
displaying on your screen the equivalent of the code in its hexa-
decimal form. Then, comparing the hexadecimal va!ue on the screen
18 -