>Yes I will try to put together a patch with the minimal changes. I only
need
>to know one thing; can I assume that using this construction:
>
>/** \ingroup avr_eeprom
>    Read one 16-bit word (little endian) from EEPROM address \c addr.
*/
>uint16_t
>eeprom_read_word (const uint16_t *addr)
>{
>  register uint16_t result asm("r24"); //I can specify r24 only
>
>  __asm__ __volatile__ (
>        XCALL " __eeprom_read_word_" _REG_LOCATION_SUFFIX CR_TAB
>       : "+x" (addr),
>         "=w" (result) //Use w restrict to adiw capable registers
>       : );
>  return result;
>}

I fear that this will not be guaranteed to be correct! The compiler
might reorder code and might be tempted to optimize away your result
variable so that it could be placed in another register. The dangerous
thing is, that your code might work sometimes!

HTH,

Bjoern.


_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to