Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I wrote a simple one-line C program and I get 4K of HEX code. What is going on here?

0
Posted

I wrote a simple one-line C program and I get 4K of HEX code. What is going on here?

0

First, right-click and use the “properties” option to see the actual size of the file. Windows reports how much space a file takes up on disk, not the real size of the file. Further, the actual binary file is about 40% to 45% of the HEX file. The compiler links to a static library of size 2K (binary). This library contains the low-level routines (such as 16-bit arithmetic routines), which may be called when computing expressions. The Reads51 compiler is not optimized to selectively include these routines. This makes the final code relatively large for very simple programs. You will notice that your code binary size does not grow as much afterwards. (Also see Q 005).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123