The LX-80 has several different graphics densities, but we’ll keep things simple by using only one in the first exercises. The code for entering single-density graphics mode is ESCape “K” nl n2. In Mi- crosoft BASIC the command is given in this format:

L P R I N T CHR$(Z?)“K’*CHR$(Nl)CHR$(NZ);

ESCape “K” specifies single-density graphics, and the next two numbers (n, and n2) specify the number of columns reserved for graphics.

The graphics command requires more than one number to specify how many columns to reserve because as many as 1920 columns are possible in graphics printing. Since the LX-80 uses eight digit binary numbers, it can’t accept decimal numbers larger than 255. Therefore, the graphics mode command uses two numbers for reserving col- umns.

The number of columns reserved is the first number plus 256 times the second number. Since the command is set up for two numbers, you must supply two even if you only need one. When you need less than 256 columns, just make nt the number of columns you are reserving and make n2 a zero.

Pin Labels

Once you put the printer into graphics mode and reserve the number of columns you want, your next step is to tell the print head which pins to fire in each column. There are 256 possible combinations of eight pins, and you send only one number for each column. The numbering system that allows you to use a single number to specify which of the 256 possible patterns you want is shown in Figure 9-1.

76