PaulS:
It's much faster to do in assembly..
Are you sure now? i *= 5 compiles to:
12e: 9c 01 movw r18, r24
130: 22 0f add r18, r18
132: 33 1f adc r19, r19
134: 22 0f add r18, r18
136: 33 1f adc r19, r19
138: 28 0f add r18, r24
13a: 39 1f adc r19, r25
(that's (i+i)+(i+i)+i )
Where can I find the reference for In-line Assembly in GCC? Only resource I can find is:
http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
Which is not sufficient... :([/color]
[/quote]
You probably need the gnu assembler manual (to cover all the non-cpu-specific features of the assembler), and the Atmel AVR instruction set manual (which you have to apply some salt to, since it uses a different syntax for some things than the gnu assembler.) And the device data sheet to tell you which instructions are present on the specific chip you are using. (for example, there is an 8x8 multiply instruction, but it is not present on ATtiny cpus.)