title: Add two numbers in assembly
body: <p>I'm just getting started with assembly and I wanted to create a simple program that adds two numbers and prints the result</p>
  <p>This is what I have so far:</p>
  <pre><code>.globl main
     .type main, @function
  main:
     movl $14, %eax
     movl $10, %ebx
     add %eax, %ebx
  call printf
  </code></pre>
  <p>From my understanding here is what's happening line by line</p>
  <p>Line 1: I'm creating a label main that can be accessed by the linker</p>
  <p>Line 2: I'm specifying the type of label main to a function</p>
  <p>Line 3: I begin my definition of main</p>
  <p>Line 4: I store the numeric value 14 into the general register eax</p>
  <p>Line 5: I store the numeric value 10 into the general register ebx</p>
  <p>Line 6: I add the values at eax and ebx and store the result in ebx</p>
  <p>Line 7: I call the function printf(here's where I get confused)</p>
  <p>How do I specify what value at which register gets printed?</p>
  <p>Also, how do I complete this program? Currently when run, the program results in a segmentation fault.</p>