title: Different assembly syntaxes for same cpu?
body: <p>I've decided to learn assembler through online tutorials.</p>
  
  <p>I've come across this one that uses the NASM compiler, which most other tutorials seem to as well:
  <a href="http://www.tutorialspoint.com/assembly_programming/index.htm" rel="nofollow">http://www.tutorialspoint.com/assembly_programming/index.htm</a></p>
  
  <p>I've also come across this youtube series "Assembly primer for hackers"
  <a href="https://www.youtube.com/watch?v=K0g-twyhmQ4&amp;list=PLue5IPmkmZ-P1pDbF3vSQtuNquX0SZHpB" rel="nofollow">https://www.youtube.com/watch?v=K0g-twyhmQ4&amp;list=PLue5IPmkmZ-P1pDbF3vSQtuNquX0SZHpB</a>
  This one uses what the guy describes as the 'generic linux compiler' (owtte).
  The commands for compiling go something like this:</p>
  
  <p><code>as -o file.o file.s</code></p>
  
  <p>Where file.s is the assembly source code.  Followed by:</p>
  
  <pre><code>ld -o file file.o
  </code></pre>
  
  <p>Where file is then the executable.</p>
  
  <p>Each of the tutorials uses a different syntax (e.g. a register in the latter tutorial is always preceded by %. NB. There do appear to be less superficial differences in the syntax than this as well).  Are these syntaxes decided by the individual compiler?</p>
  
  <p>I was also initially confused when I tried to compile code from the NASM tutorial with the latter method. I was always under the impression that the instruction set had to depend on the CPU and it therefore shouldn't matter which compiler I use.  I've just concluded that it's merely differences in syntax but is that correct?</p>
  
  <p>I'm running a Linux computer, by the way, on kernel 4.1.6.</p>
  
  <p>My main question is really which syntax do I use?  Is it just a matter of choice?  Is one more widely used than the other?  Thanks for any help.</p>