Stuff like that may be hidden by the compiler, much as one might stick a bandaid on a sore to hide it, but the inefficiency is still there. C on
8 bit micros only gets away with it in most cases because the later cpu performance is far greater than cpu's used in the old assembler days. This is not a critique of avr either. Its a long time since I looked at the output from Keil C, but remember being horrified by a function with a simple switch statement + a few other lines of code producing over 2 A4 pages of 8051 assembler. We get away with it, but let's not pretend that it's anything like elegant - it's a compromise made to make software development easier, portable and more maintainable using cheap micros. The downside is that such limitations can make it much more difficult to produce structured, robust and portable code.As I said, I haven't used avr, but why not 16 bit registers instead of 8 ?. Sorry, but I don't see that as being particularly compiler friendly. Compiler friendly to me means n * 16 bit registers at a minimum and addressing modes to allow use for vars or addresses.
That's a bit of a red herring. Not all versions of the 430 have the multiplier in any case and it looks like it was intended as a fast dsp type 'peripheral'. The compiler must provide support via shift and add or similar to get multiply and divide in C.
Agreed, that could be a problem, but no doubt the compilers will be updated to make use of the added address space. They manage fine on the
24 bit 80C87 series and probably others as well...Regards,
Chris