org 0000h
ajmp main
org 0030h
main: mov tmod,#010h
mov th0,#100
mov tl0,#100
mov r5,#00h
mov r6,#00h
mov r7,#00h
mov p0,#11111111b
setb tr0
loop: mov p3,#11011111b
mov p1,#11111111b
jnb p1.4,cx1
jnb p1.3,cx2
jnb p1.2,cx3
setb p3.3
mov p1,#01111111b
jnb p1.4,cx4
jnb p1.3,cx5
jnb p1.2,cx6
mov p1,#10111111b
jnb p1.4,cx7
jnb p1.3,cx8
jnb p1.2,cx9
ajmp loop
cx1: mov p0,#11111110b
acall yan1
ajmp loop
cx2: mov p0,#11111100b
acall yan1
ajmp loop
cx3: mov p0,#11111000b
acall yan1
ajmp loop
cx4: mov p0,#11110000b
acall yan1
ajmp loop
cx5: mov p0,#11100000b
acall yan1
ajmp loop
cx6: mov p0,#11000000b
acall yan1
ajmp loop
cx7: mov p0,#10000000b
acall yan1
ajmp loop
cx8: mov p0,#00000000b
acall yan1
ajmp loop
cx9: mov p0,#00000000b
acall yan1
mov p0,#11111111b
acall yan1
ajmp loop
yan1: jnb tf0,yan1
inc r5
cjne r5,#100,yan1
mov r5,#00h
inc r6
cjne r6,#100,yan1
mov r6,#00h
inc r7
cjne r7,#100,yan1
mov r7,#00h
ajmp yan1
ret
end