ORG 0000H
LJMP START
ORG 000BH
LJMP TIMER0
ORG 0030H
START:MOV SP,#60H
MOV TMOD,#81H ;定时器0,1工作在方式1,0定时,1计数
MOV IE,#8AH ;开定时器中断
MOV TL0,#0B0H ;定时器地低位初始化
MOV P1,#21H
MOV TH0,#3CH
MOV 30H,#00H;MS
MOV 31H,#00H;S
MOV 32H,#00H;RED
MOV 33H,#00H;YEL
SETB TR0;
WAIT: JMP WAIT
TIMER0:PUSH PSW
PUSH ACC
MOV TL0,#0B0H;定时器重装值
MOV TH0,#3CH
INC 30H
MOV A,30H
CJNE A,#14H,EXIT
MOV 30H,#00H
INC 31H
MOV A,31H
YEON: CJNE A,#0AH,YEOFF;
CLR P1.5
SETB P1.4
SETB P1.0
SJMP EXIT
YEOFF: CJNE A,#0DH,SRON;
CLR P1.0
CLR P1.4
SETB P1.2
SETB P1.3
SJMP EXIT
SRON: CJNE A,#1AH,NEXT;
SETB P1.1
SETB P1.3
CLR P1.2
SJMP EXIT
NEXT: CJNE A,#1CH,EXIT
MOV 31H,#00H
SETB P1.0
SETB P1.5
CLR P1.1
CLR P1.3
EXIT: POP ACC
POP PSW
RETI
END