INSTRUCTION SET
INIT: MOV R7,A
SEL
RB1
MOV R7,#OFAH
SEL
RBO
MOV A,R7
RETR
;MOVE
ACC
CONTENTS TO
;LOCATION
7
;SELECT REG
BANK
1
;MOVE 'FA' HEX TO
LOCATION
31
;SELECT REG
BANK
0
;RESTORE ACC FROM
LOCATION
7
;RETURN -
RESTORE PC AND PSW
STOP
TCNT
Stop Timer/Event-Counter
10110101011
This
instruction
is used
to
stop
both time
accumulation
and event
counting.
Example: Disable interrupt,
but
jump
to
interrupt
routine after
eight
overflows and
stop
timer.
Count
overflows in
register
7.
START: DIS TCNTI
CLR A
MOV T,A
MOV R7,A
STRT T
MAIN: JTF
COUNT
JMP
MAIN
COUNT: INC
R7
MOV A,R7
JB31NT
INT:
JMP
MAIN
STOP
TCNT
JMP
7H
Mnemonics
copyright
Intel Corporation
1976.
;DISABLE TIMER INTERRUPT
;CLEAR ACC TO ZEROS
;MOVE ZEROS TO TIMER
;MOVE ZEROS TO
REG
7
;START TIMER
;JUMP TO ROUTINE 'COUNT'
;IF
TF=1
AND CLEAR TIMER FLAG
;CLOSE LOOP
;INCREMENT
REG
7
;MOVE REG 7 CONTENTS
TO
ACC
;JUMP TO ROUTINE 'INT' IF
ACe
;BIT
3 IS SET (REG
7=8)
;OTHERWISE RETURN
TO
ROUTINE
;MAIN
;STOP TIMER
;JUMP TO LOCATION 7 (TIMER)
;INTERRUPT ROUTINE
4-33