开发者

size of executable files?

I created a very small code to add two integers and save the result in ano开发者_高级运维ther variables, both in assembly language and c language. code in assembly cost me 617 bytes but code in C took 25k bytes!! why there is a huge difference? Also how can I view the assembly symbolic instructions for C code I wrote?


High level languages have a certain amount of overhead. While in assembly all you have is exactly what you say.

The overhead you are seeing in this case is likely the static binding of standard components, such as printf. Likely an include statement added these.

If you want to see what your output is like you will need a dissembler. Here is the documentation for the NASM dissembler if you wanted to take a look at one.

You can avoid some of this overhead by not including anything and instead implement the functionality in a fashion similar to how you did in assembly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜