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 vs C

Hi,
We have one application which was developed in c51. By applying all aptimization techniqs provided by compiler, code size is near to 20k. If we change total code to Assembly from C, how much code size can be reduced?.
Please provide me ur inputs....

Ramesh

Parents
  • thanks for ur response.
    you will get as good an answer form a microresistor as anywhere else. Optimized C can be more compact that assembly and it can be up to 40% more, it all depends. as an example mov p2,#44 will take the same room as p2=44; but switch{} will probably take a bit more room than jmp @a+dptr.

    So, the corect and only reply to "We want to prapose with assembly, for minimum code size.
    We want rough idea how much we can reduce" is "that depends, who knows"

    another issue is that writing "compiler friendly" C can reduce the code size dramatically.

    Erik

Reply
  • thanks for ur response.
    you will get as good an answer form a microresistor as anywhere else. Optimized C can be more compact that assembly and it can be up to 40% more, it all depends. as an example mov p2,#44 will take the same room as p2=44; but switch{} will probably take a bit more room than jmp @a+dptr.

    So, the corect and only reply to "We want to prapose with assembly, for minimum code size.
    We want rough idea how much we can reduce" is "that depends, who knows"

    another issue is that writing "compiler friendly" C can reduce the code size dramatically.

    Erik

Children
No data