ORG 0000H JMP BEGIN ORG 0030HTABLE: ; 共陰極數碼管顯示程式碼表 DB 3FH,06H,5BH,4FH,66H ;01234 DB 6DH,7DH,07H,7FH,6fh ;56789DELAY: MOV R5,#20LOOP4: MOV R6,#50H ;延時20X20msLOOP5: MOV R7,#100 DJNZ R7,$ DJNZ R6,LOOP5 DJNZ R5,LOOP4 RET;---------------------------------------BEGIN: MOV R2,#0LOOP: MOV DPTR,#TABLE MOV A,R2 MOVC A,@A+DPTR MOV P0,A MOV P1,#00H LCALL DELAY MOV P1,A MOV P0,#00H INC R2 CJNE R2,#10,LOOP SJMP BEGIN END
ORG 0000H JMP BEGIN ORG 0030HTABLE: ; 共陰極數碼管顯示程式碼表 DB 3FH,06H,5BH,4FH,66H ;01234 DB 6DH,7DH,07H,7FH,6fh ;56789DELAY: MOV R5,#20LOOP4: MOV R6,#50H ;延時20X20msLOOP5: MOV R7,#100 DJNZ R7,$ DJNZ R6,LOOP5 DJNZ R5,LOOP4 RET;---------------------------------------BEGIN: MOV R2,#0LOOP: MOV DPTR,#TABLE MOV A,R2 MOVC A,@A+DPTR MOV P0,A MOV P1,#00H LCALL DELAY MOV P1,A MOV P0,#00H INC R2 CJNE R2,#10,LOOP SJMP BEGIN END