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

C v/s Assembly

What are the merits and demerits of using C over assembly language for mcu programming.

thank you

ece

Parents
  • "Only (sic) specific language extensions to take advantage of the architecture or code that manipulates bits in the processor will be non-portable or require some rewrites if changing to a different processor."

    Those parts will certainly need re-writing - but they are not the only parts!

    There are many details of the 'C' language which are implementation-defined - any code which relies on such details will be non-portable.

    But there are techniques to "encapsulate" these dependencies so that porting can be quite painless.

    With assembler, you can't even guarantee that a different assembler for the same architecture will have even remotely similar syntax!

Reply
  • "Only (sic) specific language extensions to take advantage of the architecture or code that manipulates bits in the processor will be non-portable or require some rewrites if changing to a different processor."

    Those parts will certainly need re-writing - but they are not the only parts!

    There are many details of the 'C' language which are implementation-defined - any code which relies on such details will be non-portable.

    But there are techniques to "encapsulate" these dependencies so that porting can be quite painless.

    With assembler, you can't even guarantee that a different assembler for the same architecture will have even remotely similar syntax!

Children
No data