How do i use mems with avr32-gcc?
uint8_t abc = 0;
asm( "mems %0, 1" : "=n" (abc) : "n" (abc) );
I tried this but i get following error:
output number 0 not directly addressable
Any idea whats the syntax looks like?
Write some C that will use the same the use - save-temps to see the Asm it generates
I think the problem is that im passing the variable "abc" incorrectly to the inline assembly.
I tried your suggesting but I dont even know how to force gcc to use "mems".
The AVR32 memx instructions (x = c, s, or t) only work with constant (immediate) parameters so you can't pass in a variable value.
Letting the smoke out since 1978
Thank you. I also found that avr32-gcc already includes __builtin_memx. But I'm not really sure what is meant with constant (immediate) parameters. Like a const variable at global scope?
EDIT: I went with __sync_ operation for my problem.
© 2018 Microchip Technology Inc.