Intel MCS48 User Manual page 115

Family of single chip microcomputers
Hide thumbs Also See for MCS48:
Table of Contents

Advertisement

INSTRUCTION SET
INIT:
MOV
R7.A
SEL
RB1
MOV
R7,#0FAH
MOVE ACC CONTENTS TO
LOCATION
7
SELECT REG
BANK
1
MOVE
'FA'
HEX
TO LOCATION
31
SEL RBO
MOV
A,R7
RETR
SELECT REG
BANK
RESTORE
ACC FROM
LOCATION
7
RETURN
RESTORE PC AND
PSW
STOP TCNT
Stop Timer/Event-Counter
Example:
110
10
1
This
instruction
is
used
to
stop both time
accumulation
and
event counting.
Disable
interrupt,
but
jump
to interrupt
routine
after
eight
overflows
and
stop
timer.
Count
overflows
in
register
7.
START:
MAIN:
DISTCNTI
CLR A
MOV
T,A
MOV
R7,A
STRTT
JTF
COUNT
JMP
MAIN
COUNT:
INC R7
MOV
A,R7
JB3
INT
JMP
MAIN
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
ACC
BIT
3
IS
SET
(REG
7=8)
OTHERWISE RETURN TO ROUTINE
MAIN
INT:
STOP TCNT
JMP
7H
STOP
TIMER
JUMP TO LOCATION
7
(TIMER)
INTERRUPT ROUTINE
Mnemonics
copyright
Intel
Corporation
1976.
4-33

Advertisement

Table of Contents
loading

Table of Contents