I'm currently studying engineering in Telecommunications and Electronics and we have migrated from assembler to C in microprocessor programming.  I have doubts that this is a good idea.  What are some advantages and disadvantages of C compared to assembly?  The advantages/disadvantages I see are:Advantages:I can tell that C syntax is a lot easier to learnthan Assembler syntax.C is easier to use for making more complex programs.Learning C is somehow more productive than learning assembler cause there is more developing stuff around C than Assembler.Disadvantages:Assembler is a lower level programming language than C,so this makes it a good for programming directly to hardware.Is a lot more flexible alluding you to work with memory,interrupts,micro-registers,etc.
What Are Some Advantages/Disadvantages of Using C over Assembly?
c;low level;assembly
Here are some stack overflow answers that may help you (these are the the top response, accepted answers):Advantageshttps://stackoverflow.com/questions/143561/is-there-a-need-to-use-assembly-these-daysAssembly is used in the earliest stages of the bootloader. When the CPU powers on the stack isn't available, and its tough to keep the C compiler from trying to save things to the stack. The bulk of the bootloader is nonetheless written in C, once the earliest initialization is done.Assembly is used to write mutex locking primitives. It is essentially impossible to get a C compiler to emit memory barrier instructions at the required places.Routines like memset() or memcpy() are often done in assembly. For example, I wrote a memset() with a large unrolled loop, which dynamically computes a branch address to jump into the middle of that loop for one final iteration. A C routine would have generated more code, taking extra I$ misses. Likewise, CPU instruction sets often include cache line load or other instructions which can dramatically speed up memcpy(), which the C compiler will not utilize.Disadvantageshttps://stackoverflow.com/questions/2684364/why-arent-programs-written-in-assembly-more-oftenASM has poor legibility and isn't really maintainable compared to higher-level languages.Also, there are many fewer ASM developers than for other more popular languages, such as C.Furthermore, if you use a higher-level language and new ASM instructions become available (SSE for example), you just need to update your compiler and your old code can easily make use of the new instructions.ExampleThe last post below is a Stack Overflow post outlining a scenario which will show an assembly example that is faster than C (when performing the same function).https://stackoverflow.com/questions/577554/when-is-assembler-faster-than-c