I've read that
The compiler converts code written in a human-readable programming language into a machine code representation which is understood by your processor.
How does the compiler know about the instruction set of my CPU?
Any reference to understand job of assembler, linker and loader would be helpful.
How does the compiler know about the instruction set of my CPU?
Most compilers only know how emit code for a specific CPU (or a small number of them). Each target CPU requires that someone write a compiler back-end for it, and that task is non-trivial.
GCC supports a large variety of targets, but even GCC is built to emit code for only a few targets. In other words, you can build GCC to emit code for x86_64
and i*86
processors, and you can build another copy to emit code for PowerPC
, but you can't build a single GCC that will produce code for all three.
Any reference to understand job of assembler, linker and loader
Google search for above terms led me here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With