title: Assembly: What is the best way to print something to screen (to command line)
body: <p>I've been doing some research, but I only find more and more ways to do what I want and I don't understand any of them.</p>
  
  <p>What code do I need to assemble into an .exe to return <code>5</code> to the command line?</p>
  
  <p>I want an exe that, when called, prints <code>5</code> .</p>
  
  <p>Research:</p>
  
  <pre><code>printf "5", 0
  </code></pre>
  
  <p>It requires to link with 2 libraries, and I want to keep it simple.</p>
  
  <pre><code>move ebx, 5 ; or move ax, 5
  ret
  </code></pre>
  
  <p>Why would this print <code>5</code> ? This loads a register whith a value <code>5</code> and returns. Nothing else.</p>
  
  <p>Could someone explain me the difference between those ways of returning <code>5</code>?</p>
  
  <p>What would be most appropiate for a very simple Windows EXE executable?</p>
  
  <p>I couldn't get the answers in the questions already asked in StackOverflow.</p>
  
  <p>NOTE, I use: Win 7, WinAsam, MASM</p>
  
  <p>THANKS!</p>