Created
November 2, 2016 08:06
-
-
Save clive819/cfd8fb95262522d1898173e746e23e28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ORG 0000h | |
MOV 40h,#0 | |
MOV 41h,#6 | |
MOV 42h,#4 | |
MOV 43h,#1 | |
MOV DPTR, #Led_table | |
back: | |
MOV R0,#40h | |
MOV 0E0h,#0FEh | |
loop: | |
MOV 0E8h,A | |
ACALL Covled | |
INC R0 | |
ACALL Delay | |
RL A | |
JNB ACC.4 ,back | |
SJMP loop | |
Delay: MOV r4, #1 | |
delay0: MOV r5, #4 | |
delay1: MOV r6, #100 | |
delay2: MOV r7, #100 | |
delay3: DJNZ r7, delay3 | |
DJNZ r6, delay2 | |
DJNZ r5, delay1 | |
DJNZ r4, delay0 | |
RET | |
Covled: | |
PUSH 0E0h | |
MOV 0E0h, @R0 | |
ANL a, #0fh | |
MOVc a, @a+dptr | |
MOV p0, a | |
POP 0E0h | |
RET | |
Led_table: | |
DB 0c0h | |
DB 0f9h | |
DB 0A4h | |
DB 0B0h | |
DB 099h | |
DB 092h | |
DB 082h | |
DB 0f8h | |
DB 080h | |
DB 090h | |
DB 088h | |
DB 083h | |
DB 0c6h | |
DB 0a1h | |
DB 086h | |
DB 08eh | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment