新手请教下面一个60秒倒计时程序怎样修改能循环多次使用?请大侠们不吝赐教!多谢了!
org 0000h
ljmp main
org 000bh
sjmp t1s
org 0030h
main:mov r2,#60
mov r4,#20
mov ie,#88h
mov tmod,#10h
mov th1,#3ch
mov tl1,#0b0h
setb tr1
acall dis
sjmp $
t1s: mov th1,#3ch
mov tl1,#0b0h
djnz r4,t1s1
mov r4,#20
djnz r2,t1s0
clr tr1
t1s0:acall dis
t1s1:reti
seg7:inc a
movc a,@a+pc
ret
db 0c0h,0f9h,0a4h,0b0h
db 99h,92h,82h,0f8h
db 80h,90h,88h,83h
db 0c6h,0a1h,86h,8eh
dis: mov a,r2
mov b,#10
div ab
acall seg7
mov p1,a
mov a,b
acall seg7
mov p2,a
ret
end
此帖出自
小平头技术问答
t1s: mov th1,#3ch
mov tl1,#0b0h
djnz r4,t1s1
mov r4,#20
djnz r2,t1s0
; clr tr1
mov r2,#60
t1s0:acall dis
t1s1:reti
一周热门 更多>