Skip to main content
matic
Associate III
Nov 7, 2015 8:15 PM UTC
Question

C vs. assembly

Posted on November 07, 2015 at 21:15

Hi. I'm interested in that how you are programming - in C or in assembly language?

What are really benefits of assembly in contrast to C? Speed of code execution probably? How much faster it is, if you compare the same code written in assembly with that written in C with enabled all of optimization (level 3 in Keil and checked ''optimize for time'').

Also, when you move from one core to another (let say from Cortex M3 to M4), you have to learn many new instructions, don't you?

#32-bits-of-a-bus #assembly-language
    This topic has been closed for replies.

    13 replies

    Tesla DeLorean
    Guru
    Nov 9, 2015 7:35 PM UTC
    Posted on November 09, 2015 at 20:35

    Another 10 or 15 years the 8051, PIC, AVR and all the other 8/16 bitters will be quaint museum exhibits, sitting next to Bendix G-15s and PDP-8s.

    They've been telling me that for decades, the university here is still using the 68HC11 as a teaching tool, I suspect the only way to fix that is to replace the old profs with some more industry savvy ones who've been learning new skills rather than unearthing silicon antiquities.

    https://www.youtube.com/watch?v=dPmiC_Zt88I

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    mikael239955_stm1_st
    Associate III
    Nov 9, 2015 10:11 PM UTC
    Posted on November 09, 2015 at 23:11

    >I'd prefer a M4/M7 any day.... > IMHO the dsPIC was a particularly bad example.

    Didn't say dsPIC was the solution, just mentioned it for what it was in it's day compared to what STM (F100,102, 103) could deliver in that point of time Hz by Hz in an environment of C vs ASM to OP's question. Obviously everything else at 400Mhz TODAY makes dsPIC sort of antique. 

    Oh Forum motor destroyed post order,,,again!
    AvaTar
    Senior III
    Nov 10, 2015 7:59 AM UTC
    Posted on November 10, 2015 at 08:59

    >Didn't say dsPIC was the solution, just mentioned it for what it was in it's day compared to what STM (F100,102, 103) could deliver ...

     

    At least I also understood it in that way.

    With ''bad example'' I especially meant Microchip's half-assed C language support. IMHO it seems they have strained themself with their ''everything but ARM'' strategy and incoherent MCU/core portfolio. DSP's definitely have their ''raison d'etre'', when properly supported. And there are plenty of vendors who are much better in this regard.