40

That’s the printer’s bell (we call it that even though it sounds like a buzzer). We’ll learn more about it in later – we just wanted to show you a control code that would get your attention right away!

There are four common ways of referring to a control code: the name of the code or its abbreviation, the decimal ASCII value, the hexadecimal ASCII value, and the “CTRL-” value. For example, the ASCII code that causes the printer to advance the paper one line is decimal 10. This code may be referred to by any of the following:

line feed

the name of the code

(LF)

its abbreviation

ASCII 10

its decimal value

ASCII &HOA

its hexadecimal value (the &H signifies

 

 

hex)

CHR$(1O)

the way it’s used in BASIC

CTRL-J

the way you send it from a keyboard

Of course, most of the time we don’t need to bother with these. The computer is smart enough to know that when we press the “A” key we want to print the letter “A” – it takes care of all the intermediate steps.

Appendix B is a table that shows the various names for each code so you can convert back and forth. The microcomputer world is not very consistent in describing ASCII codes, so it’s important that you have a basic knowledge of them.

H The escape codes

Back when the ASCII system was set up, computer equip- ment was relatively simple and thirty-three control codes were considered sufficient at the time. The American Standards peo- ple realized that eventually more control codes would be need- ed, so they included the escape (ESC) code to allow almost any number of additional codes to be defined when they became necessary.

ESC allows us to “escape” from the ordinary set of control codes so we can specify additional functions and other informa- tion needed for a printer function. In this manual, we’ll write the ESC code inside broken brackets, like this – (ESC).

(ESC) – decimal 27 – is always followed by at least one other number; it is never used alone. The whole series of related

Page 48
Image 48
Star Micronics NX-15 user manual Ascii &HOA, Ctrl-J