I am trying to write some code in inline assembly for ATmega328P I found that my output variable changes not in way i expected. So i reduced original code to this:
uint8_t a=0;
__asm__ (
"nop " "\n\t"
:"=&r" (a)
:
);
I am expecting that value of a will remain same, but depending of where in my programm i put this code value of a sometimes changes to something else. I am don't understanding why this happens. Will be glad if someone will explain to me what i am missing.