256 COLUMNS
VDTTB 1 +1 VDTTB 1 + 31
+6
VDTTBI +0 1141 1114111111[1 Jill I I I 11111jil
ROW 0
+32
1
+64 1
2
+96
256
LINES
MEMORY TABLE
MAPPED TO VDT
SCREEN 8192
BYTES - 64K BITS
T
VDTB1+8191
ROW 255
I O1OV
0 ^____ ___ _ _____________
O
L
L
0
0
5
V
DTTB
1+6
5
BYTE
BIT FOR ROW 0, COL 55
1-81T FOR ROW 0, COL48
Fig. 12- 7. VDT bit map for 64K pixels.
memory and can be on (white) or off (black). The first line is rep-
resented by the data at VDTTB1 through VDTTB1+31, each byte
holding eight pixels worth of data. The entire 8K bytes (64K bits)
is output to the VDT by direct memory access of the VDTTB1 data
by the electronics in the VDT controller. The display program will
continually update the display buffer VDTTB1 to change the dis-
play. For display of plots and other data, it is convenient to address
the pixels by row, column representation. The pixel in the upper left-
hand corner is 0,0 (row 0, column 0), the pixel in the upper right-
hand corner is 0,255, the pixel in the lower left is 255,0, and the pixel
in the lower right corner is 255,255. The problem is to convert a pixel
address from row, column representation to the actual bit address
and access the bit in VDTTB1 to test the current value, set the bit,
or reset the bit to change the display. The following examples are
three portions of the program. Data is passed to the programs in the
A register and B register, A representing the row and B the column.
The set and reset programs simply set or reset the required pixel.
The test passes back an argument representing the current value of
the pixel in the Z flag, Z=0 for on (white), and 1 for off (black).
THIS ROUTINE TESTS THE VALUE OF A PIXEL
TESTPX LD C,46H LOAD SKELETON (BIT)
JUMP CALL GTADD GET ADD IN HL, BIT # IN A
185
Need help?
Do you have a question about the Z80 and is the answer not in the manual?