ORG 0000H;指定一个地址,后面的程序或数据从这个地址值开始分配
JMP MAIN
ORG 0023H
JMP CHUAN
ORG 0050H
MAIN:MOV SCON,#00H
SETB ES
SETB EA
START:MOV R0,#10H
MOV R1,#0FH
MOV R3,#7FH
LOOP: MOV A,R1
MOV P0,A
DEC R1
CLR P1.0
MOV A,R3
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV SBUF,A
MOV R4,#02H
MOV R5,#03H
MOV R6,#03H
MOV R7,#03H
MOV R2,#08H
CJNE R2,#00H,$
CALL DELAY
MOV A,R3
ADD A,#5FH
MOV R3,A
DJNZ R0,LOOP
JMP START
CHUAN:CLR TI
DJNZ R2,WORD
SETB P1.0
JMP RT
WORD: DJNZ R4,CHANG
MOV R4,#01H
MOV A,R5
CJNE A,#03H,GONG1
CALL JIAN
GONG1:DJNZ R5,CHANG
MOV R5,#01H
MOV A,R6
CJNE A,#03H,CHUN1
CALL JIAN
CHUN1:DJNZ R6,CHANG
MOV R6,#01H
MOV A,R7
CJNE A,#03H,CHANG1
CALL JIAN
CHANG1:DJNZ R7,CHANG
CHANG:CALL CHUANS
NOP
RT: RETI
NOP
JIAN:MOV A,R3
SUBB A,#1EH
MOV R3,A
RET
CHUANS:NOP
DEC R3
MOV A,R3
MOVC A,@A+DPTR
MOV SBUF,A
RET
DELAY:MOV R6,#0FH
B1: MOV R5,#04FH
DJNZ R5,$
DJNZ R6,B1
RET
TABLE:
DB 01H,00H,01H,00H,01H,00H,01H,00H;
DB 01H,00H,0FFH,0FEH,01H,00H,01H,00H;
DB 02H,80H,02H,80H,04H,40H,04H,40H;
DB 08H,20H,10H,10H,20H,08H,0C0H,06H;
DB 00H,40H,20H,40H,17H,0FEH,10H,80H;
DB 00H,0A0H,01H,20H,0F3H,0FCH,10H,20H;
DB 10H,20H,10H,20H,17H,0FEH,10H,20H;
DB 10H,20H,28H,20H,47H,0FEH,00H,00H;
DB 02H,00H,01H,00H,01H,00H,0FFH,0FEH;
DB 00H,00H,10H,10H,10H,08H,20H,24H;
DB 48H,24H,04H,40H,02H,80H,01H,00H;
DB 02H,80H,0CH,40H,30H,30H,0C0H,0EH;
DB 00H,00H,47H,0F8H,20H,10H,21H,0A0H;
DB 00H,40H,07H,0FCH,0E4H,44H,24H,44H;
DB 27H,0FCH,24H,44H,24H,44H,27H,0FCH;
DB 24H,44H,24H,54H,54H,08H,8FH,0FEH;
DB 01H,00H,01H,00H,01H,00H,01H,00H;
DB 01H,00H,0FFH,0FEH,01H,00H,01H,00H;
DB 02H,80H,02H,80H,04H,40H,04H,40H;
DB 08H,20H,10H,10H,20H,08H,0C0H,06H;
DB 22H,08H,11H,08H,11H,10H,00H,20H;
DB 7FH,0FEH,40H,02H,80H,04H,1FH,0E0H;
DB 00H,40H,01H,80H,0FFH,0FEH,01H,00H;
DB 01H,00H,01H,00H,05H,00H,02H,00H;
END
|