ColdFire register usage and #pragma interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ColdFire register usage and #pragma interrupt

2,179 Views
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.
Labels (1)
0 Kudos
Reply
1 Reply

737 Views
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 Kudos
Reply