Hallo AVR friends..
In my Atmel Studio 7 project, I have over 500 same warnings. I think they come through the inline function in my header file op.h
warnings: "output constraint '=' for operand 0 is not at the beginning"
My code:
oscillator.c
.... //interpolation sample sample1 = hugemem_read8(p + addr); sample2 = hugemem_read8(p + addr + 1); uint8_t phase_x = (phase >> 8) & 0xff; sample = U8MixShift8(sample1,sample2, phase_x); ...
op.h
static inline uint8_t U8MixShift8(uint8_t a, uint8_t b, uint8_t balance) { uint16_t sum; asm( "mul %3, %2" "\n\t" // b * balance "movw %A0, r0" "\n\t" // to sum "com %2" "\n\t" // 255 - balance "mul %1, %2" "\n\t" // a * (255 - balance) "com %2" "\n\t" // reset balance to its previous value "add %A0, r0" "\n\t" // add to sum L "adc %B0, r1" "\n\t" // add to sum H "eor r1, r1" "\n\t" // reset r1 after multiplication : "&=r" (sum) : "a" (a), "a" (balance), "a" (b) ); return sum >> 8; }
Download my Atmel Studio7 project file (its free): https://drive.google.com/open?id=0BxbpDqwYdkvEMkdqS3JxbTdMZjg
Here my project blog: http://mutable-instruments.net/forum/discussion/2504/shruthi-synthesizer-and-my-wave-1#Item_1094
Thanks for your help :)) Rolf from germany