初学者求助大神
时间:10-02
整理:3721RD
点击:
ORG 0000H
LJMP MAIN
ORG 001BH
LJMP INT
ORG 0023H
DS 3
ORG 0040H
MAIN:
MOV A, #0FEH
MOV R1, #00H
MOV R0, #10
MOV TMOD, #01H
MOV TL0, #0B0H
MOV TH0, #03CH
MOV IE, #82H
SETB TR0
DISPLAY:
MOV P0, A
CJNE R0, #00,DISPLAY
MOV R0, #10
INC R1
CJNE R1, #012H,NEXT
MOV R1, #00H
NEXT:
MOV A, R1
MOV DPTR, #TAB
MOVC A, @A+DPTR
LJMP DISPLAY
INT:
MOV TL0, #0B0H
MOV TH0, #03CH
DEC R0
RETI
TAB:
DB 0FEH,0FCH,0F8H,0F0H,0E0H,0C0H,80H,00H
DB 01H,03H,07H,0FH,3FH,7FH,0FFH
DB 00H,0FFH
END
调试时,点全速运行,出现这个*** error 65: access violation at C:0x000B : no 'execute/read' permission
LJMP MAIN
ORG 001BH
LJMP INT
ORG 0023H
DS 3
ORG 0040H
MAIN:
MOV A, #0FEH
MOV R1, #00H
MOV R0, #10
MOV TMOD, #01H
MOV TL0, #0B0H
MOV TH0, #03CH
MOV IE, #82H
SETB TR0
DISPLAY:
MOV P0, A
CJNE R0, #00,DISPLAY
MOV R0, #10
INC R1
CJNE R1, #012H,NEXT
MOV R1, #00H
NEXT:
MOV A, R1
MOV DPTR, #TAB
MOVC A, @A+DPTR
LJMP DISPLAY
INT:
MOV TL0, #0B0H
MOV TH0, #03CH
DEC R0
RETI
TAB:
DB 0FEH,0FCH,0F8H,0F0H,0E0H,0C0H,80H,00H
DB 01H,03H,07H,0FH,3FH,7FH,0FFH
DB 00H,0FFH
END
调试时,点全速运行,出现这个*** error 65: access violation at C:0x000B : no 'execute/read' permission
使用了定时器0中断,但没有在中断入口写可执行的代码,也就是没有写定时器0中断程序
啥?初学不太懂,麻烦说得清楚一点点,谢谢
你的中断地址写错了吧,定时器0的中断地址是000BH,001BH是定时器1的中断地址,你打开了定时器0,但中断程序INT的入口却写成了定时器1的中断入口
噢噢!对哦 真的是....搞了半天 太谢谢了