<html>
<body>
At 09:34 AM 4/11/2008, bailey@peak.org wrote:<br>
<blockquote type=cite class=cite cite="">&nbsp;&nbsp;&nbsp; Hi.&nbsp; I'm
looking for suggestions of good ways to read the MSP-430<br>
status register from within a function in C as part of an effort to<br>
selectively disable/restore the GIE flag.&nbsp; I've played with
various<br>
approaches:<br><br>
1)&nbsp; Using inline asm ala: asm(&quot;mov r2,%saveSR&quot;)<br><br>
This doesn't work since the function it is called from is complex and
the<br>
compiler apparently can't free up a register to store the local
variable<br>
saveSR in.</blockquote><br>
Define a variable in a fixed location of memory and move to
that:<br><br>
<font size=3>#pragma abs_address 0x200<br>
unsigned int sr_copy;<br>
#pragma end_abs_address<br><br>
asm(&quot;mov r2, &amp;0x200&quot;);<br>
</font></body>
<br>
<br>
<div>-- </div>
<div>Jerry Durand, Durand Interstellar, Inc.&nbsp;
<a href="http://www.interstellar.com/" EUDORA=AUTOURL>
www.interstellar.com</a></div>
<div>tel: +1 408 356-3886, USA toll free: 1 866 356-3886</div>
<div>Skype:&nbsp; jerrydurand</div>
</html>