|
楼主 |
发表于 2004-11-23 22:20
|
显示全部楼层
[B]这是我写的,有什么不足,请高手指教:
cseg at 4000h ljmp 4030h cseg at 400bh ljmp intsv cseg at 4030h start: mov 30H,#0 mov 31H,#0 mov 32H,#0 mov R5,#4 MOV R4,#125 mov R3,#0FEH mov R1,#32H mov TMOD,#02H mov TH0,#6 SETB EA SETB ET0 SETB TR0 H1: LJMP H1 INTSV: DEC R5 mov A,R5 JNZ H2 mov R5,#4 LCALL DIS DEC R4 MOV A,R4 JNZ H2 MOV R4,#125 INC 30H MOV A,30H CJNE A,#10,H2 MOV 30H,#0 INC 31H MOV A,31H CJNE A,#10,H2 MOV 31H,#0 INC 32H MOV A,32H CJNE A,#10,H2 MOV 32H,#0 H2: RETI DIS: mov DPTR,#TAB mov A,@R1 movC A,@A+DPTR mov B,A mov A,R3 JNB ACC.1,H3 mov A,B LJMP H4 H3: mov A,B SETB ACC.7 H4: mov P1,A mov DPTR,#0CFA0H mov A,R3 movX @DPTR,A DEC R1 mov A,R3 RL A mov R3,A JNB ACC.3,H5 RET H5: mov R1,#32H mov R3,#0FEH RET TAB: DB 3FH,6,5BH,4Fh,66H,6DH,7DH,7 DB 7FH,6FH,77H,7CH,39H,5EH,79H,71H end [/B]
[此帖子已被 边城玫女 在 2004-11-23 22:23:43 编辑过] |
|