堆栈指针设置正确但致电不工作
我正在为MSP430F1232使用Ti Code Composer Studio。 从汇编器中的模板开始,对例程的调用行不通,但是当我将例程直接放入代码中时,它可以正常工作。为什么电话不起作用?
;generated code, the watchdog is stopped and the stack pointer is set correctly
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
mov.b #0FFh,P1DIR
mov.b #0,P1OUT
$1
call delay
xor.b #001h,P1OUT
jmp $1
.newblock ;reuse local labels
delay push r14
mov #1000,r14
$1
dec r14
jne $1
pop r14
ret
I'm using TI Code Composer Studio for the MSP430F1232.
Starting from a template in assembler, a call to a routine doesn't work but when I put the routine directly in the code,it works. Why does the call won't work?
;generated code, the watchdog is stopped and the stack pointer is set correctly
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
mov.b #0FFh,P1DIR
mov.b #0,P1OUT
$1
call delay
xor.b #001h,P1OUT
jmp $1
.newblock ;reuse local labels
delay push r14
mov #1000,r14
$1
dec r14
jne $1
pop r14
ret
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用类似的微型(MSP430FR2433)重现了问题。
事实证明,寻址模式是错误的。
对于其他微处理器类型,我们用于
MSP430,我们应该使用
I reproduced the problem with a similar micro (MSP430FR2433).
It turned out that the addressing mode was wrong.
With other microprocessor types, we use
For the MSP430 and similar, we should use