[Icc-430] Reading MSP-430 status register from C....
mojaveg at IWVISP.com
mojaveg at IWVISP.com
Fri Apr 11 12:23:33 PDT 2008
> Now I'm sure I must be missing something. Your suggestion:
>
> > DINT();
> > asm("mov r2, &0x200");
> > new_save = sr_copy;
> > EINT();
>
> doesn't seem like it would work since the _DINT(); would clear the GIE
> bit I'm trying to read with the "mov"? And while you can use a _DINT();/
> _EINT(); pair to protect critical sections, you had better make sure that
> interrupts were enabled when the code was called, if not they will be
> afterwards :)
>
> Also, I don't think I can use different addresses to save the status
> since the address is part of the function being called, not the function
> doing the calling? If I pass the address in as a parameter then I'm back
> to the compiler not having an available register to store it in...
Of what portion of the SR are you trying to make use?
What is the obsession about the "compiler not having
enough registers to store the result"? Isn't register
allocation the compiler's problem?
More information about the Icc-430
mailing list