[SLL] Assembly tutorial
schuh
schuh at farmdale.com
Sun Aug 27 00:00:20 PDT 2006
On Sat, 26 Aug 2006, Mike Stunes wrote:
>I wrote Hello World programs in Assembly, C, and C++. Compare the
>sizes of the resulting binaries:
>
>Assembly: 440 B
>C: 9121 B
>C++: 14081 B
As was pointed out, various optimizations and post-processing can trim the
final size of the last two. On the other hand, assembler requires more
lines of source good - an inverse relationship prompting this question:
Is the product
(lines of code) * (bytes in executable binary)
a constant?
The C and C++ source are about the same length and (within a factor of 2)
yield the same sized binary image; comparing just these two versions,
however, suggests non-inverse relationship. Of course, it's the middle of
the night, so I don't think I'm being particular lucid here. I know I'm
not being serious... :)
ACM "Hello World" project:
http://www2.latech.edu/~acm/HelloWorld.shtml
Enjoy.
--
Mike Schuh - Seattle, Washington USA
http://www.farmdale.com
More information about the linux-list
mailing list