• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

为何第二次按下按键,指示灯只闪一下,而第一次按则闪五下.

org 0000h
                       ajmp loop
                  loop:setb p3.5
                       setb p3.7
                       jnb p3.5,led
                       acall delay1
                       jnb p3.5,led
                       ajmp
                      
                      
                      
              

                 LED: clr p3.7
                      call led1
                      setb p3.7
                      call led1
                      clr p3.7
                      call led1
                      setb p3.7
                      call led1
                       clr p3.7
                      call led1
                      setb p3.7
                      call led1
                      clr p3.7
                      call led1
                      setb p3.7
                      call led1
                      clr p3.7
                      call led1
                      setb p3.7
                      call led1
                    
      

    led1:  mov r4,#50
        d2:MOV R6,#50
        D3:MOV R7,#100
           DJNZ R7,$
           DJNZ R6,D3
           DJNZ R4,d2
           RET
    delay1:mov r1,#50
        d4:mov r2,#100
        djnz r2,$
        djnz r1,d4
        ret
        end
全部回复(3)
正序查看
倒序查看
luxha
LV.6
2
2005-06-30 12:27
各位大侠,发表一下意见啊,上面有一句漏掉了  LOOP,
0
回复
luxha
LV.6
3
2005-06-30 14:37
@luxha
各位大侠,发表一下意见啊,上面有一句漏掉了  LOOP,
我已经清楚啦,不敢有劳大家.
0
回复
bclbtom
LV.1
4
2005-07-12 16:48
好好想想再干,真苯!
0
回复