On Friday 11 November 2005 9:45 am, James Knott wrote:
Randall R Schulz wrote:
James,
On Thursday 10 November 2005 18:18, James Knott wrote:
...
About 10 years ago, someone wanted a DOS utility that would simply exit with a 0 return code. I did it in 5 bytes, using debug. With Turbo C, it took a few K bytes.
So what? That tells us nothing about how real designs are made efficient.
That would depend on what you mean by "efficient". Are you talking about writing a large program for use on a full desktop system, where developer time is important? Or perhaps writing for a small embedded device, where memory is critical? Until you know the priorities, you cannot say which method is better. In some situations, getting right down to the "bare metal", counting every byte is important. In others, what's a few meg of memory here and there? The issue here is that if you build with a high level language line C (not really a high-level language) you are going to get libraries linked in. (Note that IBM's OS used to supply one called IEFBR14. This was simply a utility that would exit). The C language requires the use of a library to set up the environment, and provide the 2 arguments to main. Most C compilers will automatically link in the C runtime libraries. In the above case, you are talking about just a few assembler statements.
--
Jerry Feldman