Hallo zusammen und einen schönen guten Morgen :)
Ich bin dabei meinen Projektcode in Atmel Studio etwas zu entmüllen und
bekomme über 200 gleiche Warnnungen angezeigt ups...
Warnungen: "output constraint '=' for operand 0 is not at the beginning"
Vermutlich liegts an den verwendeten asm inline Funktionen in der op.h
Datei.
Hier ein Beispiel:
oscillator.c
1 | ....
|
2 |
|
3 | //interpolation sample
|
4 | sample1 = hugemem_read8(p + addr);
|
5 | sample2 = hugemem_read8(p + addr + 1);
|
6 | uint8_t phase_x = (phase >> 8) & 0xff;
|
7 | sample = U8MixShift8(sample1,sample2, phase_x);
|
8 | ...
|
op.h
1 | static inline uint8_t U8MixShift8(uint8_t a, uint8_t b, uint8_t balance) {
|
2 | uint16_t sum;
|
3 | asm(
|
4 | "mul %3, %2" "\n\t" // b * balance
|
5 | "movw %A0, r0" "\n\t" // to sum
|
6 | "com %2" "\n\t" // 255 - balance
|
7 | "mul %1, %2" "\n\t" // a * (255 - balance)
|
8 | "com %2" "\n\t" // reset balance to its previous value
|
9 | "add %A0, r0" "\n\t" // add to sum L
|
10 | "adc %B0, r1" "\n\t" // add to sum H
|
11 | "eor r1, r1" "\n\t" // reset r1 after multiplication
|
12 | : "&=r" (sum)
|
13 | : "a" (a), "a" (balance), "a" (b)
|
14 | );
|
15 | return sum >> 8;
|
16 | }
|
Ich hab das ganze Atmel Studio7 Projekt File mal als zip im Anhang
hochgeladen. Der Code ist frei.
Wer mehr über das Projekt wissen will schaut bitte hier:
Beitrag "AVR Synthesizer mit ATxmega128A1"
Im Voraus schon mal vielen Danke für eure Hilfe. Lieben Gruß Rolf aus
Wuppertal :)