这是个按键控制led的程序,大家帮忙看看错哪了,谢谢了
ORG0000HJMPSTARTORG0030HSTART:MOVR0,#00HLOOP:MOVP1,#0FFHJBP0.1,OUTACALLDELAY1JBP0.1,O...
ORG 0000H
JMP START
ORG 0030H
START: MOV R0,#00H
LOOP: MOV P1,#0FFH
JB P0.1,OUT
ACALL DELAY1
JB P0.1,OUT
DELAY2: JNB P0.1,$
ACALL DELAY2
INC R0
INC R0
INC R0
CJNE R0,#0CH,OUT
JMP START
OUT: MOV DPTR,#TAB
MOV A,R0
JMP @A+DPTR
TAB: JMP LOOP0
JMP LOOP1
JMP LOOP2
JMP LOOP3
LOOP0:
SETB P1.0
SETB P1.1
SETB P1.2
SETB P1.3
SETB P1.4
SETB P1.5
SETB P1.6
SETB P1.7
ACALL DELAY
CLR P1.0
CLR P1.1
CLR P1.2
CLR P1.3
CLR P1.4
CLR P1.5
CLR P1.6
CLR P1.7
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP0
LOOP1:
SETB P1.0
ACALL DELAY
SETB P1.1
ACALL DELAY
SETB P1.2
ACALl DELAY
SETB P1.3
ACALL DELAY
SETB P1.4
ACALL DELAY
SETB P1.5
ACALL DELAY
SETB P1.6
ACALL DELAY
SETB P1.7
ACALL DELAY
CLR P1.0
ACALL DELAY
CLR P1.1
ACALL DELAY
CLR P1.2
ACALL DELAY
CLR P1.3
ACALL DELAY
CLR P1.4
ACALL DELAY
CLR P1.5
ACALL DELAY
CLR P1.6
ACALL DELAY
CLR P1.7
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP1
LOOP2:
SETB P1.3
ACALL DELAY
SETB P1.4
ACALL DELAY
SETB P1.2
ACALL DELAY
SETB P1.5
ACALL DELAY
SETB P1.1
ACALL DELAY
SETB P1.6
ACALL DELAY
SETB P1.0
ACALL DELAY
SETB P1.7
ACALL DELAY
CLR P1.0
ACALL DELAY
CLR P1.7
ACALL DELAY
CLR P1.1
ACALL DELAY
CLR P1.6
ACALL DELAY
CLR P1.2
ACALL DELAY
CLR P1.5
ACALL DELAY
CLR P1.3
ACALL DELAY
CLR P1.4
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP2
LOOP3:
SETB P1.0
SETB P1.1
ACALL DELAY
CLR P1.0
CLR P1.1
ACALL DELAY
SETB P1.2
SETB P1.3
ACALL DELAY
CLR P1.2
CLR P1.3
ACALL DELAY
SETB P1.4
SETB P1.5
ACALL DELAY
CLR P1.4
CLR P1.5
ACALL DELAY
SETB P1.6
SETB P1.7
ACALL DELAY
CLR P1.6
CLR P1.7
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP3
DELAY1: MOV R1,#4
D0: MOV R2,#248
DJNZ R2,$
DJNZ R1,D0
RET
DELAY: MOV R5,#100
D1: MOV R4,#20
D2: MOV R3,#248
DJNZ R3,$
DJNZ R4,D2
DJNZ R5,D1
RET
END
显示的错误是
led7.asm(6): error A18: OUT OF RANGE OR NON-TYPELESS BIT-OFFSET
led7.asm(75): error A51: TARGET OUT OF RANGE
led7.asm(109): error A51: TARGET OUT OF RANGE
led7.asm(134): error A51: TARGET OUT OF RANGE 展开
JMP START
ORG 0030H
START: MOV R0,#00H
LOOP: MOV P1,#0FFH
JB P0.1,OUT
ACALL DELAY1
JB P0.1,OUT
DELAY2: JNB P0.1,$
ACALL DELAY2
INC R0
INC R0
INC R0
CJNE R0,#0CH,OUT
JMP START
OUT: MOV DPTR,#TAB
MOV A,R0
JMP @A+DPTR
TAB: JMP LOOP0
JMP LOOP1
JMP LOOP2
JMP LOOP3
LOOP0:
SETB P1.0
SETB P1.1
SETB P1.2
SETB P1.3
SETB P1.4
SETB P1.5
SETB P1.6
SETB P1.7
ACALL DELAY
CLR P1.0
CLR P1.1
CLR P1.2
CLR P1.3
CLR P1.4
CLR P1.5
CLR P1.6
CLR P1.7
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP0
LOOP1:
SETB P1.0
ACALL DELAY
SETB P1.1
ACALL DELAY
SETB P1.2
ACALl DELAY
SETB P1.3
ACALL DELAY
SETB P1.4
ACALL DELAY
SETB P1.5
ACALL DELAY
SETB P1.6
ACALL DELAY
SETB P1.7
ACALL DELAY
CLR P1.0
ACALL DELAY
CLR P1.1
ACALL DELAY
CLR P1.2
ACALL DELAY
CLR P1.3
ACALL DELAY
CLR P1.4
ACALL DELAY
CLR P1.5
ACALL DELAY
CLR P1.6
ACALL DELAY
CLR P1.7
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP1
LOOP2:
SETB P1.3
ACALL DELAY
SETB P1.4
ACALL DELAY
SETB P1.2
ACALL DELAY
SETB P1.5
ACALL DELAY
SETB P1.1
ACALL DELAY
SETB P1.6
ACALL DELAY
SETB P1.0
ACALL DELAY
SETB P1.7
ACALL DELAY
CLR P1.0
ACALL DELAY
CLR P1.7
ACALL DELAY
CLR P1.1
ACALL DELAY
CLR P1.6
ACALL DELAY
CLR P1.2
ACALL DELAY
CLR P1.5
ACALL DELAY
CLR P1.3
ACALL DELAY
CLR P1.4
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP2
LOOP3:
SETB P1.0
SETB P1.1
ACALL DELAY
CLR P1.0
CLR P1.1
ACALL DELAY
SETB P1.2
SETB P1.3
ACALL DELAY
CLR P1.2
CLR P1.3
ACALL DELAY
SETB P1.4
SETB P1.5
ACALL DELAY
CLR P1.4
CLR P1.5
ACALL DELAY
SETB P1.6
SETB P1.7
ACALL DELAY
CLR P1.6
CLR P1.7
ACALL DELAY
JNB P0.1,LOOP
JMP LOOP3
DELAY1: MOV R1,#4
D0: MOV R2,#248
DJNZ R2,$
DJNZ R1,D0
RET
DELAY: MOV R5,#100
D1: MOV R4,#20
D2: MOV R3,#248
DJNZ R3,$
DJNZ R4,D2
DJNZ R5,D1
RET
END
显示的错误是
led7.asm(6): error A18: OUT OF RANGE OR NON-TYPELESS BIT-OFFSET
led7.asm(75): error A51: TARGET OUT OF RANGE
led7.asm(109): error A51: TARGET OUT OF RANGE
led7.asm(134): error A51: TARGET OUT OF RANGE 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询