Linked by Hadrien Grasland on Fri 28th Jan 2011 20:37 UTC
Permalink for comment 460187
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
News
Linked by Thom Holwerda on 05/18/13 21:06 UTC
Linked by Thom Holwerda on 05/18/13 7:37 UTC
Linked by fran on 05/18/13 1:38 UTC
Linked by Thom Holwerda on 05/17/13 23:35 UTC, submitted by kragil
Linked by MOS6510 on 05/17/13 22:22 UTC
Linked by Thom Holwerda on 05/17/13 22:15 UTC, submitted by Tom
Linked by Thom Holwerda on 05/16/13 21:41 UTC
Linked by Thom Holwerda on 05/16/13 17:04 UTC
Linked by Thom Holwerda on 05/16/13 13:17 UTC
Linked by Thom Holwerda on 05/16/13 12:06 UTC
More News »
Sponsored Links



Member since:
2011-01-28
The majority should definitely be coded in a high level language.
In the days of DOS TSRs, we wrote in assembly because the code had to be small and efficient.
Even to this day it's often easy to beat a compiler's output simply because it is restrained by a fixed calling convention. In x86 assembly language, I am free to stuff values where I please. A variable can be stuffed into segment registers, a function returning boolean can use the "zero flag". This eliminates the need to do "cmp" in the calling function.
In my own assembly, I can keep variables intact across function calls without touching the stack. To my knowledge, all C compilers use unoptimized calling conventions by design so that separately compiled object files link correctly.
Of course above I'm assuming that function call overhead is significant, YMMV.
However, all this optimization aside, looking back on TSRs I wrote, it takes a long time to familiarize oneself with code paths again. This is true of HLL too, but even more so with assembly. It is crucial to comment everything in assembly, and it is equally crucial that the comments be accurate.
Low level assembly is just not suitable for code that is meant to developed over time by many people. Besides, it's not portable, and cannot benefit from new architectures with a simple recompile.
Off the top of my head, the bootloader and protected mode task management are the only things which really require any significant assembly language.