简体   繁体   English

MSP430执行库

[英]MSP430 execution banks

I am new to MSP430 architecture and I am porting an RTOS which is written for ARM Cortex M3 into this architecure. 我是MSP430架构的新手,并且正在将为ARM Cortex M3编写的RTOS移植到此体系结构中。 In ARM Cortex architecture, there are PSP and MSP registers to hold stack values for execution modes. 在ARM Cortex架构中,有PSP和MSP寄存器保存执行模式的堆栈值。

As I understand from MSP430 architecture there is only just one stack pointer register (SP). 据我从MSP430架构了解,只有一个堆栈指针寄存器(SP)。

Here are my questions: 这是我的问题:

-Is there only one register bank for SP within interrupt/execution context? -在中断/执行上下文中是否只有一个SP寄存器组?

-Can I use regular C functions for interrupt handling in MSP430 as in ARM Cortex? -是否可以像在ARM Cortex中那样在MSP430中使用常规C函数进行中断处理?

-How does MSP430 handle (save/restore) registers during interrupt execution (specifically SP, SR and PC)? -在中断执行期间(特别是SP,SR和PC),MSP430如何处理(保存/恢复)寄存器?

  1. There are no banks in terms of MSP430 registers, it is the only one SP register within context. MSP430寄存器没有存储区,它是上下文中唯一的一个SP寄存器。 在此处输入图片说明

  2. Yes, you can use C functions for interrupt handling link 是的,您可以使用C函数进行中断处理链接

__interrupt void MyFuncISR(void)

or it also can be like 或者也可以像

#pragma vector=TIMER0_A0_VECTOR    
__interrupt void
ta0cc0_isr (void)

in this case compiler will set the proper interrupt vector by the define/name you provide 在这种情况下,编译器将通过您提供的定义/名称设置适当的中断向量

3. The interrupt logic executes the following: 1. Any currently executing instruction is completed. 3.中断逻辑执行以下操作:1.任何当前正在执行的指令均已完成。 2. The PC, which points to the next instruction, is pushed onto the stack. 2.指向下一条指令的PC被压入堆栈。 3. The SR is pushed onto the stack and so on, see below: 3. SR被推入堆栈,依此类推,如下所示: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM