a gíp em làm bài điều khiển hiện thì từ 0 đến 9 trên matrix8x8 hộ em. em không biết tí gì về con này. em thấy với matrix 5x7 thì như thế này không biết 8x8 khác gì không
#include <sfr52.inc>
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV R2,#EFH
MOV DPTR,#MYDATA
SO0:MOV R5,#50
LOOP1:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP1
DJNZ R5,RRR
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
SO1:
MOV R5,#60
BBB:MOV R2,#EFH
MOV R3,#5
LOOP2:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP2
DJNZ R5,BBB
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
SO2:
MOV R5,#60
DDD:MOV R2,#EFH
MOV R3,#10
LOOP3:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP3
DJNZ R5,DDD
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
SO3:
MOV R5,#60
SOBA:
MOV R2,#EFH
MOV R3,#15
LOOP41:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP41
DJNZ R5,SOBA
SO4:
MOV R5,#60
DDD4:
MOV R2,#EFH
MOV R3,#20
LOOP4:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP4
DJNZ R5,DDD4
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO5:
MOV R5,#60
DDD5:MOV R2,#EFH
MOV R3,#25
LOOP5:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP5
DJNZ R5,DDD5
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO6:
MOV R5,#60
DDD6:MOV R2,#EFH
MOV R3,#30
LOOP6:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP6
DJNZ R5,DDD6
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO7:
MOV R5,#60
DDD7:MOV R2,#EFH
MOV R3,#35
LOOP7:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP7
DJNZ R5,DDD7
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO8:
MOV R5,#60
DDD8:MOV R2,#EFH
MOV R3,#40
LOOP8:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP8
DJNZ R5,DDD8
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO9:
MOV R5,#60
DDD9:MOV R2,#EFH
MOV R3,#45
LOOP9:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP9
DJNZ R5,DDD9
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
LJMP MAIN
DELAY: MOV R7,#3
DL3: MOV R6,#250
DL2: NOP
NOP
DJNZ R6,DL2
DJNZ R7,DL3
RET
DELAY2: MOV R7,#4
DJNZ R7,$
RET
MYDATA:
DB C1H,AEH,B6H,BAH,C1H ;hien thiso 0
DB FFH,BDH,80H,BFH,FFH ;hien thiso1
DB BDH,9EH,AEH,B6H,B9H ;hien thiso2
DB DDH,BEH,B6H,B6H,C9H ;hien thiso3
DB E7H,EBH,EDH,80H,EFH ;hien thiso4
DB D8H,BAH,BAH,BAH,C6H ;hien thiso5
DB C1H,B6H,B6H,B6H,CDH ;hien thiso6
DB BFH,DEH,EEH,F6H,F8H ;hien thiso7
DB C9H,B6H,B6H,B6H,C9H ;hien thiso8
DB D9H,B6H,B6H,B6H,C1H ;hien thiso9
END
#include <sfr52.inc>
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV R2,#EFH
MOV DPTR,#MYDATA
SO0:MOV R5,#50
LOOP1:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP1
DJNZ R5,RRR
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
SO1:
MOV R5,#60
BBB:MOV R2,#EFH
MOV R3,#5
LOOP2:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP2
DJNZ R5,BBB
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
SO2:
MOV R5,#60
DDD:MOV R2,#EFH
MOV R3,#10
LOOP3:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP3
DJNZ R5,DDD
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
SO3:
MOV R5,#60
SOBA:
MOV R2,#EFH
MOV R3,#15
LOOP41:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP41
DJNZ R5,SOBA
SO4:
MOV R5,#60
DDD4:
MOV R2,#EFH
MOV R3,#20
LOOP4:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP4
DJNZ R5,DDD4
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO5:
MOV R5,#60
DDD5:MOV R2,#EFH
MOV R3,#25
LOOP5:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP5
DJNZ R5,DDD5
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO6:
MOV R5,#60
DDD6:MOV R2,#EFH
MOV R3,#30
LOOP6:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP6
DJNZ R5,DDD6
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO7:
MOV R5,#60
DDD7:MOV R2,#EFH
MOV R3,#35
LOOP7:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP7
DJNZ R5,DDD7
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO8:
MOV R5,#60
DDD8:MOV R2,#EFH
MOV R3,#40
LOOP8:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP8
DJNZ R5,DDD8
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
SO9:
MOV R5,#60
DDD9:MOV R2,#EFH
MOV R3,#45
LOOP9:
MOV A,R3
MOVC A,@A+DPTR
MOV P1,A
MOV P2,R2
ACALL DELAY
MOV P2,#00H
ACALL DELAY2
INC R3
MOV A,R2
RR A
MOV R2,A
CJNE R2,#7FH,LOOP9
DJNZ R5,DDD9
MOV P1,#FFH
MOV P2,#FFH
ACALL DELAY
;SJMP $
LJMP MAIN
DELAY: MOV R7,#3
DL3: MOV R6,#250
DL2: NOP
NOP
DJNZ R6,DL2
DJNZ R7,DL3
RET
DELAY2: MOV R7,#4
DJNZ R7,$
RET
MYDATA:
DB C1H,AEH,B6H,BAH,C1H ;hien thiso 0
DB FFH,BDH,80H,BFH,FFH ;hien thiso1
DB BDH,9EH,AEH,B6H,B9H ;hien thiso2
DB DDH,BEH,B6H,B6H,C9H ;hien thiso3
DB E7H,EBH,EDH,80H,EFH ;hien thiso4
DB D8H,BAH,BAH,BAH,C6H ;hien thiso5
DB C1H,B6H,B6H,B6H,CDH ;hien thiso6
DB BFH,DEH,EEH,F6H,F8H ;hien thiso7
DB C9H,B6H,B6H,B6H,C9H ;hien thiso8
DB D9H,B6H,B6H,B6H,C1H ;hien thiso9
END
Comment