.define P_IOA_Data 0x7000 .define P_IOA_Dir 0x7002 .define P_IOA_Attrib 0x7003 .define dog_Clear 0x7012 .ram .var s1,s2,k=100; .data data_code:.dw 0x003f,0x0006,0x005b,0x004f,0x0066,0x006d,0x007d,0x0007,0x007f,0x006f bit_code:.dw 0x0200,0x0100 .code .public _main _main: r1=0x03ff [P_IOA_Dir]=r1 [P_IOA_Attrib]=r1 r1=0x0000 [P_IOA_Data]=r1 r3=0 [s1]=r3 [s2]=r3
//--------------------------- //display doub data //--------------------------- loop0: r1=60 [k]=r1 loop1: bp=data_code r1=[s1] r1=r1+bp r2=bit_code r3=[r1] //- ;取数码 r4=[r2] // ;取位码 r3=r3+r4 // ; [P_IOA_Data]=r3 call _delay2
r1=[s2] r1=r1+bp r3=[r1] r2=bit_code r2=r2+1 r4=[r2] r3=r3+r4 [P_IOA_Data]=r3 call _delay2
r1=[k] r1-=1 [k]=r1 cmp r1,0 jne loop1
r1=[s1] r1+=1 //;指向下一个数码 [s1]=r1 cmp r1, 9 jle loop0
r1=0 [s1]=r1 r4=[s2] r4+=1 [s2]=r4
r4=[s2] cmp r4,9 jle loop0 r4=0 [s2]=r4 jmp loop0
r3+=1 r1=data_code r2=bit_code
loop: r3=[r1++] r4=[r2] r3=r3+r4 [P_IOA_Data]=r3 //call _delay1 jmp loop
.public _delay2 _delay2: r3=0x0000 lop2: r4=1 [dog_Clear]=r4 r3+=1 cmp r3 ,0x03ff jne lop2 retf
|