title: How do assembly languages work?
body: <p>I'm very curious how assembly languages work- I remain general because I'm not talking only about intel x86 assembly (although it's the only one I'm remotely familiar with). To be a bit more clear...</p>
  
  <pre><code>mov %eax,%ebx
  </code></pre>
  
  <p>How does the computer know what an instruction like "mov" does? How does it know that eax and ebx are registers? Do people write grammars for assembly languages? How do they write this? I imagine nothing is stopping someone from writing an assembly language that substitutes the <code>mov</code> instruction with something like <code>dog</code> or <code>horse</code> etc., (obviously this isn't semantic at all)</p>
  
  <p>Sorry if this isn't too clear, but it's something I find a bit puzzling- I know it can't be magic, but I can't see how it works. I've looked up some stuff on wikipedia, but all it seems to say is it translates it down to machine code, well, what I'm asking is how that translation occurs I suppose.</p>
  
  <p>Thoughts?</p>
  
  <p>EDIT: I realize that this stuff is defined in reference manuals and things, I guess what I wish to know is how you tell your processor "Okay, when you see <code>mov</code> you're gonna do this". I also know that it's a sequence of probably a ton of logic gates..but there has to be some way for the processor to recognize is that <code>mov</code> is the symbol that means "use these logic gates"</p>