The SQ-2000 uses the formula n1 + n2 X 256 to determine how many bytes of graphics data to expect. To determine the values of n1 and n2, given the number of dot columns of graphics data that you want to send, use the following formulas (where X is the number of columns of graphic data):

n1 = X mod 256 and

n2 = X\256 (where \ represents integer division)

For example, if you wish to send 1632 columns of graphic data, n1 would be 96 and n2 would be 6 (1632 = 96 + 6 X 256).

When you are using the 24-dot graphics options you must send three bytes of data for each dot column. Therefore, you refer to dot columns instead of bytes of graphics data when calculating nl and n2. (We will explain later how these three bytes are inter- preted.)

The SQ-2000 will interpret the number of bytes determined by n1 and n2 as graphics data, no matter what codes they are. This means that you must be sure to supply enough bytes of graphic data, or the SQ-2000 will stop and wait for more data, and will seem to be locked up. If, on the other hand, you supply too much graphics data, the excess will be interpreted and printed as regular text.

Using Hand-Calculated Data to Print Graphics

With what you know now, you can use the simplest application of graphics-using hand-calculated data to print graphic images. While this method is the most tedious of those that we will explore, it is useful for small graphic elements that are used many times. Also, it helps you to develop your understanding of dot graphics.

The first step is to figure out which dots you want to print. Start by sketching your design on a piece of graph paper as shown in Figure 6-4. The design in the illustration is only eight dots high for simplicity, but it could also use multiple print lines.

71