INT1:MOV A,P0
MOV R0,#51H
MOV @R0.A
SETB F0
RETI
ENDD: NOP
NOP
END
3.4子程序清单
3.4.1心跳子程序:
XIN:NOP
BEGIN:MOV R0,#43H
MOVA,#0H
MOV @R0,A
www.751com.cn
MOV TL1,#A0H
MOV THD,#0FCH
MOV TL0,#18H
CLR P3.5
MOV IE,#88H
SETB TR1
SETB TR0
LOOP:JNB,TF0,$
CLR TF0
JBC F0,ELSE
SETB P3.5
MOV TH0,#0FCH
MOV TL0,#18H
CLR P3.5
SJMP LOOP
ELSE:MOV R0,#43H
MOV A,@R0
MOV B,#100
DIV AB
MOV R0,#40H
MOV @R0,A
MOV A,#10
XCH A B
DIV AB
MOV R0,#41H
MOV @R0,A
MOV A,B
MOV R0,42H
MOV @R0,A;延时一分钟
SHOW:MOV A,@R0
MOV R0,#41H
MOV A,@R0
MOV R0,#42H
SWAP A
XCHD A,@R0
MOV DPTR,#BFFFH
MOVX @DPTR,A
MOV R0,#40H
MOV A,@R0
MOV DPTR,#7FFFH
MOVX @DPTR,A;显示心跳
MOV R0,#43H
MOV A,@R0
MOV R2,A
SUBB A,#100
JC BAOJING;C=1,BAO
MOV A,R2
SUBB A,#60
JNC BAOJING;C=0,BAO
SJMP HHH
BAO:LCALL BAOJING
RET
HHH:JNB P1.6,ENDDDD
SJMP BEGIN
ENDDDD:RET
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>