Instruction manual

.
At
this point I will give a
brief
description
of
the BASIC program,
ex-
plaining the unique features. This will
give the user
abetter
understanding of
how
the
graphic characters can be utiliz-
ed
in other programs, such as games,
clock programs, etc.
In
the BASIC pro-
gram at line
30,
a jump to subro\Jtine at
line2900 will load a machine language
subroutine in user memory. that will be
used for an ultra-fast screen erase when
needed by the Main Line BASIC pro-
gram. The Machine Language object
code for the fast screen erase routine is
stored in DATA statements at lines
3000
through 3030.
This data is
readwith
a REAOs1ate-
ment and POKEd
into
user memory at
12264 decimal through 12287 decimal.
This corresponds with 2FE8 Hex through
2FFE Hex. The machine code routine
when executed with the BASIC program
will clear the last two pages
ofscr-een
memory (that is, the bottom half
of
the
C1p's monitor screen). This was done so
that
the user could utilize the top half for
displaying a message and have it remain
until
the
need
to
erase that half
of
the
screen is desired. After the machine
code is loaded into user memory, a
RETURN
from subroutine will
be
ex-
ecuted and the program will return to
line
40,
where the
USR
vector will
be
in-
itialized
to
point
to
the beginning
of
the
fast screen routine in user memory.
rhe
USR
vector locations in the
C1
Pare
located at
11
and
12
decimal or 0
Band
OC
Hex.
At
line
50
a random number is
generated and stored in the R variable.
The statements at lines 55 and
56
insure
that
the random number will
be
only 0
through
10.
The statement at line 60 will
execute the fast screen
erase. This is the
USR
function
of
BASIC, which causes a
jump
to
the
USR
Vector at
11
and
12,
where the jump
to
the fast screen erase
is located. After the fast screen erase
routine has been executed and the
Op
code Hex
60
is reached in the machine
code routine, a return
to
BASIC will
be
executed and continue at line
65.
The
program forms line
65
through
165,
is a
table where the random number from the
random number generator is compared
to
fixed constants.
If
the random number
equals any of the constants, a jump
to
the subroutine .that generates that
number will occur. At line
170,
the
FOR-
N:EXT
loop will allow the last generated
video display to
be
viewed for the period
of
time that was set in the loop. The
statement in line
180,
calls up the fast
screen erase machine code routine. The
statement at line
190
forces a new pass
through the mainline program.
From the program listing, you will
see that the formation of the video
graphics
digits
are developed in
subroutines. These subroutines begin at
Listing 2
1 IWii lJilli,B.,;k GlliU:'lJICS DEMO!ISTRATOR
2 lWI.
BY
\I.L.
TAYLOR
3
REK
JULY
4
1979
5
}IUN~
"
TilL
IS
A DEl"ONSTRATION"
10
Pl\INT
"
O~'
TilE
C1P
GMPHICS
.AND LARGE NU1:BERS"
20
btiliT
" ALl. NUI'uBllliS
FRO~
1
TO
10
WnL
BB
DISPLAYED"
30 GOSUb
2900
39
~Ii
INITIALI~J:;
USR
VECTOR
FOR
JUIi,P
TO
2FE8
40
FOKE
11,232:
POKE
12,47
49
Iill
•.
GEN,:;RATE
lUNDOwl
NUiI,BER
FROM
0
TO
10
50 R=
INT«11+1)*RNll(1)-1)
52
Rcl;,
COII·PARE
RANDOJi'
NUMBER
AND
JUMP
TO
LARGE NutiBEB.""l'ABLE
55
E'
3.>~1
'l'l!EN
50
56
IF
R
<'
~
'rll~
50
59
Ru.
EXECUTE
r'AS'f
SCREJili
.rIRASE
60
..(=USR(X)
65
IF
R=
11
'l'.,EN
GOSUB
1900
67
H'
'R=
11
'l';LE;~f
iIOU:iB
1000
70
IF
R=
1
THEN
GOS-UB
1000
80
IF
R= 2
THEN
GOSUB
1100
90
IF
R=
:3
THEN
GOSUB
1200
100
IF
R=
4
'HEN
GOSUB
1300
110
H'
R= 5
":LEN
GOSUB
1400
120
IF
R= 6
THBN
GOSUB
1500
130
H'
H= 7
THEN
liOSUB
1600
140
IF
R=
8
THEN
GOSUB
1700
150
H'
R= 9
'IHE.'l
GOSUB
1800
160
If
R=
10 'l'HBN GOSUl
1900:
GOSUB
2000
165
IF
H=
0
THEN
GOSUB
2000
170
FOR
1=
1
TO
1000:
NEXT I
180
X=
USR(X)
190
GOTO
50
999
REN
GENEllATE
LSD
1000
FOR
A=
54000
TO
5412£
S~EP
32
1010
POKE
A,161:~~T
A
1020
RETURll
1099
REM
GENERATE
LSD
2
1100
FOR
A=
54000
TO
54002
1110
POKE
A,161:
NEXT A
1120
POKE
54034,161
1130
FOR.£=
54064.'1'0
54066
1140
POJU:
A,161:
NEl.T
A
1160
POKE
54096,161
1170
FOR
A=
54128
TO
54130
1180
POKE
A,161:
NEXT A
1
190
RETUllli
1199
liEU GENERATE
LSD
3
1200
FORA=
54000
TO
54002
1210
POKE
A,161:
NEXT A
1220
FOR
A=
54064
10
54066
1240
POKE
A,161:
NEXT A
1250
POKE
54098,161
1260
PaR
A=
54128
TO
54130
1270
POKE
4,161:
NEXT A
1280
RETUBfll
1299
lWi
GENERATE
LSD
4
)
)
December, 1979
MICRO -.., The 6502 Journal
19:63