
#HOW TO WRITE C CODE BY HAND CODE#
Yet that code is quite often the fastest code even possible for a specific CPU or CPU family. If you look at the assembly code a compiler generates out of C code, this is quite often very unintuitive code no programmer would have ever come up with that kind of code to solve the problem. Quite often people think they can beat compilers but in real life benchmarks this is hardly ever the case. Quite often a skillful programmer was able to write assembly code that would execute much faster than the code a C compiler could generated out of comparable C code. On the other hand, compilers were much more limited than they are today. Their runtime behavior was very predictable: no out of order execution, no jump prediction, no parallelization within the core, no code optimization by the CPU, and most instructions had fixed number of cycles. So I assume that Hand Native is a short form for Hand Written Native Code.Īt the time this paper was written, most CPUs were much simpler than they are today. It requires a compiler that translates it to native code first or an interpreter, that will interpret it on a specific CPU.Īnd when native code is written directly by the programmer, this is called Hand Written native code, in contrast to machine or compiler generated one.

In contrast, C code, for example, is not native to any specific CPU. This machine code consists of instructions that the CPU can directly execute. Native Code refers to machine code native to a specific CPU.
