title: How does the C++ compiler know which CPU architecture is being used
body: <p>with reference to : <a href="http://www.cplusplus.com/articles/2v07M4Gy/" rel="nofollow noreferrer">http://www.cplusplus.com/articles/2v07M4Gy/</a></p>
  
  <p>During the compilation phase,</p>
  
  <p>This phase translates the program into a low level assembly level code. The compiler takes the preprocessed file ( without any directives) and generates an object file containing assembly level code. Now, the object file created is in the binary form. In the object file created, each line describes one low level machine level instruction.</p>
  
  <p>Now, if I am correct then different CPU architectures works on different assembly languages/syntax.</p>
  
  <p><strong>My question is how does the compiler comes to know to which assembly language syntax the source code has to be changed? In other words, how does the C++ compiler know which CPU architecture is there in the machine it is working on ?</strong></p>
  
  <p>Is there any mapping used by assembler w.r.t the CPU architecture for generating assembly code for different CPU architectures?</p>
  
  <p>N.S : I am beginner !!</p>