Intel MCS48 User Manual page 144

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

Advertisement

APPLICATION
EXAMPLES
BINARY MULTIPLY
BMPY:
MOV
R3,#08H
BMPI:
BMP3:
CLR
A
CLR
C
RRC
A
XCH
A,R1
RRC
A
XCH
A.R1
JNC
BMP3
ADD
A,R2
DJNZ
R3.BMPI
RRC
A
XCH
A,R1
RRC
A
XCH
A,R1
SET
COUNTER TO
8
CLEAR A
CLEAR CARRY
BIT
DOUBLE
SHIFT
RIGHT
ACC
&
R1
INTO
CARRY
IF
CARRY=1
ADD,
OTHERWISE
DON'T
ADD
MULTIPLICAND
TO
ACCUMULATOR
DECREMENT COUNTER AND LOOP
IF
DO
A
FINAL
RIGHT
SHIFT
AT THE
END OF THE ROUTINE
INTERRUPT HANDLING
This
interrupt routine
assumes
single
level
interrupt.
The
purpose
is
to store
the
status of
the
machine
at
the time the
interrupt
occurs
by
storing
contents
of
all
registers,
accumu-
lator,
and
the
status
word. At the
end
of
the
interrupt
the
state of
the
machine
is
restored
and
interrupts
are
enabled
again.
INTRPT:
SEL
MOV
i
i
MOV
MOV
RETR
RB1
;SAVE
WORKING
REGISTERS
@R0,A
;R0
IN
ALTERNATE
REGISTER
BANK CONTAINS SACC
POINTER
FOR SAVING
ACCUMULATOR
j
[INTERRUPT SERVICE
i
^ROUTINE
RO.SACC ;RESTORE
SACC
A,@RO
;RESTORE
ACCUMULATOR
RESTORE
WORKING
REGISTERS
RESTORE PSW
AND
RE-ENABLE INTERRUPTS
5-24

Advertisement

Table of Contents
loading

Table of Contents