多中斷源識(shí)別電路
右圖為多中斷源識(shí)別電路,分別按下S1、S2、S3、S4在7段數(shù)碼管上分別顯示其編號(hào)1、2、3、4。
ORG 0000H
AJMP MAIN
ORG 0003H
AJMP INTT0
ORG 0030H
MAIN: MOV P1,#00H
SETB EA
SETB EX0
SETB IT0
AJMP $
INTT0: JB P1.0,NEXT1
JB P1.1,NEXT2
JB P1.2,NEXT3
JB P1.3,NEXT4
NEXT1: MOV P0,#0F9H
RETI
NEXT2: MOV P0,#0A4H
RETI
NEXT3: MOV P0,#0B0H
RETI
NEXT4: MOV P0,#99H
RETI
END
評(píng)論