Printer Codes The Inside Story

The following major article on Radio Shack printer drivers and printers is running this month instead of the usual Product Line Manager pages for Model I/III, Model II, and Peripherals. These pages will return as usual in June.

Last month in the Peripherals article we gave you some introductory information about Radio Shack line printers and how the Models I and III handle information which is sent to printers. We also discussed the LPC/CMD program which is required by certain programs when they are used with newer Radio Shack printers. This month we would like to show you what happens when you "tell" the computer to print something on a lineprinter, and be more specific about the exact responses you can expect from the various Radio Shack line printers.

The reasons we want to do this is to help clear-up some misunderstandings, and to give serious programmers information which may help them write programs that perform as the programmer expects them to.

Our discussion will cover several main points:

1) What happens in the printer driver

2) What happens between BASIC and the driver

3) What happens at the printer

Anatomy of a Printer Driver

What is a Printer Driver? That little beast is a machine language routine used by the computer to send individual characters to a printer. This driver is used whether you want to send a character, a word, or a book to the line printer. The computer sends all information one character at a time. There is a certain amount of communication (via the status bits) between the computer and the printer so that the computer will not send characters faster than the printer can deal with them.

We will give you general information for each of the computers Model I, II, and III. Please note that the sequence may not match the exact steps that the computer follows, however the ideas are what is important.

We will use decimal code values, in particular:

10 (OAH) represents a Line Feed (LF)

11 (OBH) represents a Vertical Tab (VT)

12 (OCH) represents a Form Feed (TOF)

13 (ODH) represents a Carriage Return (CR — Which in a

Standard Radio Shack printer is a new line (NL). Each time the printer executes a CR, it also executes a line feed LF).

Also, the following words are defined: Increment—add one to the current contents of the particular memory location and put the new value into that memory location.

Set or Reset — Place the value indicated into the memory location indicated. In addition, there are two addresses in the Model I and four (the two from Model I plus two more) in the Model III which we need to be aware of:

16424—The maximum number of lines, plus one, to print on a page.

16425—The number of lines already printed on the current page (plus one in the Model III).

16426 — (Model III only) The number of characters already printed on the current printer line^

16427 — (Model III only) The maximum number of characters to print on each printer line.

Model I/III Memory Locations


0 0

Post a comment