I wrote a simple one-line C program and I get 4K of HEX code. What is going on here?
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).