1.2.3 Control codes
The ASCII table shows symbols like.Jor2 the way they actually print on the
laser printer. But ASCII includes more than just printable characters: none
of the control code commands at the beginning of the table actually print.
Instead,when yourcomputer sendsacontrolcodetothelaserprinter itmakes
your printer do other things, such as sound its beeper.
Control codes mostly handle communications between your computer and
the printer at the lowest level,atcable level. For example, a couple of control
codes make sure the printer lmjfer (your printer’s storage memory) doesn’t
overflow. In this book we’ll indicate control codes enclosed by angle
brackets to their abbreviations in the table: <FF> means the Form Feed
control code, which advances the printer to the next page-justas the [PRINTI
button does.
1.2.4 Escape sequences
Control code 27, <ESC> or Escape, is a particularly important one for
printers. To tellyourprinter allthethingsyou might need— settingmargins,
saying where to print, choosing a particular font, startinggraphics and so on
— requires many more than just two or three dozen control codes. So the
<ESC> control code has a special meaning: <ESC> means “the next
character specifies a command, not something to be printed”.
Therefore if you send just the chara$ter:
to the printer it will print a J and
that’s all. But if you send the <ESC> code just before the c then the printer
will switch over to print self test. Extending the control codes this way gives
you many more commands to control your printer. In fact, these “Escape
sequences” make up most of the Star Laser Printer’s language.
In this book we’ll leave spaces between characters when we show escape
sequences. You’ll find
<ESC>
(S OP IOh
a bit more readable than
12vos 3T
<ESC>
(sop IOh12vOS3T
8