| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 191 人关注过本帖
标题:求助师傅们,这个程序有没有问题啊?
只看楼主 加入收藏
lchao_boy
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-6-22
结帖率:0
收藏
 问题点数:0 回复次数:0 
求助师傅们,这个程序有没有问题啊?
ORG   00H
 START:
          MOV   P0,#00H
          MOV   R0,#2
          CLR   P2.7
 SETTING:
     CHK_0:
          JB    P1.0,CHK_1
          CALL  FILTER
          JNB   P1.0,$
          MOV   R1,#0
          JMP   TIMERSET
     CHK_1:
          JB    P1.1,CHK_2
          CALL  FILTER
          JNB   P1.1,$
          MOV   R1,#1
          JMP   TIMERSET
     CHK_2:
          JB    P1.2,CHK_3
          CALL  FILTER
          JNB   P1.2,$
          MOV   R1,#2
          JMP   TIMERSET
     CHK_3:
          JB    P1.3,CHK_4
          CALL  FILTER
          JNB   P1.3,$
          MOV   R1,#3
          JMP   TIMERSET
     CHK_4:
          JB    P1.4,CHK_5
          CALL  FILTER
          JNB   P1.4,$
          MOV   R1,#4
          JMP   TIMERSET
     CHK_5:
          JB    P1.5,CHK_6
          CALL  FILTER
          JNB   P1.5,$
          MOV   R1,#5
          JMP   TIMERSET
     CHK_6:
          JB    P1.6,CHK_7
          CALL  FILTER
          JNB   P1.6,$
          MOV   R1,#6
           JMP   TIMERSET
     CHK_7:
          JB    P1.7,CHK_8
          CALL  FILTER
          JNB   P1.7,$
          MOV   R1,#7
          JMP   TIMERSET
     CHK_8:
          JB    P2.1,CHK_9
          CALL  FILTER
          JNB   P2.1,$
          MOV   R1,#8
          JMP   TIMERSET
     CHK_9:
          JB    P2.2,CHK_AGAIN
          CALL  FILTER
          JNB   P2.2,$
          MOV   R1,#9
          JMP   TIMERSET
     CHK_AGAIN:
          JMP   CHK_0

 TIMERSET:
          DJNZ  R0,LSB
          JMP   MSB
       LSB:
          MOV   30H,R1
          JMP   SETTING
       MSB:
          MOV   A,R1
          SWAP  A
          ADD   A,30H
          MOV   31H,A
          MOV   P0,A
 CONFIRM:
        OK:
          JB    P2.3,CANCEL
          CALL  FILTER
          JNB   P2.3,$
          MOV   A,#00H
          JMP   TIMING
    CANCEL:
          JB    P2.4,OK
          CALL  FILTER
          JNB   P2.4,$
   RESTART:
          JMP   START
 TIMING:
          MOV   P0,A
       MIN:
          MOV    R0,#60
       SEC:
          MOV   R1,#10
    SEC_10:
          MOV   R2,#200
          CALL  DELAY
          DJNZ  R1,SEC_10
          DJNZ  R0,SEC
          ADD   A,#1
          DA    A
          CJNE  A,31H,TIMING
 BEEP:
          MOV     R2,#5
    REPEAT:
          SETB    P2.7
          CALL    LONGDELAY
          CLR     P2.7
          CALL    LONGDELAY
          DJNZ    R2,REPEAT
          JMP     START
 DELAY:
          MOV     R3,#248
          JNB     P2.4,RESTART
          DJNZ    R3,$
          DJNZ    R2,DELAY
          RET
 FILTER:
          MOV     R6,#60
        F1:
          MOV     R7,248
          DJNZ    R7,$
          DJNZ    R6,F1
          RET

 LONGDELAY:
          MOV     R3,#50
       DL1:
          MOV     R4,#20
       DL2:
          MOV     R5,#248
          DJNZ    R5,$
          DJNZ    R4,DL2
          DJNZ    R3,DL1
          RET
          END

2011-06-22 17:06
快速回复:求助师傅们,这个程序有没有问题啊?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016261 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved