Mini-Billboard

See all articles from SYNC v1 n4

If you have spent much time looking at the schematic for your ZX80 or MicroAce, and if you have had the opportunity to compare it with schematics for other home computers, you probably have noticed that there are considerably fewer parts. This is due to the efficiency of circuit design in several areas. One of these areas involves the absence of separate character generator ROMs in the video circuitry.

The character generator is contained in the same ROM that holds the Basic interpreter. Sixty-four eight byte blocks are located in addresses 3584 to 4095 (0E00 to 0FFF hex). While the ZX80 is in the video display mode, the CPU is addressing these memory locations and loading the data into IC9 (U10 for MicroAce). This data transfer is parallel, or eight bits at a time. The data is then shifted serially, or one bit at a time. These bits go to the video modulator which causes either light or dark spots on screen, depending on whether the bit is a “one” or “zero.” The IC21 (U14) keeps track of which byte is to be addressed by counting up to eight horizontal sync pulses to determine which of the eight horizontal lines for each character is being displayed.

You can examine each of the 64 characters in more detail by using the following program.

 10 INPUT A$
20 LET A=(CODE(A$)*8)+3584
30 FOR X=0 TO 7
40 LET C=PEEK (A+X)
50 FOR Y=0 TO 7
60 LET E=2**(7-Y)
70 IF C=E OR C>E THEN GO TO 100
80 PRINT " ";
90 GO TO 120
100 LET C=C-E
110 PRINT CHR$(128);
120 NEXT Y
130 PRINT
140 NEXT X
PRESS RUN and NEWLINE. Then press
any key and NEWLINE.
TV screen showing "READ SYNC" in large block letters
TV screen showing "READ SYNC" in large block letters

Press RUN and NEWLINE. Then press any key and NEWLINE.

Line 20 converts the character A$ into the address of the first byte for that character in ROM. Line 40 sets C equal to the decimal value of that byte which is between 0 and 255 inclusive. In the first pass of the FOR-NEXT loop in lines 50 to 120, C is examined to determine if the most significant bit (MSB) of the data is a “one” or a “zero.” If the MSB is a “zero,” a space is printed. If the MSB is a “one,” an inverse space is printed. In the next pass, the second most significant bit is examined and printed. The last pass will examine and print the least significant bit.

After eight bits have been printed, line 130 causes a new line so the next byte can be printed directly below the first. The FOR-NEXT loop in lines 30 to 140 causes eight bytes from sequential addresses to be printed.

The addition of another FOR-NEXT loop, an array, and some other modifications to this program allows us to print an eight character string on two rather large lines to create a “Mini-Billboard” on the TV screen.

Mini-Billboard

  5 DIM A(8)
10 INPUT A$
15 FOR I=1 TO 8
20 LET A(I)=(CODE(A$)*8)+3584
21 LET A$=TL$(A$)
23 NEXT I
25 LET F=1
27 LET L=4
30 FOR X=0 TO 7
35 FOR I=F TO L
40 LET C=PEEK (A(I)+X)
50 FOR Y=0 TO 7
60 LET E=2**(7-Y)
70 IF C=E OR C>E THEN GO TO 100
80 PRINT " ";
90 GO TO 120
100 LET C=C-E
110 PRINT CHR$(128);
120 NEXT Y
130 NEXT I
140 NEXT X
150 LET F=F+4
160 LET L=L+4
170 IF L=8 THEN GO TO 30

Press RUN and NEWLINE. Then enter READ SYNC (or any two four letter words) and NEWLINE.

You probably noticed we no longer need a PRINT statement in line 130 since four groups of eight characters are now printed in a line which will cause an automatic new line by coming to the end of a 32 character line. If you want to use a different graphic, change the number in line 110. Try also 7, 136, 8, and 223.

So now you have a program which will print two large, four letter words on your TV screen. This may lead to some interesting suggestions from your friends, but have fun with it anyway.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.