Nạp chương trình cho 89c51 không chạy??? trên proteus lại chạy?? ai giúp với (IC AT89c51 20RC)
Code:
ORG 0000H
LOOP:
MOV DPTR,#NHOM_4
MOV R2,#0 ;BO DEM DICH
LOOP2: MOV R5,#78 ;SO LAN TAO DELAY
LOOP1: MOV R0,#0 ;MA QUET HANG
MOV R1,#0 ;MA QUET COT
LOOP3: MOV A,R1
MOV P2,A ;XUAT MA QUET COT
MOV A,R0
ADD A,R2
MOVC A,@A+DPTR ;TRA BANG
MOV P1,A ;XUAT MA QUET HANG
CALL DELAY1
INC R0
INC R1
CJNE R1,#32,LOOP3
DJNZ R5,LOOP1
INC R2
CJNE R2,#155,LOOP2
LJMP LOOP
NHOM_4:
DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0
DB 0FFH,81H,81H,42H,3CH,0,0FEH,1H,1H,1H,0FEH,0
DB 0E0H,10H,0FH,10H,0E0H,0,8H,8H,8H,0
DB 0FFH, 10H,10H,10H,0FFH,0,0FEH,1H,1H,1H,0FEH,0
DB 0E0H,10H,0FH,10H,0E0H,0,8H,8H,8H,0
DB 0FFH,28H,44H,82H,1H,0, 0FFH, 10H,10H,10H,0FFH,0
DB 7EH,81H,81H,81H,7EH,0,3FH,48H,88H,48H,3FH,0H,8H,8H ,8H,0
DB 80H,80H,0FFH,80H,80H,0,0FFH, 10H,10H,10H,0FFH,0
DB 0,81H,0FFH,81H,0,0,0FFH,20H,10H,8H,0FFH,0,0FFH
DB 10H,10H,10H,0FFH,0,8H,8H,8H,0
DB 0FCH,2H,1H,2H,0FCH,0,3FH,48H,88H,48H,3FH,0
DB 0FFH,20H,10H,8H,0FFH
DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0
DELAY1: MOV TMOD,#02H
MOV TH0,#(-200)
SETB TR0
JNB TF0,$
CLR TF0
RET
END
Code:
ORG 0000H
LOOP:
MOV DPTR,#NHOM_4
MOV R2,#0 ;BO DEM DICH
LOOP2: MOV R5,#78 ;SO LAN TAO DELAY
LOOP1: MOV R0,#0 ;MA QUET HANG
MOV R1,#0 ;MA QUET COT
LOOP3: MOV A,R1
MOV P2,A ;XUAT MA QUET COT
MOV A,R0
ADD A,R2
MOVC A,@A+DPTR ;TRA BANG
MOV P1,A ;XUAT MA QUET HANG
CALL DELAY1
INC R0
INC R1
CJNE R1,#32,LOOP3
DJNZ R5,LOOP1
INC R2
CJNE R2,#155,LOOP2
LJMP LOOP
NHOM_4:
DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0
DB 0FFH,81H,81H,42H,3CH,0,0FEH,1H,1H,1H,0FEH,0
DB 0E0H,10H,0FH,10H,0E0H,0,8H,8H,8H,0
DB 0FFH, 10H,10H,10H,0FFH,0,0FEH,1H,1H,1H,0FEH,0
DB 0E0H,10H,0FH,10H,0E0H,0,8H,8H,8H,0
DB 0FFH,28H,44H,82H,1H,0, 0FFH, 10H,10H,10H,0FFH,0
DB 7EH,81H,81H,81H,7EH,0,3FH,48H,88H,48H,3FH,0H,8H,8H ,8H,0
DB 80H,80H,0FFH,80H,80H,0,0FFH, 10H,10H,10H,0FFH,0
DB 0,81H,0FFH,81H,0,0,0FFH,20H,10H,8H,0FFH,0,0FFH
DB 10H,10H,10H,0FFH,0,8H,8H,8H,0
DB 0FCH,2H,1H,2H,0FCH,0,3FH,48H,88H,48H,3FH,0
DB 0FFH,20H,10H,8H,0FFH
DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0
DELAY1: MOV TMOD,#02H
MOV TH0,#(-200)
SETB TR0
JNB TF0,$
CLR TF0
RET
END
Comment