我没学过汇编语言,但是这个c语言也没弄好,求大佬帮我看一下问题出在哪了下面是我找的程序
ORG 0200H;程序起始地址 BEGIN:CLR P0.3;初始化 SETB P0.4; CLR P0.5; MOV P1,#0FCH; ORL P0,#00000111B; READY:JB P0.0,ARM; SJMP READY; ARM:JB P0.1,READY; CLR P0.4;布防 MOV P2,#0FFH; MOV A,P2; JZ ARM; JB Acc.0,AREA1; JB Acc.1,AREA2; JB Acc.2,AREA3; JB Acc.3,AREA4; JB Acc.4,AREA5; JB Acc.5,AREA6; JB Acc.6,AREA7; AREA8:MOVP1,#0FEH;8防区报警处理 LCALL ACTION;调用报警处理子程序 SJMP AREA8; AREA1:MOVP1,#60H; 1防区报警处理 LCALL ACTION; SJMP AREA1; AREA2:MOVP1,#0DAH;2防区报警处理 LCALL ACTION; SJMP AREA2; AREA3:MOVP1,#0F2H;3防区报警处理 LCALL ACTION; SJMP AREA3; AREA4:MOVP1,#66H;4防区报警处理 LCALL ACTION; SJMP AREA4; AREA5:MOVP1,#0B6H;5防区报警处理 LCALL ACTION; SJMP AREA5; AREA6:MOVP1,#0BEH;6防区报警处理 LCALL ACTION; SJMP AREA6; AREA7:MOVP1,#0E0H;7防区报警处理 LCALL ACTION; SJMP AREA7; CLEAR:CLR P0.5;清除报警信息 MOV P1,#0FCH; SJMP ARM; ACTION:SETB P0.5;报警处理子程序 CLR P0.4; LCALL DY1S; CLR P0.5; SETB P0.4; LCALL DY1S; JB P0.1,BEGIN; JB P0.2,CLEAR; RET; DY1S:MOV R5,#5;延时1S子程序 DYS0:MOV R6,#200 DYS1:MOV R7,#250; DYS2:DJNZ R7,DYS2 DJNZ R6,DYS1 DJNZ R5,DYS0; RET; END
|