Doesn't there need to be a nop between the clear of GIE and the
following move?  The DINT instruction description in the manual
implies that without it the interrupt could still occur during the
first movx.

Peter

On Mon, Apr 18, 2011 at 9:27 AM, JMGross <msp...@grossibaer.de> wrote:
> extern inline __attribute__((always_inline)) unsigned char FlashReadByte 
> (unsigned long addr){
>  unsigned char result;
>  unsigned int register sr, flash;
>  __asm__ __volatile__ ("mov    r2  , %1   \n"
>                        "bic    %3  , r2    \n"
>                        "movx.a %4  , %2   \n"
>                        "movx.b @%2, %0    \n"
>                        "mov    %1 , r2    \n"
>                        :"=X"(result),"=r"(sr),"=r"(flash)
>                        :"i"(GIE),"m"(addr));
>  return result;
> }
>
> It compiles well with or without optimization and is always inlined.
> It still lets the compiler decide where to put the result (memory, register, 
> whatever) and
> without optimization generates still some unnecessary stuff, but less that 
> the original version.
> And it works.
> With optimization, the result is identical to the original.
>
>> p.s. just starting with this toolchain and MSP430 in general.
>
> We all did once :)
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to