51單片機(jī)的315M發(fā)射頭發(fā)送匯編程序
;----------------------------------------------------------------
;5s時(shí)間子程序和電源電壓監(jiān)測(cè)中斷處理程序
INTT0:CLR TR0 ;關(guān)計(jì)數(shù)器T1
LOP1: POP PSW ;PSW出棧
;----------------------------------------------------------------
;以下電源電壓檢測(cè)程序
;----------------------------------------------------------------
DYJC1:JB DYJC,LOP3 ;檢測(cè)電源電壓
LOP2: ACALL DIDI
LOP3: RET
;----------------------------------------------------------------
;以下為報(bào)警子程序
;----------------------------------------------------------------
;DI聲報(bào)警子程序
DIDI: MOV 20H,#0F0H ;DI聲提示音
L111: SETB SPK1 ;開(kāi)喇叭
L222: MOV R2,#08H ;
S00EB:PUSH 02H ;R2(復(fù)位后R2即為02H)存放時(shí)間常數(shù),進(jìn)棧保護(hù)
L00ED:PUSH 02H ;R2進(jìn)棧保護(hù)
L00EF:PUSH 02H ;進(jìn)棧
L00F1:DJNZ R2,$ ;R2不為零等待
;----------------------------------------------------------------
;以下為延時(shí)子程序
;----------------------------------------------------------------
;延時(shí)子程序
YS1: MOV R6,#0FFH
Y11: MOV R7,#0FFH
Y12: NOP
;----------------------------------------------------------------
YS2: MOV R5,#08H ;中長(zhǎng)時(shí)間延時(shí)
Y20: MOV R6,#0FFH
Y21: MOV R7,#0FFH
Y22: NOP
;----------------------------------------------------------------
YS3: MOV R5,#50 ;長(zhǎng)長(zhǎng)時(shí)間延時(shí)
Y30: MOV R6,#0FFH
Y31: MOV R7,#0FFH
Y32: NOP
評(píng)論