希望能详细说出错误的地方
ORG 0000H
AJMP MAIN
ORG 000BH
LJMP BRTO
MAIN: MOV P1,#3FH;打开显示零
MOV P2,#00H
MOV R1,#00H
MOV R2,#00H
MOV TMOD,#01H
MOV TH0,#D8H
MOV TL0,#0F0H
SETB EA
SETB ET0
SETB TR0
MOV R0,#64H
LOOP: MOV A,R1
MOV 60H,A
CJNE R1,#09H,BRTO;转到中断,不知道可不可以
ACALL DELAY
MOV R1,#00H
MOV A,R1
MOV 60H,A
INC R2
MOV A,#00H
MOV A,R2
MOV 61H,A
LOOP1:CJNE R2,#05H,LOOP
ACALL DELAY1
MOV R2,#00H
MOV A,#00H
MOV A,R2
MOV 61H,A
RE
ti
DISP: MOV R3,#60H;显示程序是仿照教材书的,不知道对不对
MOV R5,#01H
LD0: MOV A, @R3
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV DPTR,#A0H
MOVX @DPTR,A
ACALL DELAY2
INC R3
MOV A,R5
JNB ACC.1, LD1
RL A
MOV R5,A
AJMP LD0
LD1: RET
DELAY:MOV R5,#64H
DELAY1:MOV R6,#900
DELAY2:MOV R7,#02H
BRTO: DJNZ R0,NEXT
INC R1
MOV R0,#64H
NEXT: MOV TH0,#D8H
MOV TL0,#0F0H
RET
END
一周热门 更多>