em tìm thấy cái này trên mạng
http://www2.hcmuaf.edu.vn/contents.p...=nguyenbavuong
nhưng trong chương trình ở chỗ chống lem,em không thấy nhãn DDD,em chạy mô phỏng cũng không đúng.có anh nào giúp em với.thanks nhiều.
đây là code
$MOD51
ORG 00H
MAIN:
MOV DPTR,#DATABASE ;DIA CHI NAP DU LIEU
AAA:
MOV R0,#5 ;TOC DO HIEN KY TU
BBB:
LCALL SCANDATA ;NAP DU LIEU
DJNZ R0,BBB
INC DPTR
MOV A,DPL
MOV R1,DPH
CJNE R1,#02H,AAA ;KIEM TRA KET THUC CHUOI ?
CJNE A,#25H,AAA
SJMP MAIN
SCANDATA:
PUSH ACC
PUSH 00H
PUSH 01H
MOV R0,#00H ;DIA CHI DU LIEU DAU TIEN TRON DATABASE
MOV R1,#01H ;HIEN THI RA COT DAU TIEN
SCAN:
MOV A,R0
MOVC A,@A+DPTR ;NAP DU LIEU TU DATABASE VAO A
MOV P2, A ;HIEN THI RA DONG TUONG UNG
MOV P1,R1 ;HIEN THI RA COT DAU TIEN
LCALL DELAY5MS ;CHUONG TRINH TAO TRE 5 MS
MOV R4,#40H ;CHONG LEM
MOV P1,#00H
DJNZ R4,DDD
INC R0 ;HIEN THI DU LIEU KE TIEP
MOV A,R1 ;CHUYEN SANG COT KE TIEP
RL A
MOV R1,A
CJNE R0,#8H,SCAN ;KIEM TRA QUET COT THU 8 CHUA
POP 01H
POP 00H
POP ACC
RET
DELAY5MS:
PUSH 00H
PUSH 01H
MOV R1,#10
CCC:
MOV R0,#250
DJNZ R0,$
DJNZ R1,CCC
POP 01H
POP 00H
RET
DATABASE:
DB 00H,00H,00H,00H,00H,00H ;"KHOANG TRANG"
DB 02H,02H,0FEH,02H, 02H,00H ;"T"
DB 0FEH,12H, 32H,52H, 8CH,00H ;"R"
DB 7EH,80H, 80H,80H, 7EH,00H ;"U"
DB 7CH,82H, 82H,82H, 7CH,00H ;"O"
DB 0FEH,04H, 08H,10H,0FEH,00H ;"N"
DB 7CH,82H, 92H,92H, 74H,00H,00H,00H ;"G"
DB 10H,0FEH,92H,82H, 82H,7CH,00H ;"D"
DB 0FCH, 22H,22H,22H,0FCH,00H ;"A"
DB 82H,0FEH,82H,00H, 00H,00H ;"I"
DB 0FEH,10H,10H,10H,0FEH,00H ;"H"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 7CH,82H,82H,82H, 44H,00H,00H,00H ;"C"
DB 7CH,82H,82H,82H, 44H,00H ;"C"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 0FEH,04H,08H,10H,0FEH,00H ;"N"
DB 7CH,82H,92H,92H, 74H,00H,00H,00H ;"G"
DB 0FEH, 04H,08H,10H,0FEH,00H ;"N"
DB 7CH, 82H,92H,92H, 74H,00H ;"G"
DB 0FEH, 10H,10H,10H,0FEH,00H ;"H"
DB 82H,0FEH,82H,00H ;"I"
DB 0FEH, 92H,92H,92H, 82H,00H ;"E"
DB 0FEH, 12H,12H,12H, 0CH,00H,00H,00H ;"P"
DB 02H,02H,0FEH,02H, 02H,00H ;"T"
DB 0FEH,12H, 12H,12H, 0CH,00H ;"P"
DB 80H,00H ;"."
DB 0FEH,10H, 10H,10H,0FEH,00H ;"H"
DB 7CH,82H, 82H,82H, 44H,00H ;"C"
DB 0FEH,04H, 08H,04H,0FEH,00H,00H ;"M"
DB 10H,10H,10H,00H,00H ;"-"
DB 0FEH,10H,28H,44H, 82H,00H ;"K"
DB 0FEH,10H,10H,10H,0FEH,00H ;"H"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 0FCH,22H,22H,22H,0FCH,00H,00H,00H ;"A"
DB 7CH,82H,82H,82H, 44H,00H ;"C"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 0FEH,04H,08H,10H,0FEH,00H ;"N"
DB 7CH,82H,92H,92H, 74H,00H,00H,00H ;"G"
DB 0FEH,04H,08H,10H,0FEH,00H ;"N"
DB 7CH,82H,92H,92H, 74H,00H ;"G"
DB 0FEH,10H,10H,10H,0FEH,00H ;"H"
DB 0FEH,92H,92H,92H, 82H,00H,00H,00H ;"E"
DB 10H,0FEH,92H,82H, 82H,7CH,00H ;"D"
DB 82H,0FEH,82H,00H ;"I"
DB 0FEH, 92H,92H,92H, 82H,00H ;"E"
DB 0FEH, 04H,08H,10H,0FEH,00H,00H,00H ;"N"
DB 02H,02H,0FEH,02H,02H,00H ;"T"
DB 7EH,80H, 80H,80H,7EH,00H,00H ;"U"
DB 10H,10H,10H,00H,00H ;"-"
DB 4CH,92H, 92H,92H, 64H,00H ;"S"
DB 3EH,40H, 80H,40H, 3EH,00H ;"V"
DB 02H,02H,0FEH,02H, 02H,00H ;"T"
DB 0FEH,10H, 10H,10H,0FEH,00H ;"H"
DB 44H, 00H,00H ;":"
DB 0FEH,80H,80H,80H,80H,00H ;"L"
DB 7EH,80H,80H,80H,7EH,00H ;"U"
DB 7EH,80H,80H,80H,7EH,00H,00H,00H ;"U"
DB 02H, 02H,0FEH,02H, 02H,00H ;"T"
DB 82H,0FEH, 82H,00H ;"I"
DB 0FEH, 92H, 92H,92H, 82H,00H ;"E"
DB 0FEH, 04H, 08H,10H,0FEH,00H,00H,00H ;"N"
DB 10H,0FEH, 92H,82H, 82H,7CH,00H ;"D"
DB 0FCH, 22H, 22H,22H,0FCH,00H ;"A"
DB 02H, 02H,0FEH,02H, 02H,00H,00H,00H ;"T"
DB 10H,10H,10H,00H,00H ;"-"
DB 0FEH, 04H, 08H,04H,0FEH,00H ;"M"
DB 4CH, 92H, 92H,92H, 64H,00H ;"S"
DB 4CH, 92H, 92H,92H, 64H,00H ;"S"
DB 3EH, 40H, 80H,40H, 3EH,00H ;"V"
DB 44H, 00H ;":"
DB 7CH, 82H, 82H,82H,7CH,00H ;"0"
DB 4EH, 8AH, 8AH,8AH,72H,00H ;"5"
DB 7CH, 82H, 82H,82H,7CH,00H ;"0"
DB 8CH,0C2H,0A2H,92H,8CH,00H ;"2"
DB 7CH, 82H, 82H,82H,7CH,00H ;"0"
DB 44H, 92H, 92H,92H,6CH,00H ;"3"
DB 4CH, 92H, 92H,92H,7CH,00H,00H,00H ;"9"
END
http://www2.hcmuaf.edu.vn/contents.p...=nguyenbavuong
nhưng trong chương trình ở chỗ chống lem,em không thấy nhãn DDD,em chạy mô phỏng cũng không đúng.có anh nào giúp em với.thanks nhiều.
đây là code
$MOD51
ORG 00H
MAIN:
MOV DPTR,#DATABASE ;DIA CHI NAP DU LIEU
AAA:
MOV R0,#5 ;TOC DO HIEN KY TU
BBB:
LCALL SCANDATA ;NAP DU LIEU
DJNZ R0,BBB
INC DPTR
MOV A,DPL
MOV R1,DPH
CJNE R1,#02H,AAA ;KIEM TRA KET THUC CHUOI ?
CJNE A,#25H,AAA
SJMP MAIN
SCANDATA:
PUSH ACC
PUSH 00H
PUSH 01H
MOV R0,#00H ;DIA CHI DU LIEU DAU TIEN TRON DATABASE
MOV R1,#01H ;HIEN THI RA COT DAU TIEN
SCAN:
MOV A,R0
MOVC A,@A+DPTR ;NAP DU LIEU TU DATABASE VAO A
MOV P2, A ;HIEN THI RA DONG TUONG UNG
MOV P1,R1 ;HIEN THI RA COT DAU TIEN
LCALL DELAY5MS ;CHUONG TRINH TAO TRE 5 MS
MOV R4,#40H ;CHONG LEM
MOV P1,#00H
DJNZ R4,DDD
INC R0 ;HIEN THI DU LIEU KE TIEP
MOV A,R1 ;CHUYEN SANG COT KE TIEP
RL A
MOV R1,A
CJNE R0,#8H,SCAN ;KIEM TRA QUET COT THU 8 CHUA
POP 01H
POP 00H
POP ACC
RET
DELAY5MS:
PUSH 00H
PUSH 01H
MOV R1,#10
CCC:
MOV R0,#250
DJNZ R0,$
DJNZ R1,CCC
POP 01H
POP 00H
RET
DATABASE:
DB 00H,00H,00H,00H,00H,00H ;"KHOANG TRANG"
DB 02H,02H,0FEH,02H, 02H,00H ;"T"
DB 0FEH,12H, 32H,52H, 8CH,00H ;"R"
DB 7EH,80H, 80H,80H, 7EH,00H ;"U"
DB 7CH,82H, 82H,82H, 7CH,00H ;"O"
DB 0FEH,04H, 08H,10H,0FEH,00H ;"N"
DB 7CH,82H, 92H,92H, 74H,00H,00H,00H ;"G"
DB 10H,0FEH,92H,82H, 82H,7CH,00H ;"D"
DB 0FCH, 22H,22H,22H,0FCH,00H ;"A"
DB 82H,0FEH,82H,00H, 00H,00H ;"I"
DB 0FEH,10H,10H,10H,0FEH,00H ;"H"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 7CH,82H,82H,82H, 44H,00H,00H,00H ;"C"
DB 7CH,82H,82H,82H, 44H,00H ;"C"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 0FEH,04H,08H,10H,0FEH,00H ;"N"
DB 7CH,82H,92H,92H, 74H,00H,00H,00H ;"G"
DB 0FEH, 04H,08H,10H,0FEH,00H ;"N"
DB 7CH, 82H,92H,92H, 74H,00H ;"G"
DB 0FEH, 10H,10H,10H,0FEH,00H ;"H"
DB 82H,0FEH,82H,00H ;"I"
DB 0FEH, 92H,92H,92H, 82H,00H ;"E"
DB 0FEH, 12H,12H,12H, 0CH,00H,00H,00H ;"P"
DB 02H,02H,0FEH,02H, 02H,00H ;"T"
DB 0FEH,12H, 12H,12H, 0CH,00H ;"P"
DB 80H,00H ;"."
DB 0FEH,10H, 10H,10H,0FEH,00H ;"H"
DB 7CH,82H, 82H,82H, 44H,00H ;"C"
DB 0FEH,04H, 08H,04H,0FEH,00H,00H ;"M"
DB 10H,10H,10H,00H,00H ;"-"
DB 0FEH,10H,28H,44H, 82H,00H ;"K"
DB 0FEH,10H,10H,10H,0FEH,00H ;"H"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 0FCH,22H,22H,22H,0FCH,00H,00H,00H ;"A"
DB 7CH,82H,82H,82H, 44H,00H ;"C"
DB 7CH,82H,82H,82H, 7CH,00H ;"O"
DB 0FEH,04H,08H,10H,0FEH,00H ;"N"
DB 7CH,82H,92H,92H, 74H,00H,00H,00H ;"G"
DB 0FEH,04H,08H,10H,0FEH,00H ;"N"
DB 7CH,82H,92H,92H, 74H,00H ;"G"
DB 0FEH,10H,10H,10H,0FEH,00H ;"H"
DB 0FEH,92H,92H,92H, 82H,00H,00H,00H ;"E"
DB 10H,0FEH,92H,82H, 82H,7CH,00H ;"D"
DB 82H,0FEH,82H,00H ;"I"
DB 0FEH, 92H,92H,92H, 82H,00H ;"E"
DB 0FEH, 04H,08H,10H,0FEH,00H,00H,00H ;"N"
DB 02H,02H,0FEH,02H,02H,00H ;"T"
DB 7EH,80H, 80H,80H,7EH,00H,00H ;"U"
DB 10H,10H,10H,00H,00H ;"-"
DB 4CH,92H, 92H,92H, 64H,00H ;"S"
DB 3EH,40H, 80H,40H, 3EH,00H ;"V"
DB 02H,02H,0FEH,02H, 02H,00H ;"T"
DB 0FEH,10H, 10H,10H,0FEH,00H ;"H"
DB 44H, 00H,00H ;":"
DB 0FEH,80H,80H,80H,80H,00H ;"L"
DB 7EH,80H,80H,80H,7EH,00H ;"U"
DB 7EH,80H,80H,80H,7EH,00H,00H,00H ;"U"
DB 02H, 02H,0FEH,02H, 02H,00H ;"T"
DB 82H,0FEH, 82H,00H ;"I"
DB 0FEH, 92H, 92H,92H, 82H,00H ;"E"
DB 0FEH, 04H, 08H,10H,0FEH,00H,00H,00H ;"N"
DB 10H,0FEH, 92H,82H, 82H,7CH,00H ;"D"
DB 0FCH, 22H, 22H,22H,0FCH,00H ;"A"
DB 02H, 02H,0FEH,02H, 02H,00H,00H,00H ;"T"
DB 10H,10H,10H,00H,00H ;"-"
DB 0FEH, 04H, 08H,04H,0FEH,00H ;"M"
DB 4CH, 92H, 92H,92H, 64H,00H ;"S"
DB 4CH, 92H, 92H,92H, 64H,00H ;"S"
DB 3EH, 40H, 80H,40H, 3EH,00H ;"V"
DB 44H, 00H ;":"
DB 7CH, 82H, 82H,82H,7CH,00H ;"0"
DB 4EH, 8AH, 8AH,8AH,72H,00H ;"5"
DB 7CH, 82H, 82H,82H,7CH,00H ;"0"
DB 8CH,0C2H,0A2H,92H,8CH,00H ;"2"
DB 7CH, 82H, 82H,82H,7CH,00H ;"0"
DB 44H, 92H, 92H,92H,6CH,00H ;"3"
DB 4CH, 92H, 92H,92H,7CH,00H,00H,00H ;"9"
END
Comment