附件3:温度检测系统程序清单xxequ45hyyequ46horg0000hljmpmainorg0003hljmpinttorg0030hmain:setbit0;程序初始化,启动int0中断setbeasetbex0movr0,#30hmovr1,#01hmovr2,#14h;1低限初始值movr3,#0b4h;1高限初始值movyy,#14h;2低限初始值movxx,#0b4h;2高限初始值movr7,#00hmovdptr,#7fffhmova,r7movx@dptr,asjmp$intt:movxa,@dptrmov@r0,apushaccloop35:cjner1,#02,loop34acallb2sjmploop2loop34:acallb1loop2:incr0popaccpushaccacalldisp3;调用显示子程序popaccincr1movr7,#01hcjner1,#3h,kmov31h,amovdptr,#7fffhmovr7,#00hmovr1,#01movr0,#30hloop7:movc,p2.6jcloop8sjmploop20loop8:acallz;sjmploop7loop20:movc,p2.7jcloop21sjmploop35loop21:acallz1;调用通道2设置子程序sjmploop20k:movc,p2.0jcloop3sjmploop37loop3:acallx1;调用1路显示子程序loop37:movc,p2.1jcloop4sjmpk2loop4:acallx2;调用2路显示子程序k2:movdptr,#7fffhmova,r7movx@dptr,aretib2:setbp1.6;2通道与高低限值比较setbp1.7clrcmova,31hsubba,yy;jncloop1clrp1.6sjmploop36loop1:subba,xxjcloop36clrp1.7loop36:retb1:setbp1.6;1通道与高低限值比较setbp1.7clrcmova,30hsubba,r2;小jncloop;a值大,跳转clrp1.6;低于低限值报警ljmploop33loop:subba,r3;大jcloop33;a值小,跳转1clrp1.7;高于高限值报警loop33:retdisp3:movr5,aanla,#01hcjnea,#01h,loop6mova,r5subba,#1movb,#2divabmovb,#10divabmov63h,amov64h,bmov65h,#5mov62h,#0ahmov61h,#0ahmov60h,r1acalldisp1;调用小数显示acalltloop6:mova,r5movb,#2divabmovb,#100divabmov63h,amova,bmovb,#10divabmov64h,amov65h,bmov62h,#0ahmov61h,#0ahmov60h,r1acalldisp;调用整数显示acalltk5:retx1:mova,30h;固定1口显示movr1,#1acalldisp3movc,p2.0jcx1retx2:mova,31h;固定2口显示movr1,#2acalldisp3movc,p2.1jcx2rett:movtmod,#01h;延时1ssetbtr0movr6,#20k4:movth0,#3chmovtl0,0b0hjnbtf0,$clrtf0djnzr6,k4sjmpk5retdisp:movr0,#65hmovscon,#00Hmova,@r0movdptr,#SETTABmovca,@a+dptrmovsbuf,ajnbti,$clrti;movr0,#64hmova,@r0movdptr,#SETTABmovca,@a+dptrmovsbuf,ajnbti,$clrtimovr0,#63hmova,@r0movdptr,#SETTABmovca,@a+dptrmovsbuf,ajnbti,$clrtimovr0,#62hmova,@r0movdptr,#SETTABmovca,@a+dptrmovsbuf,ajnbti,$clrti2movr0,#61hmova,@r0movdptr,#SETTABmovca,@a+dptrmovsbuf,ajnbti,$clrtimovr0,#60hmova,@r0movdptr,#SETTABmovca,@a+dptrmovsbuf,ajnbti,$clrtiretSETTAB:DB42H,0F6H,13H,92H,0A6H,8AH,0AH,0F2H,02H,82H,0FFHdisp1:movr0,#65hmovscon,#00Hmova,@r0movdptr,#SETTAB1movca,@a+dprrmovsbuf,ajnbti,$clrti;movr0,#64hmova,@r0adda,#0bhmovdptr,#SETTAB1movca,@a+dprrmovsbuf,ajnbti,$clrtimovr0,#63hmova,@r0movdptr,#SETTAB1movca,@a+dprrmovsbuf,ajnbti,$clrtimovr0,#62hmova,@r0movdptr,#SETTAB1movca,@a+dprrmovsbuf,ajnbti,$clrtimovr0,#61hmova,@r0movdptr,#SETTAB1movca,@a+dprrmovsbuf,ajnbti,$clrtimovr0,#60hmova,@r0movdptr,#SETTAB1movca,@a+dprrmovsbuf,ajnbti,$clrtiretSETTAB1:DB42H,0F6H,13H,92H,0A6H,8AH,0AH,0F2H,02H,82H,0FFH,40h,0f4h,11h,90h,0a4h,88h,08h,0f0h,00h,80hz:movc,p2.5;第一通道设置jcloop9sjmploop10loop9:incr2incr2;低限加jncloop16jbp2.5,$loop10:movc,p2.4jcloop11sjmploop12loop11:incr3incr3jncloop16jbp2.4,$loop12:movc,p2.3jcloop13sjmploop14loop13:decr2decr2jncloop16jbp2.3,$loop14:movc,p2.23jcloop15sjmploop16loop15:decr3decr3jncloop16jbp2.2,$loop16:retz1:movc,p2.5;第二通道设置jcloop22sjmploop23loop22:incyyincyyjncloop29jbp2.5,$loop23:movc,p2.4jcloop24sjmploop25loop24:incxxincxxjncloop29jbp2.4,$loop25:movc,p2.3jcloop26sjmploop27loop26:decyydecyyjncloop29jbp2.3,$loop27:movc,p2.2jcloop28sjmploop29loop28:decxxdecxxjncloop29jbp2.2,$loop29:ret4