ColdFire register usage and #pragma interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ColdFire register usage and #pragma interrupt

2,473 次查看
nspon
Contributor II
Does anyone know what registers are considered volatile/non-volatile across function calls by the CW compiler for Coldfire, v6.2? The manual doesn't say, and I'm wondering if they are all volatile.

I am also wondering if "#pragma interrupt on" is smart enough to save registers that are used by routines that are called by the interrupt routine that it is protecting. In other versions of CW there is a "#pragma interrupt called" to cover this, but the ColdFire compiler doesn't seem to have it.
标签 (1)
标记 (1)
0 项奖励
回复
1 回复

1,031 次查看
CrasyCat
Specialist III

Hello

Extract from CW Coldfire V6.2 "Targeting_ColdFire.pdf" manual:

"interrupt

Controls compilation for interrupt-routine object code.
   #pragma interrupt [ on | off | reset ]
Remarks
For the value ON, the compiler generates special prologues and epilogues for the
functions this pragma encapsulates The compiler saves or restores all modified
registers (both nonvolatile and scratch). Functions return via RTE instead of RTS.
You also can also use __declspec(interrupt) to mark functions as
interrupt routines, for example:


__declspec(interrupt) void alpha()
{
//enter code here
}"

So apparently it does :smileyhappy:

CrasyCat

0 项奖励
回复