a_bit equ 20h ;個(gè)位數(shù)存放處
b_bit equ 21h ;十位數(shù)存放處
temp equ 22h ;計(jì)數(shù)器寄存器
STAR: mov temp,#0 ;初始化計(jì)數(shù)器
stlop: acall display
inc temp
mov a,temp
cjne a,#100,next ;=100重來(lái)
mov temp,#0
next: ljmp stlop
;顯示子程序
display: mov a,temp ;將temp中的十六進(jìn)制數(shù)轉(zhuǎn)換成10進(jìn)制
mov b,#10 ;10進(jìn)制/10=10進(jìn)制
div ab
mov b_bit,a ;十位在a
mov a_bit,b ;個(gè)位在b
mov dptr,#numtab ;指定查表啟始地址
mov r0,#4
dpl1: mov r1,#250 ;顯示1000次
dplop: mov a,a_bit ;取個(gè)位數(shù)
MOVC A,@A+DPTR ;查個(gè)位數(shù)的7段代碼
mov p0,a ;送出個(gè)位的7段代碼
標(biāo)簽:
直接驅(qū)動(dòng)
數(shù)碼管
計(jì)數(shù)器
程序
上傳時(shí)間:
2013-11-06
上傳用戶:lx9076