Dwayne Reid wrote: > At 01:27 PM 10/20/2011, Peter Johansson wrote: >=20 >> My suggestion is that you learn C and assembly side-by-side. Write >> all of your small sample programs in both C and assembly, and then >> compare the code the C compiler generates with your own code. >> Knowledge of just how your compiler does things can really help when >> stepping through your code in the debugger.=20 >>=20 >> Chances are you will probably wind up coding entirely in C, >> particularly if your compiler has a very good optimizer for your >> MCU, but the time spent learning assembly will be time well spent. >=20 > I've been deliberately staying out this discussion (I don't grok 'C', > so I code exclusively in Assembler), but I think that the above > advice is the best suggestion.=20 >=20 > If you already code in 'C' for other processors, it should be a short > learning curve.=20 >=20 > Great advice, Peter.=20 Agreed. The first thing on a new architecture that I do is to read the architecture and assembly manuals, then look at compiler-generated code and try to understand it.=20 What most arguments of the type "you need to understand assembly anyway" seem to miss is that there is a huge difference between being able to (slowly) read and understand assembly (which I agree is necessary, together with an understanding of the architecture), and being able to efficiently write assembly. Programming in C doesn't make the first part unnecessary, but the second part. You don't have to memorize all the assembly commands, which flags they affect etc... that's the compiler's job; I just have to know the general outlines of the architecture -- and where I can look up the details in case I need them. Gerhard --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .