你好!我想咨询下我在汇编中定义以下函数去使用宏指令,但是编译出现问题,求解决办法
.cdecls C,NOLIST,"headers.h"
.include "CNTL_2P2Z.asm"
.include "PFC_BL_ICMD.asm"
.include "PFC_InvRmsSqr.asm"
.sect "ramfuncs"
; label to DP ISR Run function
.def _others
_others:
; full context save – push any unprotected registers onto stack
PUSH AR1H:AR0H
PUSH XAR2
PUSH XAR3
PUSH XAR4
PUSH XAR5
PUSH XAR6
PUSH XAR7
PUSH XT
SPM 0 ; set C28 mode
;这句话是什么意思?
CLRC AMODE ;AMODE=0
CLRC PAGE0,OVM
; CLRC INTM ; clear interrupt mask – comment if ISR non-nestable
PFC_InvRmsSqr 1
PFC_BL_ICMD 1
MOVW DP,#(VloopCtr)
INC @VloopCtr
;自增吗?
CMP @VloopCtr,#VoltCurrLoopExecRatio
B SKIP_VLOOP_CALC,LT
;这句话是什么意思?
MOV @VloopCtr,#0
CNTL_2P2Z 1 ;Volt loop controller
SKIP_VLOOP_CALC:
;—————————————————————————————–
; full context restore
; SETC INTM ; set INTM to protect context restore
POP XT
POP XAR7
POP XAR6
POP XAR5
POP XAR4
POP XAR3
POP XAR2
POP AR1H:AR0H
IRET ; return from interrupt
.end
提示的错误是:
[E0002] Invalid mnemonic specification(出现在.global _others)
Seven Han:
您参考以下帖子能否解决:
http://www.deyisupport.com/question_answer/microcontrollers/c2000/f/56/t/91847.aspx