Professional Documents
Culture Documents
mov r3,#00h
ljmp main
org 000bh
mov tl0,#36h
mov th0,#0f6h
mov p2,#0ffh
clr dig_ctrl4
clr dig_ctrl3
clr dig_ctrl2
clr dig_ctrl1
inc r3
mov a,r3
mov b,#4
div ab
mov r3,b
cjne r3,#00,b1
mov dptr,#200h
mov a,r5
movc a,@a+dptr
mov p2,a
setb dig_ctrl1
sjmp last
mov dptr,#200h
mov a,r4
movc a,@a+dptr
mov p2,a
setb dig_ctrl2
sjmp last
mov dptr,#200h
mov a,r2
movc a,@a+dptr
mov p2,a
setb dig_ctrl3
sjmp last
mov dptr,#200h
mov a,r1
movc a,@a+dptr
mov p2,a
setb dig_ctrl4
last:
reti
setb p3.6
clr dig_ctrl4
clr dig_ctrl3
clr dig_ctrl2
clr dig_ctrl1
mov tl0,#0f6h
mov th0,#0ffh
mov ie,#82h
setb tr0
djnz r6,abc2
jnb p3.5,up
mov r6,#0aah
djnz r6,abc3
jnb p3.6,down
sjmp check
djnz r6,abc4
jb p3.6,up
acall delay
bcd:jnb p3.6,bcd
inc r0
mov a,r0
mov b,#10
div ab
mov r1,b
mov b,#10
div ab
mov r2,b
mov b,#10
div ab
mov r4,b
mov r5,a
cjne r0,#255,go
mov r0,#00h
djnz r6,abc5
jb p3.5,down
acall delay
dec r0
mov a,r0
mov b,#10
div ab
mov r1,b
mov b,#10
div ab
mov r2,b
mov b,#10
div ab
mov r4,b
mov r5,a
cjne r0,#00,go1
mov r0,#255
mov tl0,#36h
mov th0,#0f6h
setb tr0
clr tr0
clr tf0
ret
org 200h
DB 40h,0f9h,24h,30h,19h,12h,02h,0f8h,00h,10h
end