Product specifications
LD (DE),A
JP C,SEVCL7
DEC DE
DEC HL
DJNZ SEVCL3
JP SEVCL7 ;Goto routine exit at this point
;
SEVCL5: CP 2
JP NZ,SEVC5D ;Has set a time option been
;selected at this point
;If condition true then drop
;through SEVC5A else goto
;SEVC5D
;
SEVC5A: LD HL,TIMSET ;Set clock to specific time held
;in table TIMSET and then
LD DE,CLOCK ;goto SEVCL7 and exit routine
LD BC,7
LDIR
LD A,0 ;Reset option select control
LD (CLRCLK),A ;variable to zero
JP SEVCL7
;
SEVC5D: LD HL,CLOCK ;Clear clock option selected at
LD A,30H ;this point here
LD B,7 ;Fill table CLOCK with ASCII 0,s
SEVCL6: LD (HL),A ;and then exit routine
DJNZ SEVCL6
LD A,0 ;Reset option select control
LD (CLRCLK),A ;variable to zero
;
SEVCL7: (End of routine)
The following section of code illustrates the use of the above routine. It uses a table
called STATIM (Start time), which contains the start time for this section of code.
;
SAMPLE: LD A,1 ;Select clear clock option
LD HL,STATIM ;Transfer clock start time
LD DE,TIMSET ;from table STATIM to table
LD BC,6 ;TIMSET
LDIR
LD A,2 ;Select clock reset option
LD (CLRCLK),A ;and update clock with new value
;contained within table TIMSET
RET ;Return to calling routine
;
Another useful routine which can be used within the code described in 3.2 is a random
number routine.
Each time you require a random number (8 bit value), it is only necessary to look at
the location RND to extract a new value. This will be constantly updated under
interrupt by the interrupt routine RANDOM.