07.12.2015 Views

Microcomputer Graphics

myers-1982-microcomputer-graphics

myers-1982-microcomputer-graphics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

26 <strong>Microcomputer</strong> <strong>Graphics</strong><br />

The FOR loop beginning in line 30 references memory locations<br />

8192, 9216, 10240, 11264, 12288, 13312, and 14366. The contents of<br />

these memory locations are displayed below one another at the top left<br />

corner of the screen . As a result of the loop in lines 30 through 70, the<br />

contents of these memory locations will be as follows:<br />

Memory Location Bit Pattern (reversed) Display<br />

Decimal<br />

Binary<br />

8192 8 0001000<br />

9216 20 0010100<br />

10240<br />

11264<br />

34<br />

34<br />

0100010<br />

0100010<br />

12288 62 0111110<br />

13312 34 0100010<br />

14366 34 0100010<br />

Figure 2.6<br />

As the contents of these memory locations are displayed on the screen,<br />

they create the image of the letter "A."<br />

The discussion above suggests a means by which text may be displayed<br />

on the graphics screen easily. More detail will be given in Chapter<br />

3. For the present, we will identify procedures that define additional<br />

characters.<br />

Map the character or symbol on a grid; 7 x 7 works well. For example,<br />

to obtain the letter "Z," convert each of the bit patterns to a<br />

number code, as has been done in Figure 2. 7. Then POKE the bit pattern<br />

into memory. Memory locations may be identified from Figure<br />

2.4.<br />

To continue the example, we may display the symbols "A" and<br />

"Z" side-by-side in the top left corner of the screen using Program<br />

2.2.<br />

Program 2.2: BIT PATTERN CHARACTERS<br />

1 REM PROGRAM 2.2 (BIT PA TTERN CHARAC TERS)<br />

2 REM PLAC ES LETTERS A AN D Z ON THE HI RES<br />

SC REEN

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!