This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembly programming - yes, no, when, how to start, ... ??

Hello again.

As I am very interested in learning ARM architecture, I would have few questions regarding assembly programming. Questions refer primarily to programming Cortex-M processors, because they are the only one which I am using (at least for now).

So... Do you program in C or assembly and why that? How do you suggest to start learning assembly programming? Do you think that the gain of execution time is big enough to justify time spent for assembly programming instead of C programming (with full optimization). Because in my case, processing time is quite important. Do you maybe only use intrinsics in special cases? Or inline/embedded assembly?

Every hint is very welcome and appreciated. Thank you in advance.

Regards,

Matic

Parents
  • For 99.99% of new code start with C, and just take care how you write it for the bits where performance matters. In general if you write C the same way you write assembler then the compiler will usually win on performance, and you get all of the benefits of C over assembler (readability, portability, development speed).

    Starting out with assembler is just going to give you a very large amount of development pain, because it's just so much slower to write, debug, review, and maintain. It is always possible to add in small amounts of assembler in to a C program later for any performance hotspots if you really need to (but even then I would start by trying to optimize the C code as C code first) ...

    HTH,
    Pete

Reply
  • For 99.99% of new code start with C, and just take care how you write it for the bits where performance matters. In general if you write C the same way you write assembler then the compiler will usually win on performance, and you get all of the benefits of C over assembler (readability, portability, development speed).

    Starting out with assembler is just going to give you a very large amount of development pain, because it's just so much slower to write, debug, review, and maintain. It is always possible to add in small amounts of assembler in to a C program later for any performance hotspots if you really need to (but even then I would start by trying to optimize the C code as C code first) ...

    HTH,
    Pete

Children