|
org 2000h
ljmp start
org 0003h
ljmp rr
start: mov r0,#00h
mov r1,#00h
loop: cjne r0,#1h,l1
loop1: mov p2,r1
xch a, r1
add a, #01h
acall delay
da a
xch a, r1
cjne r1,#1,loop
ljmp loop1
l1: cjne r0,#2h,l2
ljmp l1
l2: cjne r0,#3h,loop
ljmp start
rr: push acc
push psw
inc r0
pop acc
pop psw
reti
delay:mov r2,#50
d1: mov r3,#40
d2: mov r4,#248
djnz r4,$
djnz r3,d2
djnz r2,d1
ret
end
由T0控制的99秒马表,由P2经7447显示。当第一次摁下,开始计时;第二次,停止。的三次,归零。晶体振荡器选择12M。
|
|