Walter said:
For more than a decade most serious commercial compilers
have not needed assembler for speed critical code.
When you say, compilers have not needed assembler for speed critical
code, I assume you mean that those compilers eliminate need of using
assembly for the application programmer, instead of a requirement for
writing the compiler.
Consider these application timing constraints:
1. A code segment executes under 100 us.
2. A code segment executes in exactly 12 us.
The first constraint can be verified by running test code and timing.
However, if a compiler option is changed, will it still be valid? If
adding additional variables causes time-critical variables to be divided
among more than one page (think PICs), will the timing be valid? If the
compiler is updated or even replaced with a version for another vendor,
will the timing stay valid? One way to accomodate variations is to
retest timing after any possible or suspect changes. These tests
usually cannot be easily automated.
The second constraint is even more critical. While C code can be
tweaked, in a lot of cases, to achieve the exact timing requirement, it
is subject to the same sources of variation.
While target-specific C can to be used to achieve critical timing
requirements in many cases, it takes vigilance to assure continued
compliance with system changes.
In contrast, assembly code performance isn't normally subject to the
variations stated above.
Don't misunderstand -- I use C whenever I think it is feasible, but
there is still a valid reason for using assembly code.