[Icc-430] Reading MSP-430 status register from C....

Richard Man richard-lists at imagecraft.com
Fri Apr 11 13:08:24 PDT 2008


What's the name and effect of the IAR intrinsic?

1) doesn't work currently only because there's a bug in the asm 
inline expansion that it doesn't expand non-registered locals 
correctly. I will fix it.

At 09:34 AM 4/11/2008, bailey at peak.org wrote:
>     Hi.  I'm looking for suggestions of good ways to read the MSP-430
>status register from within a function in C as part of an effort to
>selectively disable/restore the GIE flag.  I've played with various
>approaches:
>
>1)  Using inline asm ala: asm("mov r2,%saveSR")
>
>This doesn't work since the function it is called from is complex and the
>compiler apparently can't free up a register to store the local variable
>saveSR in.
>
>2)  Use the "monitor" pragma on the function
>
>This doesn't work well since there are multiple sections of code in the
>function that need protection (chained accesses to the HW multiplier), and
>turning interrupts off for the duration increases the latency to the point
>where I'm losing high speed interrupts.
>
>3)  Use a simple function to read the value of the SR and return it.
>
>This works, but adds more overhead to the function execution than I like.
>
>     So, anyone have another approach they like, or perhaps a clever way of
>implementing one of the above?  (What I really need is an intrinsic ala
>IAR, etc :)
>

// richard (This email is for mailing lists. To reach me directly, 
please use richard at imagecraft.com) 



More information about the Icc-430 mailing list