Radio Shack TRS-80 Operation Manual page 93

Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

Computer Graphics
Operation Manual
- - - - - - - - - - T R S · B O
® - - - - - - - - - -
on the 5th dot on the top row, the registers would contain:
X
POSITION=~,
Y
POSITION=~,
DATA=(~~~~1~~~)=~8H.
Note that
in calculating points to plot, the Y-position
is
correct
for a single dot. Only the X-position must be corrected to
compensate for the byte addressing. This can be
accomplished in a simple subroutine.
Line Drawing Options
There are two 8-bit counters which act as latches for the
X- and Y-address. You may select, through the options
register, if they are to automatically count after a read
or write to graphic memory. Also, the counters may
increment or decrement independently. These counters do not
count to their respective endpoints and reset. Instead,
they will overflow past displayable video addresses.
Therefore, the software should not allow the counters to go
past 79 and 239. However, these extra memory locations may
be used for data storage.
Examples
The following are brief examples on how to use the Graphics
Board.
Read the video byte at
X=~, Y=~
XOR
OUT
OUT
IN
A
(8~H)
,A
(81H),A
A,(82H)
iCLEAR A
iOUTPUT X ADDRESS
iOUTPUT Y ADDRESS
iREAD VIDEO BYTE
Draw a line from
x=~,Y=~
to X=639,
Y=~
using the hardware
line drawing
LD
B,79
iB HAS CHARACTER COUNT
LD
A,~BIH
iOPTIONS:INCREMENT X AFTER WRITE
il~ll~~~l
Binary
OU'1'
(83H),A
XOR
A
OUT
(8~H),A
iOUT X ADDRESS STARTING
OUT
(81H),A
iOUTPUT Y ADDRESS
LD
A,~FFH
iLOAD A WITH ALL DOTS ON
LOOP
OUT
(82H),A
iOUTPUTo DOTS
DJNZ
LOOP
iOUTPUT NUMBER IN B REGISTER
- - - - - - - - - l I a d l o l l l a e l l - - - - - - - - -
-115-

Advertisement

Table of Contents
loading

Table of Contents