我的思路是通过检测霍尔元件的信号,来给驱动电路输出相应的控制字,我的程序检查也没有错误,但是在keil编译的时候出现*** error 65: access violation at C:0x0724 : no 'execute/read' permission,麻烦大佬帮忙看一下的我的语言有没有错误!非常感谢
SD EQU 32H;
H_R EQU 33H;存放霍尔元件值
Z_B BIT 36H;存放正转标志
SP_L EQU 34H
SP_h equ 35H
ORG 0000H
MOV DPTR,#Z_TAB;查询正转状态控制表
MOV SD,#36
Z_C:
CALL CHA_H_R
MOV A,H_R
CJNE A,#05H,ZHENG0
CJNE A,#01H,ZHENG1
CJNE A,#03H,ZHENG2
CJNE A,#02H,ZHENG3
CJNE A,#06H,ZHENG4
CJNE A,#04H,ZHENG5
LJMP Z_C
ZHENG0:
MOV R0,#00H
LJMP Z_0
ZHENG1:
MOV R0,#01H
LJMP Z_0
ZHENG2:
MOV R0,#02H
LJMP Z_0
ZHENG3:
MOV R0,#03H
LJMP Z_0
ZHENG4:
MOV R0,#04H
LJMP Z_0
ZHENG5:
MOV R0,#05H
Z_0:
MOV 31H,SD
MOV A,R0
CJNE A,#05H,Z_1
CALL C_SU
MOV R0,#00H
LJMP Z_2
Z_1:
INC R0
Z_2:
MOV A,R0
MOVC A,@A+DPTR
MOV R2,A
MOV A,P1
ORL A,R2
MOV P1,A
Z_EXIT:RET
Z_TAB:DB 19H,1AH,32H,34H,2CH,29H;
CHA_H_R:
MOV A,P2
SWAP A
ANL A,#00000111B
MOV H_R,A
RET
C_SU:
INC SP_L
MOV A,SP_L
CJNE A,#64H,C_0
MOV SP_L,#0
INC SP_H
MOV A,SP_H
CJNE A,#64H,C_0
MOV SP_H,#0H
C_0:RET
END |