0
问答首页 最新问题 热门问题 等待回答标签广场
我要提问

MSP430中这两个函数的关系

__bic_SR_register()与__bic_SR_register_on_exit()这两个本征函数的异同点
提问者:freexhd 地点:- 浏览次数:6218 提问时间:07-05 13:40
我有更好的答案
提 交
3条回答
xtymh 07-09 06:31
__bic_SR_register_on_exit
Syntax
void __bic_SR_register_on_exit(unsigned short);
Description
Clears bits in the processor status register when an interrupt or monitor function returns. The function takes an integer as its argument, that is, a bit mask with the bits to be cleared.
This intrinsic function is only available in interrupt and monitor functions.


__bic_SR_register
Syntax
void __bic_SR_register(unsigned short);
Description
Clears bits in the processor status register. The function takes an integer as its argument, that is, a bit mask with the bits to be cleared.

__bic_SR_register_on_exit()是在中断程序里面使用的,中断返回时执行。
吃屎蛋拉你 07-09 21:58

前面没看懂。“在中断返回时执行”是什么意思啊?是指返回时硬件自动执行这句语句吗?
yunhai21 07-13 06:07
最最本质的区别就是 __bic_SR_register_on_exit() 在中断函数返回时修改了SP寄存器指向的SR状态,而不是当前中断函数里运行时的SR状态,因此可以用它在中断函数中退出LPMx模式
撰写答案
提 交
1 / 3
1 / 3