> -----Original Message----- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > org] On Behalf Of John Regehr > Sent: Wednesday, March 28, 2007 10:15 PM > To: avr-gcc-list@nongnu.org > Subject: [avr-gcc-list] possible 4.1.2 bug > > > void foo (char, char, char, char, char); > > short bar (void) > { > char a = 0; > volatile char b = 0; > char c = 0; > char d = 0; > char e = 0; > int in; > int out; > > foo (e, d, c, b, a); > > __asm__ ("swap %B1 \n\t" > "swap %C1 \n\t" > "swap %D1 \n\t" > "ldi %A1, 0xf0 \n\t" > "eor %D1, %C1 \n\t" > "and %D1, %A1 \n\t" > "eor %D1, %C1 \n\t" > "eor %C1, %B1 \n\t" > "and %C1, %A1 \n\t" > "eor %C1, %B1 \n\t" > "movw %A0, %C1 \n\t" > : "=&r" (out) : "r" (in)); > > return out; > }
Besides what Joerg wrote, I'm puzzled about the above inline assembly. This code uses 4 parts (bytes), A through D, as if "in" was a 32-bit value. But both variables, out and in, are defined to be int, which on an AVR are 16 bits. Either there's a descrepency here, or I'm just not understanding what's going on here. Eric _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list