ORG 0000H
MOV P0, #0FFH
MOV P1, #00H
MAIN: SETB P2.0
MOV P1, #40H
MOV R0, #00H
MOV P0, #0AAH
LCALL DELAY
MOV A, P0
CPL A
MOV P0, A
LCALL DELAY
JNB P2.0, LOOP
LJMP MAIN
LOOP: JNB P2.0, LOOP
INC R0
CJNE R0, #06H, PD
LJMP MAIN
PD: CJNE R0, #01H, WW1
LCALL YY1
WW1: CJNE R0, #02H, WW2
LCALL YY2
WW2: CJNE R0, #03H, WW3
LCALL YY3
WW3: CJNE R0, #04H, WW4
LCALL YY4
WW4: CJNE R0, #05H, WW5
LCALL YY5
WW5: RET
YY1: MOV DPTR, #TAB1
MOV P1, #06H
LCALL XS
YY2: MOV DPTR, #TAB2
MOV P1, #5BH
LCALL XS
YY3: MOV DPTR, #TAB3
MOV P1, #4FH
LCALL XS
YY4: MOV DPTR, #TAB4
MOV P1, #66H
LCALL XS
YY5: MOV DPTR, #TAB5
MOV P1, #6DH
LCALL XS
XS: MOV R6, #00H
MOV R7, #08H
DP: MOV A, R6
MOVC A, @A+DPTR
MOV P0, A
INC R6
JNB P2.0, LOOP
LCALL DELAY
LCALL DELAY
DJNZ R7, DP
LJMP XS
DELAY10MS: MOV R5, #10
MOV R4, #200
NOP
NOP
DJNZ R4, $
DJNZ R5, $
RET
DELAY: MOV R5, #00H
MOV R4, #00H
NOP
NOP
DJNZ R4, $
DJNZ R5, $
RET
TAB1: DB 01111110B, 00111100B, 00011000B, 00000000B, 00011000B, 00111100B, 01111110B, 11111111B
TAB2: DB 10000001B, 11000011B, 11100111B, 11111111B, 11100111B, 11000011B, 10000001B, 00000000B
TAB3: DB 11111110B, 11111100B, 11111000B, 11110000B, 11100000B, 11000000B, 10000000B, 00000000B
TAB4: DB 00000001B, 00000011B, 00000111B, 00001111B, 00011111B, 00111111B, 01111111B, 11111111B
TAB5: DB 10000001B, 11000011B, 11100111B, 11111111B, 11100111B, 11000011B, 10000001B, 00000000B
END |