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

about code size

hi, I'm a C51 beginner,I writen a C51 program which generated binary code about 30Kbytes, but in .asm program,it generated binary code only about 16Kbyte. How can I save the C51 program's code size? thanks!

Parents
  • You should be prepared for larger code size when using a C compiler, especially since the 8051 is not an ideal target for 'C'. The 8051 architecture was designed at a time when 8K of ROM was considered a lot of program memory. 'C' came out after the 8051, and at the time the only higher level languages were PL/M or Basic for micros.

    You should optimize for code size rather than speed (see the compiler options), but based on my experience, a 2X increase in code size is not out of line.

Reply
  • You should be prepared for larger code size when using a C compiler, especially since the 8051 is not an ideal target for 'C'. The 8051 architecture was designed at a time when 8K of ROM was considered a lot of program memory. 'C' came out after the 8051, and at the time the only higher level languages were PL/M or Basic for micros.

    You should optimize for code size rather than speed (see the compiler options), but based on my experience, a 2X increase in code size is not out of line.

Children
No data