ODX3 CALL DISP
MOV P0,#0F0H
MOV A,P2
ANL A,#0FH
XRL A,R2
JZ X3
MOV A,R0
XRL A,#0EH
JZ COMPARE
MOV A,R0
XRL A,#0FH
JZ CLEAR
MOV A,R0
MOV R1,#20H
MOV R7,#04H
CHANGE: XCH A,@R1
INC R1
DJNZ R7,CHANGE
AJMP START2
COMPARE:CALL DISP
MOV P0,#0F0H
MOV DPTR,#TABLE
MOV R6,#00H
MOV R1,#20H
MOV R4,#04H
I1: MOV A,R6
MOVC A,@A+DPTR
MOV 50H,@R1
CJNE A,50H,CLEAR
INC R6
INC R1
DJNZ R4,I1
MOV R7,#05H
I4: MOV R5,#00H
I2: CLR P1.0
CALL DEL
CALL DEL
DJNZ R5,I2
MOV R5,#00H
I3: SETB P1.0
CALL DEL
CALL DEL
DJNZ R5,I3
DJNZ R7,I4
AJMP CLEAR
DISP: PUSH ACC
MOV R1,#20H
MOV A,@R1
SWAP A
ORL A,#01H
MOV P0,A
CALL DEL
INC R1
MOV A,@R1
SWAP A
ANL P0,#0FH
ORL A,#02H
MOV P0,A
CALL DEL
INC R1
MOV A,@R1
SWAP A
ANL P0,#0FH
ORL A,#04H
MOV P0,A
CALL DEL
INC R1
MOV A,@R1
SWAP A
ANL P0,#0FH
ORL A,#08H
MOV P0,A
CALL DEL
POP ACC
RET
DEL: MOV R4,#00H
DEL1: DJNZ R4,DEL1
RET
TABLE: DB 04H,08H,03H,01H
END
※ 编辑: D0248013 (182.155.162.53), 04/09/2016 00:05:43
※ 编辑: D0248013 (182.155.162.53), 04/09/2016 01:17:48
※ 编辑: D0248013 (182.155.162.53), 04/12/2016 16:13:15
※ 编辑: D0248013 (182.155.162.53), 04/12/2016 16:14:39