em có mã code như dưới nhưng sao em buên dich ra toàn là lổi không ak 4 lổi .
em đang làm đồ án môn học hiện chữ lên lcd dung 89 .ai biết xin giúp đở dùm em ,em xin cảm ơn ạ
mã code:
#include <sfr51.inc>
E BIT P3.2
RS BIT P3.1
RW BIT P3.0
MAIN:
LCALL GHI_LENH ; GOI CHUONG TRINH CON GHI LENH RA LCD
MOV P1,#38H ; KHOI DONG CHE DO 2 DONG
LCALL WAIT
LCALL GHI_LENH
MOV P1,#0EH ;BAT DAU HIEN THI
LCALL WAIT
LCALL GHI_LENH
MOV P1,#06H ; TANG CON TRO SANG PHAI
LCALL WAIT ;CAI DAT LCD
START:
MOV DPTR,#DU_LIEU2 ;DONG 2 DUNG YEN
LCALL GHI_LENH
MOV P1,#0C0H
LCALL WAIT
LCALL HIEN_THI
MOV R2,#0 ;DONG 1 DICH
SHIFT1:
MOV DPTR,#DU_LIEU1
AAA:
LCALL DISPLAY1
LCALL DELEY500
INC DPTR
MOV A,DPL ;KIEM TRA DA DICH XONG DONG CHU RA MAN HINH LCD
CJNE A,#LOW(DU_LIEU1+19),AAA
MOV A,DPH
CJNE A,#HIGH(DU_LIEU1+19),AAA
INC R2
CJNE R2,#2,SHIFT1
MOV DPTR,#DU_LIEU3 ;DONG 1 DUNG YEN
LCALL GHI_LENH
MOV P1,#80H
LCALL WAIT
LCALL HIEN_THI
MOV R2,#0 ;DONG 2 DICH
SHIFT2:
MOV DPTR,#DU_LIEU4
BBB:
LCALL DISPLAY2
LCALL DELEY500
INC DPTR
MOV A,DPL
CJNE A,#LOW(DU_LIEU4+29),BBB
MOV A,DPH
CJNE A,#HIGH(DU_LIEU4+29),BBB
INC R2
CJNE R2,#3,SHIFT2
LJMP START
DISPLAY1:
LCALL GHI_LENH
MOV P1,#80H ; dua con tro ve dau dong 1
LCALL WAIT
HIEN_THI:
MOV R0,#0
LOOP:
MOV A,R0
MOVC A,@A+DPTR
LCALL GHI_DATA
MOV P1,A
LCALL WAIT
INC R0
CJNE R0,#16,LOOP
RET
DISPLAY2:
LCALL GHI_LENH
MOV P1,#0C0H
LCALL WAIT
LCALL HIEN_THI
RET
GHI_LENH:
SETB P3.2
CLR P3.0
CLR P3.1
RET
GHI_DATA:
SETB P3.2
SETB P3.0
CLR P3.1
RET
WAIT:
CLR P3.2
MOV TMOD,#10H
MOV TH1,#HIGH(-500)
MOV TL1,#LOW(-500)
CLR TF1
SETB TR1
JNB TF1,$
CLR TR1
CLR TF1
RET
DELEY500:
MOV R1,#0
DEM:
MOV TMOD,#10H
MOV TH1,#HIGH(-5000)
MOV TL1,#LOW(-5000)
CLR TF1
SETB TR1
JNB TF1,$
CLR TR1
CLR TF1
INC R1
CJNE R1,#50,DEM
RET
ORG 100H
DU_LIEU1:
DB 'DE TAI MON VI DIEU KHIEN '
ORG 150H
DU_LIEU2:
DB 'LOP DH07TD'
ORG 250H
DU_LIEU3:
DB 'KHOA CO KHI'
ORG 300H
DU_LIEU4:
DB 'TRUONG DH NONG LAM TP.HCM'
END
đây là lỗi :
Assembling AssemblyFile1.asm
4 errors found
"D:\mach lcd\codelcd\AssemblyFile1.asm" 111 Undecodable line, Syntax error
"D:\mach lcd\codelcd\AssemblyFile1.asm" 114 Undecodable line, Syntax error
"D:\mach lcd\codelcd\AssemblyFile1.asm" 117 Undecodable line, Syntax error
"D:\mach lcd\codelcd\AssemblyFile1.asm" 120 Undecodable line, Syntax error
em đang làm đồ án môn học hiện chữ lên lcd dung 89 .ai biết xin giúp đở dùm em ,em xin cảm ơn ạ
mã code:
#include <sfr51.inc>
E BIT P3.2
RS BIT P3.1
RW BIT P3.0
MAIN:
LCALL GHI_LENH ; GOI CHUONG TRINH CON GHI LENH RA LCD
MOV P1,#38H ; KHOI DONG CHE DO 2 DONG
LCALL WAIT
LCALL GHI_LENH
MOV P1,#0EH ;BAT DAU HIEN THI
LCALL WAIT
LCALL GHI_LENH
MOV P1,#06H ; TANG CON TRO SANG PHAI
LCALL WAIT ;CAI DAT LCD
START:
MOV DPTR,#DU_LIEU2 ;DONG 2 DUNG YEN
LCALL GHI_LENH
MOV P1,#0C0H
LCALL WAIT
LCALL HIEN_THI
MOV R2,#0 ;DONG 1 DICH
SHIFT1:
MOV DPTR,#DU_LIEU1
AAA:
LCALL DISPLAY1
LCALL DELEY500
INC DPTR
MOV A,DPL ;KIEM TRA DA DICH XONG DONG CHU RA MAN HINH LCD
CJNE A,#LOW(DU_LIEU1+19),AAA
MOV A,DPH
CJNE A,#HIGH(DU_LIEU1+19),AAA
INC R2
CJNE R2,#2,SHIFT1
MOV DPTR,#DU_LIEU3 ;DONG 1 DUNG YEN
LCALL GHI_LENH
MOV P1,#80H
LCALL WAIT
LCALL HIEN_THI
MOV R2,#0 ;DONG 2 DICH
SHIFT2:
MOV DPTR,#DU_LIEU4
BBB:
LCALL DISPLAY2
LCALL DELEY500
INC DPTR
MOV A,DPL
CJNE A,#LOW(DU_LIEU4+29),BBB
MOV A,DPH
CJNE A,#HIGH(DU_LIEU4+29),BBB
INC R2
CJNE R2,#3,SHIFT2
LJMP START
DISPLAY1:
LCALL GHI_LENH
MOV P1,#80H ; dua con tro ve dau dong 1
LCALL WAIT
HIEN_THI:
MOV R0,#0
LOOP:
MOV A,R0
MOVC A,@A+DPTR
LCALL GHI_DATA
MOV P1,A
LCALL WAIT
INC R0
CJNE R0,#16,LOOP
RET
DISPLAY2:
LCALL GHI_LENH
MOV P1,#0C0H
LCALL WAIT
LCALL HIEN_THI
RET
GHI_LENH:
SETB P3.2
CLR P3.0
CLR P3.1
RET
GHI_DATA:
SETB P3.2
SETB P3.0
CLR P3.1
RET
WAIT:
CLR P3.2
MOV TMOD,#10H
MOV TH1,#HIGH(-500)
MOV TL1,#LOW(-500)
CLR TF1
SETB TR1
JNB TF1,$
CLR TR1
CLR TF1
RET
DELEY500:
MOV R1,#0
DEM:
MOV TMOD,#10H
MOV TH1,#HIGH(-5000)
MOV TL1,#LOW(-5000)
CLR TF1
SETB TR1
JNB TF1,$
CLR TR1
CLR TF1
INC R1
CJNE R1,#50,DEM
RET
ORG 100H
DU_LIEU1:
DB 'DE TAI MON VI DIEU KHIEN '
ORG 150H
DU_LIEU2:
DB 'LOP DH07TD'
ORG 250H
DU_LIEU3:
DB 'KHOA CO KHI'
ORG 300H
DU_LIEU4:
DB 'TRUONG DH NONG LAM TP.HCM'
END
đây là lỗi :
Assembling AssemblyFile1.asm
4 errors found
"D:\mach lcd\codelcd\AssemblyFile1.asm" 111 Undecodable line, Syntax error
"D:\mach lcd\codelcd\AssemblyFile1.asm" 114 Undecodable line, Syntax error
"D:\mach lcd\codelcd\AssemblyFile1.asm" 117 Undecodable line, Syntax error
"D:\mach lcd\codelcd\AssemblyFile1.asm" 120 Undecodable line, Syntax error
Comment